Skip to content

CLI Commands

Start the background daemon.

Terminal window
pertmux serve # backgrounds automatically
pertmux -c config.toml serve # with specific config
pertmux serve --foreground # stay in terminal (for debugging)

The daemon forks to the background by default, logging to /tmp/pertmux-daemon.log. It validates your config and checks for an existing daemon before forking — errors show immediately in your terminal. Use --foreground to keep the daemon in your terminal for debugging.

The daemon runs until stopped with pertmux stop.

Open the TUI client and connect to the running daemon.

Terminal window
pertmux connect

Fails with a clear error if the daemon is not running.

Stop the running daemon.

Terminal window
pertmux stop

Show the daemon socket path and whether it’s running.

Terminal window
pertmux status

Clean up stale files and persistence data.

Terminal window
pertmux cleanup
  • Removes the stale socket file if the daemon is not running.
  • Removes read_state.db (comment tracking) and last_project persistence files.
  • Skips the live socket if the daemon is still running.

Install optional integrations.

Terminal window
pertmux install --codex-hooks
pertmux install --codex-hooks --local
pertmux install --codex-hooks --local --repo /path/to/repo
pertmux install --codex-hooks --force

--codex-hooks installs global Codex hooks into ~/.codex/hooks.json by default. The hooks call pertmux codex-hook for SessionStart, UserPromptSubmit, and Stop, allowing Codex to notify the daemon immediately when a session starts, a user prompt is submitted, or a turn finishes.

Codex requires non-managed command hooks to be reviewed and trusted. After installing, start Codex and run /hooks once to trust the generated hook definitions. For one-off testing, you can start Codex with --dangerously-bypass-hook-trust.

OptionDescription
--codex-hooksInstall the Codex hook integration
--localInstall repo-local hooks into .codex/hooks.json instead of global hooks
--repo <path>Repository path for --local installs; defaults to the current directory
--forceReplace an invalid existing hooks file
OptionDescription
-c, --config <path>Path to TOML config file
--versionShow version
-h, --helpShow help