Skip to main content

CLI reference

The Midcore CLI runs the Outcome Compiler, agent modes, and gates from the terminal. This page summarizes the main commands, common flags, exit codes, and examples.

Main commands

CommandDescription
midcore initInitialize .maestro/ and optional intent in the current directory
midcore agent "<task>"Run the agent with a one-off task (multi-file edits, impact analysis)
midcore plan "<goal>"Open plan mode for design, migration, or architecture (no edits)
midcore debug "<description>"Run debug mode: multi-hypothesis tracing and targeted fixes
midcore ask "<question>"Ask mode: exploration and answers only, no code changes
midcore gates runRun all gates defined in .maestro/gates.yaml
midcore gates run --gate <id>Run a single gate by ID
midcore --versionPrint CLI version
midcore --helpPrint global help

Flags and options

Flag / optionDescription
--helpPrint help for the command (global or per-command).
--versionPrint CLI version and exit.
(env overrides)Many options can be overridden via environment variables; see Environment variables.

Use midcore --help and midcore <command> --help for the full list. Environment variables are in Environment variables.

Exit codes

0 — Success. Non-zero — Failure (e.g. gate failure, error). For install or runtime issues, see Troubleshooting.

Examples

bash
midcore init
midcore agent "add rate limiting to /api/users"
midcore plan "migrate auth to OIDC"
midcore gates run

Pipeline

bash
midcore agent "refactor login module" | tee log.txt

CI one-liner

bash
midcore gates run

In CI, run gates after your build; exit code non-zero if any gate fails.

Tip

Use midcore --help and midcore <command> --help for flags and options. Environment variables are documented in the Environment variables reference.

Troubleshooting · Quickstart · Gates reference · CI/CD