Skip to content

archgate init

Initialize Archgate governance in the current project.

Terminal window
archgate init [options]

Creates the .archgate/ directory with an example ADR, companion rules file, and linter configuration. Optionally configures editor integration for AI agent workflows and installs the Archgate editor plugin.

OptionDefaultDescription
--editor <editor>claudeEditor integration to configure (claude, cursor, vscode, copilot, opencode)
--install-pluginautoInstall the Archgate editor plugin (requires prior archgate login)

When --install-plugin is passed, the CLI installs the Archgate plugin for the selected editor. If the flag is omitted, the CLI auto-detects: it installs the plugin when valid credentials exist (from a previous archgate login) and skips otherwise.

Claude Code: If the claude CLI is on your PATH, the plugin is installed automatically via claude plugin marketplace add and claude plugin install. If the claude CLI is not found, the command prints the manual installation commands instead.

Cursor: If the cursor CLI is on your PATH, the VS Code extension is installed automatically via cursor --install-extension. The team marketplace URL is printed for manual plugin discovery.

opencode: Requires the opencode CLI to be on your PATH — if it’s not, the install is skipped and a message prompts you to install opencode first. When present, the CLI downloads an authenticated tarball of agent files from the Archgate plugins service and extracts it into the user-scope opencode agents directory ($XDG_CONFIG_HOME/opencode/agents/, falling back to $HOME/.config/opencode/agents/ on every platform including Windows — opencode uses XDG paths via xdg-basedir and does not read %APPDATA%). No files are written to the project tree. See the opencode integration guide for details.

Initialized Archgate governance in /path/to/project
adrs/ - architecture decision records
lint/ - linter-specific rules
.claude/ - Claude Code settings configured
Archgate plugin installed for Claude Code.

When --editor cursor is used, the output shows .cursor/ instead of .claude/.

.archgate/
adrs/
ARCH-001-example.md # Example ADR
ARCH-001-example.rules.ts # Example rules file
lint/
archgate.config.ts # Archgate configuration