Skip to content

v2.0.0: Namespaces, Port Management, and File Watching

Choose a tag to compare

@jdx jdx released this 04 Mar 14:10
· 207 commits to main since this release
Immutable release. Only release title and notes can be modified.
95d8824

Pitchfork v2.0.0 is a major release that introduces namespace-qualified daemon IDs, port conflict management, and several important bug fixes. The namespace change is breaking -- daemon IDs are now in namespace/name format -- but short IDs continue to work when unambiguous, and legacy log directories are automatically migrated.

Highlights

  • Namespaces: Daemons across different projects no longer collide. Each project gets a namespace (derived from directory name or explicit config), and daemon IDs become namespace/name. Short names still work when you're inside the project directory.
  • Port conflict detection: Daemons can declare expected ports and opt into auto-bump, so pitchfork will find an available port if the configured one is already in use.
  • File watching actually works: The watch config field was previously broken -- patterns were lost after daemon startup. This release rewrites the watcher to persist patterns in state and dynamically pick up new daemons.

Added

  • Port conflict detection and auto-bump: Declare expected_port and auto_bump_port in your daemon config, and pitchfork will check for conflicts before starting and automatically increment ports if needed. Resolved ports are injected as PORT, PORT0, PORT1, etc. environment variables. New CLI flags --expected-port and --auto-bump-port are available on run, start, and config add. A network view (press p in the TUI) shows all listening processes. (#259) - @benjaminwestern

    [daemons.api]
    run = "npm run dev"
    expected_port = [3000]
    auto_bump_port = true

Fixed

  • File watching for daemon auto-restart: The watch field in pitchfork.toml was documented but non-functional. Watch patterns and base directories are now persisted in daemon state and the watcher dynamically refreshes every 10 seconds to pick up new daemons. (#255) - @benjaminwestern
  • pitchfork config add generates valid TOML: Previously, pitchfork config add joined all arguments into a single run string, producing broken config. It now accepts proper CLI flags (--run, --retry, --watch, --depends, --env, etc.) and generates correct TOML with each option as a separate field. (#258) - @benjaminwestern
  • pitchfork logs --tail bypasses pager: Using --tail no longer opens less and blocks with (END) -- logs now stream directly to stdout. (#253) - @jdx
  • TUI log rendering and scroll behavior: Fixed text wrapping causing lines to be hidden below the viewport. The scroll model was rewritten to track the last visible line rather than the first, and tab characters and ANSI clear-screen codes are now stripped from log output. (#264) - @dimmyjing

Breaking Changes

  • Daemon IDs now include a namespace: All daemon IDs are internally stored as namespace/name (e.g., frontend/api). The namespace is derived from the project directory name, or can be explicitly set with namespace = "..." at the top of pitchfork.toml. Short IDs (e.g., api) continue to work when unambiguous. The PITCHFORK_DAEMON_ID environment variable now contains the fully-qualified ID, and a new PITCHFORK_DAEMON_NAMESPACE variable is available. Log directories are renamed from <name>/ to <namespace>--<name>/; existing logs are automatically migrated to a legacy namespace. The depends field now accepts cross-namespace references (e.g., global/postgres). (#213) - @gaojunran

    If you have scripts that parse PITCHFORK_DAEMON_ID, they will now receive namespace/name instead of just name. Directory names containing -- are reserved for internal encoding and will require an explicit namespace override.

New Contributors

Full Changelog: v1.6.0...v2.0.0