Back to docs
CLI Reference

Every Midfleet CLI command in one place.

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.Use --project, --team-id, --serve, --serve-port, and --serve-public-base-url 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 tokenRecover and inspect local agent Bearer token state.Use refresh, info, show, and health with --name. Never paste raw token output into evidence.
midfleet list / midfleet lsList running agents.Check local process state.
midfleet attachAttach to an agent terminal session.Inspect a local TUI session 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 install --expected-workspace, status, and doctor for runtime lifecycle.
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.

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, --foreground, --restore-context, --worker, --no-auto-accept-handoffs, --auto-setup, --project, --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. Use --serve-public-base-url from consoleRouter.publicBaseUrl.
midfleet stop <name><name>Stops a local agent by name.
midfleet list / midfleet lsNoneLists locally running agents.
midfleet attach <name><name>Attaches to an agent terminal session.
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: show, refresh, info, health. Flag: --nameShows raw agent JWT, refreshes it, decodes expiry/scope, or runs provider auth health.
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.

Login, logout, and refresh examples

Sign in and pull runtime

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

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

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.

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 OpenCode auth symlinks; --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

midfleet token info --name <agent-name>
midfleet token refresh --name <agent-name>
midfleet token health --name <agent-name>

Runtime config

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.
agentmeshmidfleetLegacy binary alias retained during migration.
agentmesh login, agentmesh logout, agentmesh startmidfleet login, midfleet logout, midfleet startThe alias can run the same CLI during migration, but new docs, handoffs, and scripts should use midfleet.