Auto-init writes files
A missing manifest causes register, scan, or acknowledged-host run/start to create the deployed harness before continuing.
Target repository lifecycle
Start with a normal git repository. MARS adds its harness files, registers local state, runs roles through the queue, checks health, fills missing defaults after upgrades, and removes its files with a dry-run-first uninstall path.
Use this table to choose the right command before touching a target
repo. For exact flags, use the CLI
Reference or mars <command> --help.
| User intent | Command | Writes target files? | Primary output |
|---|---|---|---|
| Create the harness deliberately. | mars init --repo /path/to/repo | Yes. | .harness/, operating docs, release files, tickets, goals, quality score. |
| Register a repo for orchestration. | mars register --repo /path/to/repo | Maybe; auto-inits if missing. | Repo record in the per-repo SQLite database. |
| Run the full scoped autonomous loop. | mars start --repo /path/to/repo --execution-profile host --acknowledge-host-execution | Yes; acknowledged host may initialize and agents may later mutate. | Dashboard, workers, queue, lifecycle reconciliation, role execution. |
| Preview or execute one role. | mars run engineer --repo /path/to/repo | Observer default does not mutate; acknowledged host may initialize and mutate. --dry-run --no-init retains the missing-harness preview. | One assembled role context or one role execution. |
| Find repo gaps and starter work. | mars scan --repo /path/to/repo --tickets | Maybe; auto-inits if missing and can write tickets. | Findings and optional backlog tickets. |
| Check health without broad mutation. | mars doctor --repo /path/to/repo --json | No expected target writes. | Machine, model, database, harness, plan, and config diagnostics. |
| Check tool and harness drift. | mars update check --repo /path/to/repo --json | No. | Installed tool, target metadata, and operating-model drift report. |
| Fill missing defaults after an upgrade. | mars upgrade --repo /path/to/repo | Yes, missing defaults only. | Restored default files without overwriting user-owned harness state. |
| Remove MARS from a target. | mars eject --repo /path/to/repo | Dry-run by default. | Removal plan; apply requires --apply --confirm <repo-name>. |
The target project is the application, service, library, or docs repo MARS should manage. Do not point ordinary target agents at the MARS source repo.
git -C /path/to/repo status --short --branch
The repo is the system of record. Generated harness files, tickets, docs, release state, and later agent commits are meant to be reviewed through git.
Use mars init when you want generated files. Use
mars run <role> --dry-run --no-init when you
need an observer-safe preview against an uninitialized repo.
Per-repo databases default to
~/.mars/db/{repo}/mars.db. Command logs and traces
default under ~/.mars/traces/. Do not put runtime
SQLite databases or trace logs inside the target worktree.
mars init is the deliberate way to scaffold the
deployed harness before running agents. It requires a git checkout
and writes repo-owned files users should inspect and commit.
mars init --repo /path/to/repo
git -C /path/to/repo status --short
git -C /path/to/repo diff --stat
| Init output | User meaning | Where to read more |
|---|---|---|
.harness/manifest.yaml | Executable role, tool, routing, trust, schedule, guardrail, and knowledge contract. | Bundle reference |
.harness/roles/ | Editable role prompts generated as starter defaults. | Roles guide |
.harness/guardrails/ | Safety policy attached to roles. | Guardrails reference |
.harness/knowledge/ | Context routes from recurring situations to durable docs. | DocSync guide |
.harness/skills/ | Reusable workflow instructions. Skills guide behavior but do not grant tools. | Tools and MCP guide |
AGENTS.md | First file agents and humans read in the target. | Harness guide |
docs/goals/, docs/features/, docs/tickets/, docs/exec-plans/ | Operating-model artifacts that turn intent into planned, verifiable work. | Planning guide |
VERSION, CHANGELOG.md | Target semantic version and generated patch notes. | Release guide |
.gitignore | Host metadata and local secret files such as .harness/.env.local stay out of git. | Files reference |
--model-routing local, cloud, or
defer. Non-interactive runs should add
--yes --json so missing required inputs fail with
machine-readable remediation.
register and scan use the same scaffold path
as mars init when the manifest is missing.
run and start use it only in acknowledged-host
mode; observer rejects a missing target before writes apart from the
explicit no-init dry-run preview.
A missing manifest causes register, scan, or acknowledged-host run/start to create the deployed harness before continuing.
MARS needs git because generated files, later changes, tickets, and release state are reviewed through the repository.
Auto-initializing commands commit the generated harness baseline when the surrounding git state allows it.
Use mars run engineer --repo /path/to/repo --dry-run --no-init to inspect without scaffolding.
mars register records a local repo so the orchestrator
can manage it. The default database is isolated per target at
~/.mars/db/{repo}/mars.db.
mars register --repo /path/to/repo --remote owner/repo --branch main
mars register --repo /path/to/repo --db /private/tmp/mars-demo.db
| Flag | User behavior |
|---|---|
--repo | Target repository path. Defaults to the current directory. |
--remote | Optional GitHub owner/repo label used by orchestration and integrations. |
--branch | Default branch name. Defaults to main. |
--db | SQLite database path. Must be outside the target repo so runtime state does not dirty the worktree. |
Acknowledged-host mars start is the scoped one-repo
autonomous loop. It initializes when needed, registers the repo, reconciles resumable
lifecycle state, starts the dashboard and workers, and executes the
delivery operating model.
mars start --repo /path/to/repo --execution-profile host --acknowledge-host-execution
mars start --repo /path/to/repo --concurrency 1 --execution-profile host --acknowledge-host-execution
mars start --repo /path/to/repo --debug --log-file /private/tmp/mars-start.log --execution-profile host --acknowledge-host-execution
All five agent entry points default to observer, which independently caps trust and blocks every target mutator. Host has the current OS user's full authority and is not containment; isolated is unavailable.
| Concept | User behavior |
|---|---|
| Bootstrap order | Exec plan first, feature contracts second, tickets third, delivery fourth. |
| Lifecycle reconciliation | Existing resumable state is preferred. Use --new-lifecycle only when intentionally reseeding CEO work. |
| Concurrency | --concurrency 1 runs sequentially. Higher values allow multiple workers. |
| Dashboard ports | --addr controls webhook/control listen address. --dashboard-addr controls the dashboard listen address. |
| Logs | Verbose command logs default to ~/.mars/traces/logs/. --debug streams inline output. |
| Model endpoint | --model-endpoint can point at a live OpenAI-compatible endpoint and skip local llama-server startup. |
Open the Operations Guide for dashboard controls, pause/resume, restart, scan, stop, queue, and database recovery behavior.
mars run loads the target bundle and executes one role.
Use it for deliberate single-role work, dry-run inspection, and
debugging role context.
mars run engineer --repo /path/to/repo --dry-run
Prints the assembled system prompt and exits before calling the model.
mars run engineer --repo /path/to/repo --dry-run --no-init
Useful for observer-safe review before deciding whether to scaffold MARS into the target.
mars run engineer --repo /path/to/repo --max-turns 20 --budget 120000 --execution-profile host --acknowledge-host-execution
Use turn and token budgets to constrain local experiments or risky roles.
mars scan walks the repo for starter gaps such as TODOs,
missing tests, missing CI, and large functions. With
--tickets, it writes deduplicated backlog tickets under
docs/tickets/backlog/.
mars scan --repo /path/to/repo
mars scan --repo /path/to/repo --tickets
Use health and drift commands before asking an agent to fix something mysterious. They separate machine setup, local runtime, target harness, update, active-plan, and integration problems.
mars doctor --repo /path/to/repo
mars doctor --repo /path/to/repo --json
Checks config, models, database, private-release auth readiness, harness health, active-plan hygiene, and optional integration config.
mars update check --repo /path/to/repo --json
mars update check --repo /path/to/repo --skip-remote
Reports installed tool status, deployed harness metadata status, and operating-model drift without mutating target files.
mars scores --repo /path/to/repo
mars scores export --repo /path/to/repo
Reads stored outcomes and can refresh the repo-visible quality score from local evidence.
mars upgrade fills missing target harness defaults after
the installed tool changes. It preserves user-owned files such as
manifest, role prompts, knowledge routes, guardrails, tickets,
exec plans, design docs, references, and target AGENTS.md.
mars upgrade --repo /path/to/repo
mars update harness --repo /path/to/repo
| Need | Command | Preservation rule |
|---|---|---|
| Fill missing generated defaults. | mars upgrade --repo /path/to/repo | Existing user-owned files are preserved. |
| Use update verb for target harness drift. | mars update harness --repo /path/to/repo | Refreshes the deployed bundle without overwriting user agents. |
| Adopt changed starter wording. | Initialize a temporary repo with the new binary and compare. | Copy only the prompt or doc changes you deliberately want. |
mars eject is the repo-level kill switch. It is a dry
run by default. Destructive removal requires both
--apply and --confirm <repo-name>.
mars eject --repo /path/to/repo
mars eject --repo /path/to/repo --apply --confirm repo
mars eject --repo /path/to/repo --apply --confirm repo --keep-db
| Eject behavior | User meaning |
|---|---|
| Dry run by default. | Review the exact file and database plan before deletion. |
| Removes repo harness artifacts. | Includes .harness/, generated planning docs, tickets, feature contracts, AGENTS.md, VERSION, and CHANGELOG.md. |
| Deletes associated per-repo database unless kept. | Use --keep-db when preserving queue, telemetry, score, and trace-related runtime history matters. |
| Does not rewrite git history. | Removal is visible as normal working-tree changes that users can review, commit, or discard. |
| Legacy shared DB deletion is guarded. | --delete-shared-db is required before the legacy shared database can be deleted. |
| State | Default location | Lifecycle owner |
|---|---|---|
| Target harness files | /path/to/repo/.harness/ | Target repo owner after init. |
| Target operating docs | /path/to/repo/AGENTS.md, docs/, VERSION, CHANGELOG.md | Target repo owner and agents. |
| Per-repo database | ~/.mars/db/{repo}/mars.db | Local runtime; created by register/start paths. |
| Shared serve database | ~/.mars-harness/db/mars.db | Multi-repo orchestrator runtime. |
| Logs and traces | ~/.mars/traces/ | Local operator evidence; copy into repo docs only deliberately. |
| Secret values | Environment variables or ignored .harness/.env.local | Operator; never commit. |
| Model routing policy | .harness/model-overrides.yaml | Commit when policy should travel with the repo. |
| Integration profile | .harness/integrations.yaml | Optional; commit only when it contains no tenant-secret values. |
mars init --repo /path/to/repo
git -C /path/to/repo status --short
git -C /path/to/repo diff -- .harness AGENTS.md docs VERSION CHANGELOG.md
git -C /path/to/repo add .harness AGENTS.md docs VERSION CHANGELOG.md .gitignore
git -C /path/to/repo commit -m "chore: initialize mars harness"
mars run engineer --repo /path/to/repo --dry-run
mars run engineer --repo /path/to/uninitialized-repo --dry-run --no-init
mars start --repo /path/to/repo --db ~/.mars/db/my-repo/mars.db --concurrency 1 --execution-profile host --acknowledge-host-execution
mars doctor --repo /path/to/repo --json
mars update check --repo /path/to/repo --json
mars upgrade --repo /path/to/repo
mars eject --repo /path/to/repo
mars eject --repo /path/to/repo --apply --confirm repo
| Symptom | Likely cause | Next action |
|---|---|---|
missing .harness/ directory | The target has not been initialized. | Run mars init --repo /path/to/repo, or use mars run ... --dry-run --no-init for no-write inspection. |
missing manifest.yaml | The harness is incomplete or was partially removed. | Run mars upgrade --repo /path/to/repo or re-run mars init after reviewing git state. |
| Register writes unexpected files. | Auto-init scaffolded a missing harness before registration. | Review generated files with git and commit or remove them deliberately. |
--db path ... is inside target repo | Runtime state would dirty the project worktree. | Use the default ~/.mars/db/{repo}/mars.db path or another writable path outside the repo. |
| Start reseeds work you expected to resume. | --new-lifecycle was used or resumable state was unavailable. | Check command logs, database path, and active plan before starting again. |
| Upgrade did not change a role prompt. | Existing prompts are user-owned and preserved. | Compare against a fresh temporary init and copy desired wording manually. |
| Eject refused to delete. | Apply confirmation was missing or mismatched. | Re-run the dry run, then pass --apply --confirm <repo-directory-name> only when the plan is correct. |
| Tool or harness version looks stale. | Installed binary or target metadata is behind. | Run mars update check --repo /path/to/repo --json and follow the recommended update path. |