Skip to content

mise Integration

Use mise with pitchfork for enhanced development workflows.

Why Use mise with Pitchfork?

mise handles:

  • Installing and managing dev tools (Node, Python, etc.)
  • Environment variables
  • Task dependencies and setup

Pitchfork handles:

  • Running background daemons
  • Process lifecycle management
  • Ready checks and retries

Together, they provide a complete development environment solution.

Built-in mise Integration

When pitchfork runs as a login daemon (e.g. via pitchfork boot) or in non-interactive environments (e.g. cron), tools installed by mise may not be on PATH because shell hooks haven't run. The built-in mise integration solves this by wrapping your daemon commands with mise x --, which activates the mise environment before executing the command.

Global Setting

Enable mise for all daemons in settings:

toml
# ~/.config/pitchfork/config.toml
[settings.general]
mise = true

Per-Daemon Override

Enable or disable mise for individual daemons in pitchfork.toml:

toml
[daemons.api]
run = "node server.js"
mise = true  # Enable mise for this daemon

[daemons.simple]
run = "echo hello"
mise = false  # Disable mise even if globally enabled

Per-daemon mise overrides the global general.mise setting. If neither is set, mise is disabled by default.

Custom mise Binary Path

If mise is not in a well-known location, specify the path:

toml
# ~/.config/pitchfork/config.toml
[settings.general]
mise = true
mise_bin = "/opt/custom/bin/mise"

Pitchfork automatically searches these paths when mise_bin is not set:

  • ~/.local/bin/mise
  • ~/.cargo/bin/mise
  • /usr/local/bin/mise
  • /opt/homebrew/bin/mise

How It Works

When mise = true is set for a daemon, pitchfork wraps the command:

# Without mise:
sh -c "exec node server.js"

# With mise:
sh -c "exec /path/to/mise x -- node server.js"

mise x -- activates all tools and environment variables from mise.toml / .tool-versions in the daemon's working directory before running the command.

Using mise Tasks

You can also use mise tasks directly as daemon commands. This approach gives you full control over tool installation, environment variables, and task dependencies:

pitchfork.toml:

toml
[daemons.docs]
run = "mise run docs:dev"

mise.toml:

toml
[env]
NODE_ENV = "development"

[tools]
node = "20"

[tasks."docs:setup"]
run = "npm install"

[tasks."docs:dev"]
run = "node docs/index.js"
depends = ["docs:setup"]

Workflow

  1. pitchfork start docs launches the daemon
  2. Pitchfork calls mise run docs:dev
  3. mise ensures Node 20 is installed
  4. mise runs the docs:setup dependency first
  5. mise sets NODE_ENV=development and starts the server
  6. Pitchfork monitors the process and handles restarts

Example: Full Stack App

pitchfork.toml:

toml
[daemons.api]
run = "mise run api:dev"
auto = ["start", "stop"]
ready_http = "http://localhost:3000/health"

[daemons.frontend]
run = "mise run frontend:dev"
auto = ["start", "stop"]
ready_output = "ready in"

mise.toml:

toml
[tools]
node = "20"
python = "3.11"

[env]
DATABASE_URL = "postgres://localhost/myapp"

[tasks."api:setup"]
run = "pip install -r requirements.txt"

[tasks."api:dev"]
run = "uvicorn main:app --reload"
depends = ["api:setup"]

[tasks."frontend:setup"]
run = "npm install"

[tasks."frontend:dev"]
run = "npm run dev"
depends = ["frontend:setup"]

Benefits

  • Tool management: mise ensures correct tool versions are installed
  • Environment: mise sets environment variables before the daemon starts
  • Dependencies: mise runs setup tasks (npm install, etc.) automatically
  • Lifecycle: pitchfork handles process monitoring, restarts, and ready checks
  • Login daemons: Built-in mise = true ensures tools are available even without interactive shell hooks

Released under the MIT License.