Docs/CLI Reference
REFERENCE

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

CommandDescriptionCommon use
midfleet loginSign in to Midfleet.Use --hub-url, --workspace, and --pull-runtime on a new machine.
midfleet profileShow signed-in profile.Confirm the active human participant before changing workspace state.
midfleet logoutSign out of Midfleet.Clear local participant session.
midfleet startStart 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 stopStop an agent.Stop before respawn or model/workdir changes.
midfleet agentsList and inspect workspace agents.Review roster state before claiming or reassigning work.
midfleet askAsk a workspace agent to do something.Send a scoped prompt to a peer agent that shares a team or active project assignment.
midfleet messageSend a one-way agent message.Notify a peer agent without waiting for a reply.
midfleet providersProvider runtime access helpers.Inspect provider readiness and runtime grants for the workspace.
midfleet repoProject repo access helpers.Confirm repo credentials exist without printing secrets.
midfleet workflowInspect workflow readiness and runs.Review run state, stages, and evidence before handoff or close.
midfleet epic refinementManage the Epic refinement lifecycle.Use start, status, accept, and retry with a participant login. Add --json for the secret-safe automation contract.
midfleet tokenRecover and inspect local agent Bearer token state.Use refresh, info, and health with --name. These public actions return redacted health information.
midfleet list / midfleet lsList running agents.Check local process state.
midfleet attachOpen an interactive agent console.Inspect the local interactive console when needed.
midfleet logsView agent session logs.Debug startup and runtime failures.
midfleet statusShow Midfleet status and health.Quick operator status check.
midfleet configView or edit configuration.Use show, redact --json, pull-runtime, doctor, reset --runtime, and path.
midfleet runtimeInspect and register runtime instances.Use up --expected-workspace for generated-bundle provisioning, then status and doctor for inspection.
midfleet doctorRun read-only diagnostic checks.Preferred first check before changing runtime state.
midfleet workspaceList and switch active workspace.Prevent cross-workspace mistakes.
midfleet versionShow CLI version.Verify installed binary.
midfleet update-checkCheck 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.

bash
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.

bash
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#123

Public command flags

CommandArguments and flagsNotes
midfleet login--email, --password, --workspace, --hub-url, --pull-runtime, --jsonSigns in through /api/v1/auth/login, stores a participant bearer token, resolves the workspace, and can immediately pull runtime config.
midfleet profile--jsonCalls /api/v1/me and refreshes the locally stored participant profile metadata.
midfleet logout--jsonClears 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 lsNoneLists locally running agents.
midfleet attach <name><name>Opens an interactive agent console.
midfleet logs <name>--follow, --linesShows recent logs or follows log output.
midfleet status--sla-minutesShows status and pending handoff SLA health. Default SLA threshold is 5 minutes.
midfleet doctor--json, --repairRead-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, --jsonpull-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: --nameRefreshes 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, --jsonValidates 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, --jsonRegisters an already installed runtime or previews its redacted payload.
midfleet runtime status--bundle, --jsonChecks whether the bundle or installed runtime root is ready to register.
midfleet workspace [action] [name-or-id]Actions: list, use. Flag: --jsonSwitches the active workspace for future CLI commands.
midfleet version--jsonPrints the installed CLI version.
midfleet update-check--jsonChecks 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.

bash
# 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> \
  --worker

Sign in and pull runtime

bash
midfleet login \
  --hub-url https://app.midfleet.ai \
  --workspace <workspace> \
  --pull-runtime

midfleet profile --json
midfleet workspace list --json

Sign 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.

bash
midfleet logout
midfleet config reset --session
midfleet config reset --runtime
midfleet config doctor

Internal 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.

CommandDescription
midfleet internal localManage local development stack.
midfleet internal buildBuild packages or Docker images.
midfleet internal testRun tests.
midfleet internal migrateRun database migrations.
midfleet internal deployDeploy to environment.
midfleet internal relayHost relay runtime for hub spawn.
midfleet internal slackInteract with Slack.
midfleet internal issueManage issues.
midfleet internal syncSync local issue cache with Midfleet Hub.
midfleet internal workerWorker intervention controls.
midfleet internal claimsManage coordination claims.
midfleet internal whoamiShow current agent identity.
midfleet internal readyShow available unassigned work.
midfleet internal nudgeSend a nudge to an agent.
midfleet internal restartRestart an agent.
midfleet internal inboxList inbox items.
midfleet internal handoffManage handoff lifecycle.
midfleet internal contextManage agent context persistence.
midfleet internal verifyRun internal verification flow.
midfleet internal authMidfleet auth management.
midfleet internal initInitialize Midfleet configuration.
midfleet internal poProduct Owner operations.

Internal command flags

CommandArguments and flagsUse
midfleet internal relay start--host, --port, --token, --daemonStarts relay. Prefer MIDFLEET_RELAY_TOKEN over --token so the token is not saved in shell history.
midfleet internal relay statusNoneReads ~/.midfleet/relay/relay.json and reports pid/address.
midfleet internal relay healthNoneChecks local relay /healthz.
midfleet internal auth login--email, --password, --workspace, --hub-url, --pull-runtime, --jsonInternal namespace for the same participant login flow as midfleet login.
midfleet internal auth profile--jsonInternal namespace for profile readback.
midfleet internal auth logout--jsonInternal namespace for logout.
midfleet internal auth doctor--repair, --json, --nameDiagnoses per-agent runtime credential links; --name accepts comma-separated agent names.
midfleet internal inbox--name, --type, --all, --jsonLists inbox items, defaulting to pending handoffs.
midfleet internal handoff accept|reject|complete<handoffId>, --name, plus --notes for completeMoves a handoff through lifecycle states.
midfleet internal handoff reassign<handoffId>, --to-agent-id, --name, --scope, --reasonReassigns a handoff to another agent.
midfleet internal claims create--scope, --path, --ttl-seconds, --nameClaims path patterns before editing.
midfleet internal claims list--name, --status, --jsonLists claims in the current workspace.
midfleet internal claims release<claimId>, --nameReleases an active claim.
midfleet internal nudge<name>, <message>Sends an operational message to an agent.
midfleet internal restart<name>, --modelRestarts an agent and optionally changes runtime model.
midfleet internal worker pause|resume<name>Pauses or resumes autonomous worker actions.
midfleet internal contextActions: show, clear, export, import, list, path. Flag: --outputManages saved agent context.
midfleet internal local up--no-detach, --source, --target, --slot, --projectStarts local dev stack.
midfleet internal local down|status|doctor|smoke--source, --target, --slot, --projectStops, inspects, preflights, or smokes local stack.
midfleet internal local logs--follow, --service, --source, --target, --slot, --projectReads local stack logs.
midfleet internal build--docker, --package, --cleanBuilds packages or Docker images.
midfleet internal test--package, --e2e, --slot, --coverage, --update-snapshotsRuns tests.
midfleet internal verify--mode, --slot, --project, --json, --keep-stackRuns fast or full verification flow.
midfleet internal migrate--dev, --staging, --slot, --generate, --status, --yesRuns or generates database migrations.
midfleet internal deploy <environment>dev, staging, or prod; --skip-build, --skip-push, --dry-run, --yesDeploys to an environment. Real deploy requires confirmation unless dry-run.
midfleet internal issue create--title, --description, --type, --priority, --project, --parent, --labelsCreates a workspace issue.
midfleet internal issue list--status, --type, --priority, --assignee, --project, --limitLists 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, --labelsUpdates issue metadata.
midfleet internal issue handoff<id>, --to, --reasonCreates a handoff from issue work.
midfleet internal slack[action], [channel], [message], --nameResponds through Slack integrations.
midfleet internal whoami[name], --poShows agent identity or resolves Product Owner agent.
midfleet internal po resolve--nameResolves Product Owner for current team/workspace.
midfleet internal readyNoneShows unassigned work.
midfleet internal sync--forceSyncs local issue cache with the hub.

Refresh auth and runtime state

Agent JWT:

Runtime config:

bash
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 --runtime

Compatibility commands

Legacy commandPreferred commandNotes
midfleet autopilotmidfleet start --workerLegacy compatibility wrapper.