Complete, authoritative reference for all 41 eforge (and alias elcode-forge) commands, flags, output formatters, and deterministic exit codes.
npx elcode-forge <command> (or pnpm dlx elcode-forge / bunx elcode-forge). All flags, formats, exit codes, and MCP tools are 100% identical.Output Formats & Deterministic Exit Codes (0..=4)
eforge init
Diagnosticseforge init [OPTIONS]Initialize eforge.config.yaml and .eforge/ workspace metadata and BLAKE3 incremental cache directory.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --force | Overwrite existing eforge.config.yaml if present | false |
eforge doctor
Diagnosticseforge doctor [OPTIONS]Run a fast (< 5s) repository diagnostic check evaluating file inventory, detected languages/frameworks, manifest & lockfile hygiene (Node, Python, Go, Rust, PHP), test suite presence, rules, and secret hygiene.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json, markdown, sarif, github | terminal |
eforge scan
Diagnosticseforge scan [OPTIONS]Execute a full or BLAKE3 incremental polyglot architecture, dependency, declarative rule, OSV vulnerability, secret, and 8-dimension health scan.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json, markdown, sarif, github | terminal |
| --full | Force a full repository scan bypassing cache | false |
| --incremental | Use .eforge/metadata.json BLAKE3 content hashes to inspect changed files | false |
| -i, --interactive | Launch interactive terminal UI mode | false |
| --codeframe | Render rich box-drawn multi-line source code frames | false |
| --fail-on <SEVERITY> | Minimum finding severity to return non-zero exit code (critical|high|medium|low|info) | — |
| -o, --output <PATH> | Optional file path to write the rendered report | — |
eforge review
Diagnosticseforge review [OPTIONS]Analyze working-tree Git diff blast radius, direct & transitive module impact, untested file warnings, change risk level (Low|Medium|High|Critical), and findings on modified files.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json, markdown, sarif, github | terminal |
| --fast | Run fast diff-scoped mode | false |
| --changed | Scope analysis strictly to changed files in working tree | false |
| -i, --interactive | Launch interactive terminal UI mode | false |
| --impacted-tests | Select exact impacted test files and synthesize runner commands | false |
| --fail-on <SEVERITY> | Minimum finding severity to return non-zero exit code (critical|high|medium|low|info) | — |
eforge diff
Diagnosticseforge diff [OPTIONS]Inspect working-tree unified diff (git diff HEAD) and affected architecture modules, or compare current repository state against a remote baseline snapshot (--remote).
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --remote | Compare findings and health score against cached remote baseline (.eforge/baseline.json) | false |
| --format <FMT> | Output format: terminal, json, markdown, sarif, github | terminal |
eforge graph
Architectureeforge graph [OPTIONS]Export the inferred polyglot module architecture graph, inter-module import edges, high-centrality modules, and Tarjan SCC circular dependency cycles.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | terminal (module list), json (ArchitectureGraph), markdown (Mermaid flowchart TD) | terminal |
eforge dependencies
Architectureeforge dependencies [OPTIONS]Inspect package manifest dependencies, lockfile versions, open-source licenses, unused packages, duplicate declarations, and unpinned versions across npm, PyPI, Go, Cargo, and Composer.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json, markdown, sarif, github | terminal |
eforge onboard
Architectureeforge onboard [OPTIONS]Generate the deterministic 5-file living developer onboarding and architecture documentation bundle (architecture.md, modules.md, dependencies.md, onboarding.md, risks.md).
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| -o, --output <DIR> | Output directory for generated Markdown docs | <path>/docs/forge |
eforge docs
Architectureeforge docs [OPTIONS]Alias for eforge onboard — regenerate deterministic architecture, module, dependency, onboarding, and risk documentation.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| -o, --output <DIR> | Output directory for generated Markdown docs | <path>/docs/forge |
eforge security
Securityeforge security [OPTIONS]Run focused secret detection (verified credentials + Shannon entropy), unsafe JS/TS/Python/PHP code pattern analysis, and polyglot OSV dependency vulnerability auditing.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json, markdown, sarif, github | terminal |
| --audit | Run deep dependency vulnerability audit against OSV/GHSA advisories | false |
| --offline | Run in offline mode using embedded and cached (.eforge/cache/osv/) advisories only | false |
| --fail-on <SEVERITY> | Minimum finding severity to trigger security gate failure (critical|high|medium|low|info) | — |
eforge sbom
Securityeforge sbom [OPTIONS]Export a deterministic Software Bill of Materials (SBOM) in OASIS CycloneDX v1.5 JSON or ISO SPDX v2.3 JSON format with canonical Package URLs (PURL) and BLAKE3 serial numbers.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | SBOM specification format: cyclonedx, spdx | cyclonedx |
| -o, --output <PATH> | Optional file path to write the rendered SBOM JSON | — |
eforge explain
AIeforge explain [TARGET] [OPTIONS]Explain the structural role, files, outgoing imports, incoming dependents, exported symbols, and findings for the project or a specific module/file path prefix, with optional grounded AI synthesis.
| Option / Argument | Description | Default |
|---|---|---|
| [TARGET] | Optional module ID or file path prefix (defaults to '.' for full project) | . |
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json, markdown, sarif, github | terminal |
| --ai | Augment deterministic structural facts with grounded AI synthesis | false |
| --provider <PROVIDER> | AI provider override: openai, anthropic, gemini, mock | — |
| --model <MODEL> | Model identifier override (e.g. gpt-4o, qwen2.5-coder:7b) | — |
| --dry-run | Output assembled ContextPack and token estimates without calling AI provider | false |
| --no-cache | Bypass .eforge/ai-cache/ response cache | false |
eforge ai-review
AIeforge ai-review [OPTIONS]Analyze changes with deterministic diff/PR review augmented by grounded AI review items (Confirmed, Probable, Suggestion) verified via apply_deterministic_guard.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --base <REF> | Base Git reference for diff comparison (e.g. origin/main or HEAD~1) | — |
| --head <REF> | Head Git reference for diff comparison (defaults to working tree) | — |
| --fast | Run fast diff-scoped mode | false |
| --fail-on <SEVERITY> | Minimum deterministic finding severity to fail on (critical|high|medium|low|info) | — |
| --provider <PROVIDER> | AI provider override: openai, anthropic, gemini, mock | — |
| --model <MODEL> | Model identifier override | — |
| --dry-run | Output ContextPack and token estimates without network calls | false |
| --no-cache | Bypass .eforge/ai-cache/ response cache | false |
| --format <FMT> | Output format: terminal, json, markdown, sarif, github | terminal |
eforge ai status
AIeforge ai status [OPTIONS]Inspect effective AI configuration, masked credential status, daily budget, and optionally test live provider connectivity and latency (--ping).
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --ping | Test live provider reachability and measure round-trip latency | false |
| --format <FMT> | Output format: terminal, json | terminal |
eforge ai usage
AIeforge ai usage [OPTIONS]Summarize AI token consumption, response cache hits, accumulated USD spend, and remaining daily budget from .eforge/ai-usage.jsonl.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json | terminal |
eforge rules list
Governanceeforge rules [list] [OPTIONS]List all registered built-in, pack-extended, and custom declarative rules with their ID, category, severity, origin pack, and enabled status (default subcommand of eforge rules).
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| -c, --category <CAT> | Filter by category: architecture, quality, security, dependencies | — |
| --enabled-only | Show only enabled rules | false |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge ui
Architectureeforge ui [OPTIONS]Launch the real-time interactive terminal UI (ratatui + crossterm) with 4 tabs: DAG Explorer, Tarjan SCC Cycles, Blast Radius, and Findings & Code-Frames.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --tab <1..=4> | Initial active tab index (1: DAG, 2: Cycles, 3: Blast Radius, 4: Findings) | 1 |
eforge watch
Architectureeforge watch [OPTIONS]Live incremental architectural radar leveraging .eforge/cache/file-ast-v1.json to re-evaluate health score deltas in < 50ms on file save.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --debounce-ms <MS> | Debounce delay before triggering re-analysis | 150 |
| --once | Execute a single watch cycle and exit (ideal for CI and scripts) | false |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge fix
Governanceeforge fix [OPTIONS]Surgical deterministic auto-fix engine generating transactional codemods with atomic backup in .eforge/tx/<tx_id>/ and rollback capability.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --dry-run | Preview proposed codemods and unified diffs without modifying files | true |
| --apply | Execute codemods with transactional backup in .eforge/tx/<tx_id>/ | false |
| --rule <ID> | Filter fixes strictly to a specific rule ID prefix | — |
| --rollback [TX_ID] | Rollback the latest transaction or a specific transaction ID | — |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge simulate
Architectureeforge simulate [OPTIONS]Simulate moving files or modules in memory, predicting relative import rewrites, Tarjan SCC cycle impact, and health score shifts before touching disk.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --move <FROM:TO> | Simulate moving a single file or module path | — |
| --plan <FILE> | Path to a YAML refactoring plan with multiple move operations | — |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge trend
Diagnosticseforge trend [OPTIONS]Evaluate historical 8-Dimension Health Score evolution across Git commits, architectural drift, and composite hotspots (Churn × Fan-In × Severity).
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --commits <N> | Number of historical commits to analyze | 10 |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge blame-arch
Diagnosticseforge blame-arch [OPTIONS]Attribute architectural boundary and Tarjan SCC circular-dependency violations to the introducing Git commit, author, and timestamp.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge rules infer
Governanceeforge rules infer [OPTIONS]Infer architectural archetype, layer boundaries, and forbidden_imports rules from module fan-in, fan-out, and instability metrics.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --write | Write inferred rules directly to .eforge/rules/inferred-architecture.yaml | false |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge rules check
Governanceeforge rules check [PATH] [OPTIONS]Validate syntax and matcher invariants of declarative YAML/JSON rule files without executing a full repository scan.
| Option / Argument | Description | Default |
|---|---|---|
| [PATH] | Optional path to a specific rule file or directory (defaults to configured paths and .eforge/rules) | — |
| -p, --repo <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge rules init
Governanceeforge rules init [OPTIONS]Generate a starter declarative rule template in .eforge/rules/custom-rules.yaml with examples for all 6 deterministic matchers.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| -o, --output <PATH> | Output file path | <path>/.eforge/rules/custom-rules.yaml |
| --force | Force overwrite if destination file already exists | false |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge hook install
Governanceeforge hook install [OPTIONS]Install native sub-200ms Git hook scripts into .git/hooks/ while preserving any pre-existing foreign hooks as <hook>.forge-backup.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --hook <TYPE> | Hook type to install: pre-commit, pre-push, all | all |
| --force | Force overwrite of existing hook files | false |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge hook run
Governanceeforge hook run <HOOK> [OPTIONS]Execute a Git hook lifecycle check on staged files (pre-commit) or unpushed commits (pre-push). Bypassable via FORGE_SKIP_HOOK=1.
| Option / Argument | Description | Default |
|---|---|---|
| <HOOK> | Hook lifecycle event to execute: pre-commit or pre-push | — |
| -p, --path <PATH> | Target repository directory | . |
| --fail-on <SEVERITY> | Minimum finding severity to fail the hook (critical|high|medium|low|info) | — |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge hook status
Governanceeforge hook status [OPTIONS]Inspect the installation, backup preservation, and configuration status of Git hooks in the repository.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge hook uninstall
Governanceeforge hook uninstall [OPTIONS]Remove ELCODE Forge Git hook scripts from .git/hooks/ and automatically restore any .forge-backup files.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --hook <TYPE> | Hook type to uninstall: pre-commit, pre-push, all | all |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge policy check
Governanceeforge policy [check] [OPTIONS]Assert enterprise Policy-as-Code rules, minimum health/dimension scores, secret zero-tolerance, license restrictions, circular dependency caps, and time-bounded waivers.
| Option / Argument | Description | Default |
|---|---|---|
| --policy <PATH> | Optional path to an external policy file (.yaml or .json); defaults to inline policy: in eforge.config.yaml | — |
| -p, --path <PATH> | Target repository directory | . |
| --fail-on <SEVERITY> | Minimum finding severity to fail on (critical|high|medium|low|info) | — |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge audit
Complianceeforge audit [OPTIONS]Export automated compliance audit reports mapping repository findings, SBOM dependencies, and architecture controls to SOC 2 Type II, OWASP Top 10 (2021), or ISO/IEC 27001:2022.
| Option / Argument | Description | Default |
|---|---|---|
| --standard <STD> | Compliance framework standard: soc2, owasp, iso27001 | soc2 |
| -p, --path <PATH> | Target repository directory | . |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
| -o, --output <PATH> | Optional file path to write the rendered audit report | — |
eforge report
Integrationeforge report [OPTIONS]Generate a deterministic, timestamp-free ReportBundle JSON for Web Intelligence Dashboard consumption and optionally save a commit history snapshot.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| -o, --output <PATH> | Optional file path to write the rendered ReportBundle JSON | — |
| --hotspots <N> | Top N Git churn hotspots to include | 10 |
| --no-git | Skip Git history and working-tree diff inspection | false |
| --save-history | Persist an idempotent history snapshot to .eforge/history/<ts>-<sha12>.json | false |
eforge serve
Integrationeforge serve [OPTIONS]Start the read-only local loopback HTTP server (127.0.0.1:<port>) exposing /api/v1/health, /api/v1/bundle, and /api/v1/history for live dashboard intelligence.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --port <PORT> | Loopback TCP port to bind (127.0.0.1:<port>) | 7878 |
| --allow-origin <ORIGIN> | Explicit allowed CORS origin (wildcard '*' is strictly forbidden) | — |
| --static-dir <DIR> | Optional directory from which to serve compiled static dashboard assets | — |
eforge schema
Integrationeforge schema [OPTIONS]Export the canonical JSON Schema for ReportBundle and IR types (single source of truth for @elcode-forge/schema and dashboard validation).
| Option / Argument | Description | Default |
|---|---|---|
| -o, --output <PATH> | Optional file path to write the rendered JSON Schema | — |
eforge mcp
Integrationeforge mcp [OPTIONS]Start the native Model Context Protocol (MCP) JSON-RPC 2.0 stdio server exposing 11 deterministic eforge_* tools (including pre-flight patch verification) wrapped in UntrustedEnvelope<T>.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
eforge login
Integrationeforge login [OPTIONS]Authenticate with a remote or self-hosted ELCODE Forge Server, validate /api/v1/health, and store credentials in ~/.eforge/credentials.yaml (0o600).
| Option / Argument | Description | Default |
|---|---|---|
| --server <URL> | Remote server URL | https://forge.elcode.id |
| --token <TOKEN> | Personal Access Token or Service Account Key | — |
| --username <USER> | Optional username or service account identifier | — |
| --no-validate | Skip remote server /api/v1/health validation check | false |
eforge logout
Integrationeforge logout [OPTIONS]Remove stored credentials for a specified or default remote ELCODE Forge Server.
| Option / Argument | Description | Default |
|---|---|---|
| --server <URL> | Remote server URL to log out from (or default server if omitted) | — |
eforge auth status
Integrationeforge auth status [OPTIONS]Display current remote authentication status, active server, masked token, and credential store source (also supports eforge auth login / logout).
| Option / Argument | Description | Default |
|---|---|---|
| --server <URL> | Remote server URL to inspect (or default server if omitted) | — |
| --format <FMT> | Output format: terminal, json | terminal |
eforge push
Integrationeforge push [OPTIONS]Upload the local repository analysis snapshot (SyncPushPayload) to a remote Forge Server (POST /api/v1/sync/push) and update the local cached baseline.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --server <URL> | Remote server URL override | — |
| --token <TOKEN> | API token override (defaults to EFORGE_API_TOKEN or stored credentials) | — |
| --branch <BRANCH> | Target Git branch name (defaults to active branch or 'main') | — |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge pull
Integrationeforge pull [OPTIONS]Fetch the remote baseline snapshot from Forge Server (GET /api/v1/sync/pull) and cache it locally in <repo_root>/.eforge/baseline.json.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --server <URL> | Remote server URL override | — |
| --token <TOKEN> | API token override | — |
| --branch <BRANCH> | Target Git branch name (defaults to active branch or 'main') | — |
| --format <FMT> | Output format: terminal, json, markdown | terminal |
eforge sync
Integrationeforge sync [OPTIONS]Synchronize repository state with a remote Forge Server: pull baseline, compute DeltaSummary (added/resolved findings & health shift), push updated snapshot, and enforce --fail-on.
| Option / Argument | Description | Default |
|---|---|---|
| -p, --path <PATH> | Target repository directory | . |
| --server <URL> | Remote server URL override | — |
| --token <TOKEN> | API token override | — |
| --branch <BRANCH> | Target Git branch name | — |
| --fail-on <SEVERITY> | Minimum finding severity to fail on (critical|high|medium|low|info) | — |
| --format <FMT> | Output format: terminal, json, markdown | terminal |