> ## Documentation Index
> Fetch the complete documentation index at: https://forgekit-docs-mintlify-9e781f1d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Core commands

> Bootstrap and maintain a Forge repo with init, sync, doctor, catalog, docs, and update — plus profile, settings, and reversible-uninstall flags.

The Core group bootstraps a repo and keeps it healthy.

## `forge init`

Scaffold this repo's config — emits every tool from one shared source.

```bash theme={null}
forge init
```

Emits `AGENTS.md`, `CLAUDE.md`, `.gemini/settings.json`, `.aider.conf.yml`, and the rest
(plus MCP server config for Roo Code and VS Code), and the `.gitattributes` union-merge
rule the ledger needs.

`forge init` also merges Forge's hooks and permissions into the **global**
`~/.claude/settings.json`, so it announces the merge before writing. The merge is
idempotent, marker-guarded, and never clobbers user entries.

### Init flags

| Flag                | What it does                                                                                                                                                                                                                          |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--profile <name>`  | Pick the policy profile for this repo. Accepts `minimal` or `standard` (default). An invalid value aborts before any scaffold, `.forge/` write, or merge.                                                                             |
| `--no-settings`     | Skip the global `~/.claude/settings.json` merge entirely — only the per-repo config is written.                                                                                                                                       |
| `--remove-settings` | Reverse a past settings merge. Forge-shaped hooks, permissions, statusline, and the `_forge` marker are removed; a timestamped backup is written first, and your own entries are preserved. Also invoked by `install.sh --uninstall`. |
| `--settings-only`   | Only merge the global settings — don't touch the repo. Used by `install.sh` to wire hooks and permissions.                                                                                                                            |

If the settings merge is refused or errors, `forge init` fails with exit 1 and writes the
reason to stderr rather than reporting success.

### Policy profiles

`--profile` selects the ruleset that `forge sync` compiles into each tool's native
config. Only two profiles are supported:

* **`standard`** (default) — the full pack: shared memory rules, impact analysis, and the
  complete guardrail hook set.
* **`minimal`** — a leaner ruleset for small repos or contributor forks.

The legacy names `web-app`, `backend-service`, `library`, and `regulated` are deprecated
aliases of `standard`. They still work: `forge init` warns once, stores `standard`, and
existing configs holding a legacy name sync as standard. New repos should use `standard`
directly. Any other value is invalid and aborts before Forge touches the repo.

```bash theme={null}
forge init --profile minimal            # leaner ruleset
forge init --no-settings                # per-repo only, skip the global merge
forge init --remove-settings            # reverse a past global merge
```

## `forge sync`

Recompile the canonical source into each tool's native config files.

```bash theme={null}
forge sync
```

Idempotent — it only rewrites what changed. Run it after editing `source/rules.json` or a
per-repo `.forge/rules.json`.

## `forge doctor`

Health-check installed tools, guards, MCP auth, and config drift.

```bash theme={null}
forge doctor
```

Pass/fail across tools, guards, MCP wiring, config drift, and update status. Every path
is fail-open. A **gateway models** row prints the resolved `tier → model` mapping when a
custom gateway is configured.

## `forge catalog`

Start Here — list every tool, crew, and guard with a one-line why.

```bash theme={null}
forge catalog
```

## `forge docs`

Docs ↔ code drift.

```bash theme={null}
forge docs check     # registry reconcile — commands, env vars, MCP tools, CHANGELOG
forge docs sync      # diff-driven stale-docs sweep
```

<Note>
  `docs check` fails CI when commands, env vars, MCP tools, or the CHANGELOG drift from
  the code. `docs sync` sweeps the diff and reports UPDATED / STALE / VERIFIED-UNAFFECTED.
</Note>

## `forge update`

Self-update across all three install modes.

```bash theme={null}
forge update              # apply the update (git checkout or npm/copy install)
forge update --check      # report whether a newer version is available
forge update --to <version>   # pin or downgrade to a specific version (v0.19+)
```

Every path is fail-open — offline, no upstream, or detached HEAD returns "unknown", never
an error. `FORGE_NO_UPDATE_CHECK=1` silences the doctor notice.
