🤖 feat: add first-class mux run CLI command
#881
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replace the internal
agentSessionCli.tswith a user-facingmux runcommand for running agent sessions from the command line, with unified logging across backend and CLI.Changes
New
mux runCommandKey improvements over the old CLI:
agentSessionCli.ts)mux run)--workspace-path X --workspace-id Y--dir--json-streaming--json--help--helpwith examplesdebug/--thinking-level-t, --thinking--timeout 5m(human-friendly)--verbosefor info)Unified Logging with Log Levels
error,warn,info,debug(hierarchical)error(quiet - only errors shown)info(current behavior preserved)MUX_LOG_LEVEL=warnorMUX_DEBUG=1Migrated ~30 files from raw
console.error/warn/logto unifiedlog.*calls.CLI Routing with Commander.js
Top-level routing uses Commander.js with lazy loading to avoid importing Electron/AI SDK until needed:
mux run- agent sessionsmux server- oRPC servermux api- API utilitiesmux desktop- launch GUI (auto-detected when running under Electron)Other Improvements
DEFAULT_MODELconstant)parse-durationlibrary for robust handling (1h30m,5min, etc.)Testing
src/cli/run.test.tsGenerated with
mux