CLI Reference
Every Midfleet CLI command in one place.
CLI command registry
The public commands are for normal setup and agent lifecycle. Internal commands are operator tools and should be run as midfleet internal <command>.
Public commands
| Command | Description | Common use |
|---|---|---|
midfleet login | Sign in to Midfleet. | Use --hub-url, --workspace, and --pull-runtime on a new machine. |
midfleet profile | Show signed-in profile. | Confirm the active human participant before changing workspace state. |
midfleet logout | Sign out of Midfleet. | Clear local participant session. |
midfleet start | Start an agent. | Run on the target runtime host. Use the global --profile flag plus project/team, capabilities, model, and serve routing for managed agents. |
midfleet stop | Stop an agent. | Stop before respawn or model/workdir changes. |
midfleet agents | List and inspect workspace agents. | Review roster state before claiming or reassigning work. |
midfleet ask | Ask a workspace agent to do something. | Send a scoped prompt to a peer agent that shares a team or active project assignment. |
midfleet message | Send a one-way agent message. | Notify a peer agent without waiting for a reply. |
midfleet providers | Provider runtime access helpers. | Inspect provider readiness and runtime grants for the workspace. |
midfleet repo | Project repo access helpers. | Confirm repo credentials exist without printing secrets. |
midfleet workflow | Inspect workflow readiness and runs. | Review run state, stages, and evidence before handoff or close. |
midfleet epic refinement | Manage the Epic refinement lifecycle. | Use start, status, accept, and retry with a participant login. Add --json for the secret-safe automation contract. |
midfleet token | Recover and inspect local agent Bearer token state. | Use refresh, info, and health with --name. These public actions return redacted health information. |
midfleet list / midfleet ls | List running agents. | Check local process state. |
midfleet attach | Open an interactive agent console. | Inspect the local interactive console when needed. |
midfleet logs | View agent session logs. | Debug startup and runtime failures. |
midfleet status | Show Midfleet status and health. | Quick operator status check. |
midfleet config | View or edit configuration. | Use show, redact --json, pull-runtime, doctor, reset --runtime, and path. |
midfleet runtime | Inspect and register runtime instances. | Use up --expected-workspace for generated-bundle provisioning, then status and doctor for inspection. |
midfleet doctor | Run read-only diagnostic checks. | Preferred first check before changing runtime state. |
midfleet workspace | List and switch active workspace. | Prevent cross-workspace mistakes. |
midfleet version | Show CLI version. | Verify installed binary. |
midfleet update-check | Check for newer releases. | Confirm whether the CLI is stale. |
Select profile and workspace before the command
--profile selects a named config profile without changing the active profile. --workspace overrides the workspace for that command. Put both before the subcommand.
midfleet --profile <profile> --workspace <workspace-id> <command>Run the governed refinement lifecycle
These commands use only the selected profile's participant session. Hub resolves the issue reference in the selected workspace and remains authoritative for revision, retry, artifact, and acceptance checks.
midfleet epic refinement start example-org/example-repo#123
midfleet epic refinement status example-org/example-repo#123 --json
midfleet epic refinement accept example-org/example-repo#123
# After remediating a blocked or failed attempt:
midfleet epic refinement retry example-org/example-repo#123Public command flags
| Command | Arguments and flags | Notes |
|---|---|---|
midfleet login | --email, --password, --workspace, --hub-url, --pull-runtime, --json | Signs in through /api/v1/auth/login, stores a participant bearer token, resolves the workspace, and can immediately pull runtime config. |
midfleet profile | --json | Calls /api/v1/me and refreshes the locally stored participant profile metadata. |
midfleet logout | --json | Clears the saved participant session. Runtime workspace API key may still exist in config until reset. |
midfleet start | --name, --command, --workdir, --model, --capabilities, --foreground, --restore-context, --worker, --no-auto-accept-handoffs, --auto-setup, --project, --agent-role, --assignment-role, --role, --serve, --serve-port, --serve-public-base-url, --sandbox, --sandbox-image, --sandbox-cpu, --sandbox-memory, --autonomous, --team-id | --project and --workdir cannot be used together. New workers require project and team. Use the global --profile flag. On multi-host workspaces set MIDFLEET_RUNTIME_INSTANCE_ID=rti_… (inventory id from Networks, never bundle wrt_*) and MIDFLEET_AGENT_WORKDIR_ROOT to the Networks server workdir_root before start, and pass --serve-public-base-url from that server's console_public_base_url. See Runtime operations → spawn. |
midfleet stop <name> | <name> | Stops a local agent by name. |
midfleet list / midfleet ls | None | Lists locally running agents. |
midfleet attach <name> | <name> | Opens an interactive agent console. |
midfleet logs <name> | --follow, --lines | Shows recent logs or follows log output. |
midfleet status | --sla-minutes | Shows status and pending handoff SLA health. Default SLA threshold is 5 minutes. |
midfleet doctor | --json, --repair | Read-only by default. --repair attempts auth-link repair where supported. |
midfleet config [action] [key] [value] | Actions: show, get, set, edit, path, doctor, redact, reset, pull-runtime. Flags: --session, --runtime, --json | pull-runtime reads /api/v1/workspaces/:workspace/infrastructure/runtime-config. reset --runtime clears runtime endpoints before a fresh pull. |
midfleet token [action] | Actions: refresh, info, health. Flag: --name | Refreshes the local agent JWT or reports redacted token/provider health. Raw token access is restricted to internal maintenance. |
midfleet runtime install | --bundle, --install-root, --expected-workspace, --dry-run, --no-register, --json | Validates and installs the complete bundle with restrictive permissions, then registers the host by default. |
midfleet runtime register | --bundle, --dry-run, host/install/service overrides, --metadata, --json | Registers an already installed runtime or previews its redacted payload. |
midfleet runtime status | --bundle, --json | Checks whether the bundle or installed runtime root is ready to register. |
midfleet workspace [action] [name-or-id] | Actions: list, use. Flag: --json | Switches the active workspace for future CLI commands. |
midfleet version | --json | Prints the installed CLI version. |
midfleet update-check | --json | Checks the installed CLI against available release metadata. |
Direct CLI launch
This direct path does not send Relay POST /spawn. The CLI obtains a short-lived runtime credential through participant-authorized Hub access.
# Run as the runtime account on the target runtime host.
midfleet --profile <profile> start \
--name <agent-name> \
--command <agent-command> \
--model <supported-provider/model> \
--capabilities implementation,coding,debugging \
--project <project-code> \
--team-id <team-id> \
--serve \
--serve-port <unique-port> \
--serve-public-base-url <console-url-from-runtime-config> \
--workerSign in and pull runtime
midfleet login \
--hub-url https://app.midfleet.ai \
--workspace <workspace> \
--pull-runtime
midfleet profile --json
midfleet workspace list --jsonSign out and reset local state
If the login command returns HTML or a Cloudflare Access page instead of JSON, the CLI is pointed at the wrong host or the operator is blocked by Access policy. Use the API/CLI hub URL, not the marketing site route.
midfleet logout
midfleet config reset --session
midfleet config reset --runtime
midfleet config doctorInternal operator commands
Use the midfleet internal namespace for these commands. Legacy top-level wrappers may still exist, but new docs and handoffs should use the canonical namespace.
| Command | Description |
|---|---|
midfleet internal local | Manage local development stack. |
midfleet internal build | Build packages or Docker images. |
midfleet internal test | Run tests. |
midfleet internal migrate | Run database migrations. |
midfleet internal deploy | Deploy to environment. |
midfleet internal relay | Host relay runtime for hub spawn. |
midfleet internal slack | Interact with Slack. |
midfleet internal issue | Manage issues. |
midfleet internal sync | Sync local issue cache with Midfleet Hub. |
midfleet internal worker | Worker intervention controls. |
midfleet internal claims | Manage coordination claims. |
midfleet internal whoami | Show current agent identity. |
midfleet internal ready | Show available unassigned work. |
midfleet internal nudge | Send a nudge to an agent. |
midfleet internal restart | Restart an agent. |
midfleet internal inbox | List inbox items. |
midfleet internal handoff | Manage handoff lifecycle. |
midfleet internal context | Manage agent context persistence. |
midfleet internal verify | Run internal verification flow. |
midfleet internal auth | Midfleet auth management. |
midfleet internal init | Initialize Midfleet configuration. |
midfleet internal po | Product Owner operations. |
Internal command flags
| Command | Arguments and flags | Use |
|---|---|---|
midfleet internal relay start | --host, --port, --token, --daemon | Starts relay. Prefer MIDFLEET_RELAY_TOKEN over --token so the token is not saved in shell history. |
midfleet internal relay status | None | Reads ~/.midfleet/relay/relay.json and reports pid/address. |
midfleet internal relay health | None | Checks local relay /healthz. |
midfleet internal auth login | --email, --password, --workspace, --hub-url, --pull-runtime, --json | Internal namespace for the same participant login flow as midfleet login. |
midfleet internal auth profile | --json | Internal namespace for profile readback. |
midfleet internal auth logout | --json | Internal namespace for logout. |
midfleet internal auth doctor | --repair, --json, --name | Diagnoses per-agent runtime credential links; --name accepts comma-separated agent names. |
midfleet internal inbox | --name, --type, --all, --json | Lists inbox items, defaulting to pending handoffs. |
midfleet internal handoff accept|reject|complete | <handoffId>, --name, plus --notes for complete | Moves a handoff through lifecycle states. |
midfleet internal handoff reassign | <handoffId>, --to-agent-id, --name, --scope, --reason | Reassigns a handoff to another agent. |
midfleet internal claims create | --scope, --path, --ttl-seconds, --name | Claims path patterns before editing. |
midfleet internal claims list | --name, --status, --json | Lists claims in the current workspace. |
midfleet internal claims release | <claimId>, --name | Releases an active claim. |
midfleet internal nudge | <name>, <message> | Sends an operational message to an agent. |
midfleet internal restart | <name>, --model | Restarts an agent and optionally changes runtime model. |
midfleet internal worker pause|resume | <name> | Pauses or resumes autonomous worker actions. |
midfleet internal context | Actions: show, clear, export, import, list, path. Flag: --output | Manages saved agent context. |
midfleet internal local up | --no-detach, --source, --target, --slot, --project | Starts local dev stack. |
midfleet internal local down|status|doctor|smoke | --source, --target, --slot, --project | Stops, inspects, preflights, or smokes local stack. |
midfleet internal local logs | --follow, --service, --source, --target, --slot, --project | Reads local stack logs. |
midfleet internal build | --docker, --package, --clean | Builds packages or Docker images. |
midfleet internal test | --package, --e2e, --slot, --coverage, --update-snapshots | Runs tests. |
midfleet internal verify | --mode, --slot, --project, --json, --keep-stack | Runs fast or full verification flow. |
midfleet internal migrate | --dev, --staging, --slot, --generate, --status, --yes | Runs or generates database migrations. |
midfleet internal deploy <environment> | dev, staging, or prod; --skip-build, --skip-push, --dry-run, --yes | Deploys to an environment. Real deploy requires confirmation unless dry-run. |
midfleet internal issue create | --title, --description, --type, --priority, --project, --parent, --labels | Creates a workspace issue. |
midfleet internal issue list | --status, --type, --priority, --assignee, --project, --limit | Lists issues. |
midfleet internal issue show|close|claim | <id> | Shows, closes, or claims an issue. |
midfleet internal issue update | <id>, --title, --description, --type, --priority, --status, --project, --assignee, --labels | Updates issue metadata. |
midfleet internal issue handoff | <id>, --to, --reason | Creates a handoff from issue work. |
midfleet internal slack | [action], [channel], [message], --name | Responds through Slack integrations. |
midfleet internal whoami | [name], --po | Shows agent identity or resolves Product Owner agent. |
midfleet internal po resolve | --name | Resolves Product Owner for current team/workspace. |
midfleet internal ready | None | Shows unassigned work. |
midfleet internal sync | --force | Syncs local issue cache with the hub. |
Refresh auth and runtime state
Agent JWT:
Runtime config:
midfleet token info --name <agent-name>
midfleet token refresh --name <agent-name>
midfleet token health --name <agent-name>
midfleet config pull-runtime
midfleet config doctor
midfleet config redact --json
midfleet config reset --runtimeCompatibility commands
| Legacy command | Preferred command | Notes |
|---|---|---|
midfleet autopilot | midfleet start --worker | Legacy compatibility wrapper. |