CLI Commands
archcore init
Section titled “archcore init”Initialize .archcore/ in the current directory.
archcore initWhat it does:
- Creates
.archcore/directory withsettings.json - Auto-detects installed coding agents
- Installs MCP server config for detected agents
- Installs session hooks for supported agents
- Offers to write the “use Archcore” instruction hint into detected agent configs (interactive only)
If no agents are detected, falls back to Claude Code configuration. Safe to re-run — .archcore/settings.json is left untouched and MCP/hook writes are idempotent.
In --non-interactive mode the instruction hint is skipped — add it later with archcore instructions install.
For a step-by-step walkthrough, see the CLI Quick Start.
archcore status
Section titled “archcore status”Check .archcore/ structure and document health.
archcore statusChecks performed:
- Directory structure exists
- File naming follows
<slug>.<type>.mdpattern - Slugs are lowercase alphanumeric with hyphens only
- Document types are valid (one of the 18 types)
- YAML frontmatter has required
titleandstatusfields - Frontmatter is valid YAML
- Sync manifest JSON structure
- Orphaned relations (documents referenced but not on disk)
When orphaned relations are found, status hints: “Run ‘archcore doctor —fix’ to remove orphaned relations”
archcore doctor
Section titled “archcore doctor”Comprehensive health check with optional fix.
archcore doctor [--fix]Runs all validation checks plus:
- Verifies
settings.jsonexists and is valid - Checks server reachability (if server URL is configured)
- Reports tag hygiene issues (invalid format, singleton tags that may be typos)
Returns a non-zero exit code if any issues are found.
Flags:
| Flag | Description |
|---|---|
--fix | Remove orphaned relations from the manifest before running checks |
archcore config
Section titled “archcore config”Manage configuration.
archcore config # Show current sync typearchcore config get <key> # Read a config valuearchcore config set <key> <value> # Set a config valueAvailable keys:
| Key | Values | Description |
|---|---|---|
sync | none, cloud, on-prem | Sync type (currently locked) |
project_id | integer | Project ID for sync (currently locked) |
archcore_url | URL | Server URL for on-prem (currently locked) |
language | language code | Language for document content (e.g., en, ru) |
Examples:
archcore config set language ruarchcore config get languagearchcore mcp
Section titled “archcore mcp”Run the MCP server or install MCP config.
archcore mcp # Start stdio MCP serverarchcore mcp install # Install MCP config for all detected agentsarchcore mcp install --agent <id> # Install for a specific agentCoding agents connect to this stdio server. It’s not meant to be run manually — agents launch it as a subprocess.
Agent IDs: claude-code, cursor, copilot, gemini-cli, opencode, codex-cli, roo-code, cline
Flags:
| Flag | Description |
|---|---|
--project <path> | Project root to serve. Overrides the current directory. |
The project root is resolved in order: the --project flag, then the ARCHCORE_PROJECT_ROOT environment variable, then the current working directory. This is useful when an agent launches the server from a fixed location instead of the project directory.
See MCP server for details.
archcore instructions
Section titled “archcore instructions”Manage the “use Archcore” hint in agent instruction files.
The hint tells agents that Archcore’s MCP tools are available and when to consult them. Without it, agents may never call the MCP tools even though the server is installed.
archcore instructions install # Write the hint into detected agent configsarchcore instructions remove # Remove the hintSubcommands:
| Subcommand | Description |
|---|---|
install | Writes the “use Archcore” hint into the instruction files of detected agents (e.g. AGENTS.md, .claude/rules). |
remove | Removes the hint previously written by instructions install or init. Works even after the project is de-initialized. |
Flags:
| Flag | Description |
|---|---|
--agent <id> | Target a single agent host (e.g. claude-code, cursor, gemini-cli, codex-cli) instead of all detected ones. |
For shared files (AGENTS.md, GEMINI.md) the hint is inserted inside a managed marker block:
<!-- archcore:start -->…<!-- archcore:end -->This lets Archcore update or remove the hint without touching your own content — remove deletes only the marker block and leaves the rest of the file intact.
Instruction file locations:
| Agent | Location |
|---|---|
| Claude Code | .claude/rules/ |
| Gemini CLI | GEMINI.md |
| Cursor, Codex CLI, OpenCode, Roo Code, Cline, Copilot | AGENTS.md |
Examples:
archcore instructions install # All detected agentsarchcore instructions install --agent claude-code # Claude Code onlyarchcore hooks
Section titled “archcore hooks”Manage agent hooks.
archcore hooks install # Install hooks for all detected agentsarchcore hooks install --agent <id> # Install for a specific agentAgent hook commands (called by agents, not manually):
archcore hooks claude-code session-startarchcore hooks cursor <event>archcore hooks gemini-cli <event>archcore hooks copilot <event>See hooks for details.
archcore validate
Section titled “archcore validate”Validate every document in .archcore/ against the schema (frontmatter, slug, type, tags). Used by hooks after each mutation.
archcore validateReturns non-zero on any validation failure.
archcore update
Section titled “archcore update”Check for and install the latest version.
archcore updateQueries GitHub releases, compares versions, downloads the binary for your OS/architecture, verifies the checksum, and updates in place.
archcore —version
Section titled “archcore —version”Display the current version.
archcore --versionarchcore —help
Section titled “archcore —help”Show help with all available commands.
archcore --help