Skip to content

Run dev servers from the menu bar, release 0.7.0 - #12

Merged
enso-works merged 29 commits into
mainfrom
run-servers
Oct 24, 2026
Merged

enso-works merged 29 commits into
mainfrom
run-servers

Conversation

@enso-works

Copy link
Copy Markdown
Owner

Start dev servers from the menu bar app, then restart, stop and read their logs there. Merging this releases 0.7.0.

Built on worktrees (#11), which is built on server-urls (#10). Merge #10 and #11 first; until then this PR also shows their commits.

What it does

  • Run dev and a Run submenu in every project's menu in Running. They list the package.json scripts (run with npm, pnpm, yarn or bun, picked from the lockfile or the packageManager field), the dev, start, serve and preview scripts of workspace packages, and Procfile.dev or Procfile entries. Run dev starts the script that ran last in that project, else the first of dev, start, serve and preview.
  • Ready to run at the bottom of Running: recent Claude Code projects with nothing running, each with a play button.
  • Managed servers get a chip with the script name, plus Restart, Stop and Logs. Stop sends SIGTERM to the whole process group, then SIGKILL after 5s, so whatever npm run dev or turbo started stops too.
  • Logs go to ~/.local/share/devdash/runs/<project>/<script>.log, kept under 5 MB. The existing logs window follows the file with tail -F, strips ANSI codes, and has Restart and Stop.
  • Restart when it crashes, per server, off by default. It restarts after 2s, at most 3 times in 5 minutes, then stops trying and says so.
  • Crashes show up in Needs you with the exit code and a Logs button, plus a notification. Runs without a port (workers) and runs that ended keep a row in their project.
  • Port check: the run doesn't start when a port it used last time, or one named in the script (--port, -p, PORT=), is held by a process devdash didn't start. Needs you then names the process and offers Stop and run. Nothing is stopped automatically.
  • Scripts run with the login shell's environment (read once, about 2s), so nvm, fnm, mise and asdf pick the same Node as in a terminal. BROWSER=none keeps Vite and Next from opening a tab on every restart.
  • Servers keep running when the app quits, and the state file lets the next bridge pick them up. Restart on crash only works while devdash runs, since only the parent sees the exit code.

Code

  • devdash/runnable.py: script detection, package manager, workspaces, Procfile, and ports named in a command.
  • devdash/supervisor.py: start, stop, restart, clear, restart on crash, log rotation, state reload, and the port conflict check.
  • Bridge:
    • Snapshot fields: runs, runnable (sent only when it changes), and run_id on each server.
    • Commands: run_script (with optional stop_pid), stop_run, restart_run, clear_run, restart_on_crash.
    • Run commands take run, not id, because id is the request id.
  • Demo mode never touches real runs. It shows one managed turbo run, a crashed Procfile worker and three Ready to run projects.

Tested

  • 16 new tests (30 total):
    • Script detection for npm, pnpm, yarn, bun, workspaces and Procfile.
    • The supervisor with real http.server processes: start and stop, stopping a shell's children, restart, the crash-loop limit, reload after a bridge restart, a run that died while unwatched, a port held by another process, and a missing folder.
  • Drove the real bridge on a scratch project through run, run_id on the server, restart, crash detection with the exit code, stop and clear. The port check correctly refused a port that a real Vite from another project already held.
  • --selftest against the real bridge decodes the new fields.
  • Screenshots are from demo data: ready.png and logs.png are new, running.png and hero.png are updated.

@enso-works
enso-works merged commit d1bb661 into main Oct 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant