Complete, authoritative reference for all 41 eforge (and alias elcode-forge) commands, flags, output formatters, and deterministic exit codes.

NPX / Zero-Install Parity:
Every single command below can be executed directly without installation or Rust toolchain via 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)

Deterministic Exit Codes Contract (0..=4)
0 • Success Execution succeeded; zero policy violations
1 • FindingsAboveThreshold Findings reached or exceeded --fail-on severity
2 • ConfigurationError Invalid eforge.config.yaml, rule schema, or CLI flag
3 • ExecutionError I/O error, path traversal block, or runtime failure
4 • SecurityPolicyFailure Security audit, Policy-as-Code, or compliance gate failed
Supported --format Output Formatters
terminal TTY-aware ANSI theme, visual score meter, ASCII pipe fallback
json Byte-for-byte deterministic pretty-printed JSON
markdown GitHub-Flavored Markdown tables & Mermaid flowcharts
sarif OASIS SARIF v2.1.0 JSON with CVSS v3 security-severity
github GitHub Actions workflow annotations (::error, ::warning)

eforge init

Diagnostics
eforge init [OPTIONS]

Initialize eforge.config.yaml and .eforge/ workspace metadata and BLAKE3 incremental cache directory.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--forceOverwrite existing eforge.config.yaml if presentfalse
Practical Examples
$ eforge init
$ eforge init --path ./services/api
$ eforge init --force
Exit Codes Contract
[0] Initialized eforge.config.yaml and .eforge/ directory
[2] Configuration already exists (when --force is not passed)

eforge doctor

Diagnostics
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--format <FMT>Output format: terminal, json, markdown, sarif, githubterminal
Practical Examples
$ eforge doctor
$ eforge doctor --path . --format json
$ eforge doctor --format markdown
Exit Codes Contract
[0] All diagnostic checks completed with zero fatal failures
[1] One or more repository checks failed or breached thresholds

eforge scan

Diagnostics
eforge scan [OPTIONS]

Execute a full or BLAKE3 incremental polyglot architecture, dependency, declarative rule, OSV vulnerability, secret, and 8-dimension health scan.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--format <FMT>Output format: terminal, json, markdown, sarif, githubterminal
--fullForce a full repository scan bypassing cachefalse
--incrementalUse .eforge/metadata.json BLAKE3 content hashes to inspect changed filesfalse
-i, --interactiveLaunch interactive terminal UI modefalse
--codeframeRender rich box-drawn multi-line source code framesfalse
--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—
Practical Examples
$ eforge scan
$ eforge scan --incremental --fail-on high
$ eforge scan --format sarif -o eforge.sarif
$ eforge scan --format github --fail-on high
Exit Codes Contract
[0] Scan succeeded with no findings at or above --fail-on threshold
[1] Findings met or exceeded the configured --fail-on severity threshold
[2] Invalid configuration or severity threshold syntax

eforge review

Diagnostics
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--format <FMT>Output format: terminal, json, markdown, sarif, githubterminal
--fastRun fast diff-scoped modefalse
--changedScope analysis strictly to changed files in working treefalse
-i, --interactiveLaunch interactive terminal UI modefalse
--impacted-testsSelect exact impacted test files and synthesize runner commandsfalse
--fail-on <SEVERITY>Minimum finding severity to return non-zero exit code (critical|high|medium|low|info)—
Practical Examples
$ eforge review --fast
$ eforge review --fast --changed --fail-on high
$ eforge review --format markdown
Exit Codes Contract
[0] Diff review passed below threshold
[1] Diff findings met or exceeded --fail-on severity

eforge diff

Diagnostics
eforge 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).

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--remoteCompare findings and health score against cached remote baseline (.eforge/baseline.json)false
--format <FMT>Output format: terminal, json, markdown, sarif, githubterminal
Practical Examples
$ eforge diff
$ eforge diff --format markdown
$ eforge diff --remote --format json
Exit Codes Contract
[0] Diff impact or remote baseline delta computed

eforge graph

Architecture
eforge graph [OPTIONS]

Export the inferred polyglot module architecture graph, inter-module import edges, high-centrality modules, and Tarjan SCC circular dependency cycles.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--format <FMT>terminal (module list), json (ArchitectureGraph), markdown (Mermaid flowchart TD)terminal
Practical Examples
$ eforge graph
$ eforge graph --format markdown
$ eforge graph --format json
Exit Codes Contract
[0] Architecture graph resolved and rendered

eforge dependencies

Architecture
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--format <FMT>Output format: terminal, json, markdown, sarif, githubterminal
Practical Examples
$ eforge dependencies
$ eforge dependencies --format json
$ eforge dependencies --format markdown
Exit Codes Contract
[0] Dependency report generated

eforge onboard

Architecture
eforge onboard [OPTIONS]

Generate the deterministic 5-file living developer onboarding and architecture documentation bundle (architecture.md, modules.md, dependencies.md, onboarding.md, risks.md).

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
-o, --output <DIR>Output directory for generated Markdown docs<path>/docs/forge
Practical Examples
$ eforge onboard
$ eforge onboard --path . -o ./docs/architecture
Exit Codes Contract
[0] 5 Markdown documentation files written deterministically

eforge docs

Architecture
eforge docs [OPTIONS]

Alias for eforge onboard — regenerate deterministic architecture, module, dependency, onboarding, and risk documentation.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
-o, --output <DIR>Output directory for generated Markdown docs<path>/docs/forge
Practical Examples
$ eforge docs
$ eforge docs -o ./docs/forge
Exit Codes Contract
[0] Documentation bundle regenerated

eforge security

Security
eforge security [OPTIONS]

Run focused secret detection (verified credentials + Shannon entropy), unsafe JS/TS/Python/PHP code pattern analysis, and polyglot OSV dependency vulnerability auditing.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--format <FMT>Output format: terminal, json, markdown, sarif, githubterminal
--auditRun deep dependency vulnerability audit against OSV/GHSA advisoriesfalse
--offlineRun in offline mode using embedded and cached (.eforge/cache/osv/) advisories onlyfalse
--fail-on <SEVERITY>Minimum finding severity to trigger security gate failure (critical|high|medium|low|info)—
Practical Examples
$ eforge security
$ eforge security --audit --fail-on high
$ eforge security --audit --offline --format sarif
Exit Codes Contract
[0] No security findings at or above threshold
[4] SecurityPolicyFailure: findings breached --fail-on severity threshold

eforge sbom

Security
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--format <FMT>SBOM specification format: cyclonedx, spdxcyclonedx
-o, --output <PATH>Optional file path to write the rendered SBOM JSON—
Practical Examples
$ eforge sbom --format cyclonedx -o sbom.cdx.json
$ eforge sbom --format spdx -o sbom.spdx.json
Exit Codes Contract
[0] SBOM generated deterministically

eforge explain

AI
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
[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, githubterminal
--aiAugment deterministic structural facts with grounded AI synthesisfalse
--provider <PROVIDER>AI provider override: openai, anthropic, gemini, mock—
--model <MODEL>Model identifier override (e.g. gpt-4o, qwen2.5-coder:7b)—
--dry-runOutput assembled ContextPack and token estimates without calling AI providerfalse
--no-cacheBypass .eforge/ai-cache/ response cachefalse
Practical Examples
$ eforge explain
$ eforge explain src/services --format markdown
$ eforge explain src/services --ai
$ eforge explain src/services --ai --dry-run
Exit Codes Contract
[0] Structural explanation and verified AI claims rendered

eforge ai-review

AI
eforge ai-review [OPTIONS]

Analyze changes with deterministic diff/PR review augmented by grounded AI review items (Confirmed, Probable, Suggestion) verified via apply_deterministic_guard.

Flags & Arguments
Option / ArgumentDescriptionDefault
-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)—
--fastRun fast diff-scoped modefalse
--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-runOutput ContextPack and token estimates without network callsfalse
--no-cacheBypass .eforge/ai-cache/ response cachefalse
--format <FMT>Output format: terminal, json, markdown, sarif, githubterminal
Practical Examples
$ eforge ai-review --dry-run
$ eforge ai-review --base origin/develop --fast --fail-on high
$ eforge ai-review --provider openai --model qwen2.5-coder:7b
Exit Codes Contract
[0] Review completed; deterministic findings below threshold
[1] Deterministic findings breached --fail-on (AI never alters exit codes)

eforge ai status

AI
eforge ai status [OPTIONS]

Inspect effective AI configuration, masked credential status, daily budget, and optionally test live provider connectivity and latency (--ping).

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--pingTest live provider reachability and measure round-trip latencyfalse
--format <FMT>Output format: terminal, jsonterminal
Practical Examples
$ eforge ai status
$ eforge ai status --ping
$ eforge ai status --format json
Exit Codes Contract
[0] AI status inspected (zero network calls unless --ping is set)

eforge ai usage

AI
eforge ai usage [OPTIONS]

Summarize AI token consumption, response cache hits, accumulated USD spend, and remaining daily budget from .eforge/ai-usage.jsonl.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--format <FMT>Output format: terminal, jsonterminal
Practical Examples
$ eforge ai usage
$ eforge ai usage --format json
Exit Codes Contract
[0] Usage ledger summarized safely

eforge rules list

Governance
eforge 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).

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
-c, --category <CAT>Filter by category: architecture, quality, security, dependencies—
--enabled-onlyShow only enabled rulesfalse
--format <FMT>Output format: terminal, json, markdownterminal
Practical Examples
$ eforge rules
$ eforge rules list --category architecture --enabled-only
$ eforge rules list --format json
Exit Codes Contract
[0] Rule catalog rendered

eforge ui

Architecture
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--tab <1..=4>Initial active tab index (1: DAG, 2: Cycles, 3: Blast Radius, 4: Findings)1
Practical Examples
$ eforge ui
$ eforge ui --tab 2
Exit Codes Contract
[0] TUI exited cleanly on 'q' or Esc

eforge watch

Architecture
eforge watch [OPTIONS]

Live incremental architectural radar leveraging .eforge/cache/file-ast-v1.json to re-evaluate health score deltas in < 50ms on file save.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--debounce-ms <MS>Debounce delay before triggering re-analysis150
--onceExecute a single watch cycle and exit (ideal for CI and scripts)false
--format <FMT>Output format: terminal, json, markdownterminal
Practical Examples
$ eforge watch
$ eforge watch --debounce-ms 200
$ eforge watch --once --format json
Exit Codes Contract
[0] Watch session terminated or single cycle clean

eforge fix

Governance
eforge fix [OPTIONS]

Surgical deterministic auto-fix engine generating transactional codemods with atomic backup in .eforge/tx/<tx_id>/ and rollback capability.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--dry-runPreview proposed codemods and unified diffs without modifying filestrue
--applyExecute 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, markdownterminal
Practical Examples
$ eforge fix --dry-run
$ eforge fix --apply
$ eforge fix --apply --rule quality/max-file-lines
$ eforge fix --rollback
Exit Codes Contract
[0] Fix plan generated or transaction applied/rolled back successfully
[1] Unfixable violations remain or rollback target missing

eforge simulate

Architecture
eforge simulate [OPTIONS]

Simulate moving files or modules in memory, predicting relative import rewrites, Tarjan SCC cycle impact, and health score shifts before touching disk.

Flags & Arguments
Option / ArgumentDescriptionDefault
-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, markdownterminal
Practical Examples
$ eforge simulate --move src/db/client.ts:src/infra/db/client.ts
$ eforge simulate --plan refactor.yaml --format json
Exit Codes Contract
[0] Refactoring simulation completed successfully

eforge trend

Diagnostics
eforge trend [OPTIONS]

Evaluate historical 8-Dimension Health Score evolution across Git commits, architectural drift, and composite hotspots (Churn × Fan-In × Severity).

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--commits <N>Number of historical commits to analyze10
--format <FMT>Output format: terminal, json, markdownterminal
Practical Examples
$ eforge trend
$ eforge trend --commits 25 --format markdown
Exit Codes Contract
[0] Health trend and composite hotspots calculated

eforge blame-arch

Diagnostics
eforge blame-arch [OPTIONS]

Attribute architectural boundary and Tarjan SCC circular-dependency violations to the introducing Git commit, author, and timestamp.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--format <FMT>Output format: terminal, json, markdownterminal
Practical Examples
$ eforge blame-arch
$ eforge blame-arch --format markdown
Exit Codes Contract
[0] Architectural blame attribution resolved

eforge rules infer

Governance
eforge rules infer [OPTIONS]

Infer architectural archetype, layer boundaries, and forbidden_imports rules from module fan-in, fan-out, and instability metrics.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--writeWrite inferred rules directly to .eforge/rules/inferred-architecture.yamlfalse
--format <FMT>Output format: terminal, json, markdownterminal
Practical Examples
$ eforge rules infer
$ eforge rules infer --write
Exit Codes Contract
[0] Topology analyzed and boundary rules inferred

eforge rules check

Governance
eforge rules check [PATH] [OPTIONS]

Validate syntax and matcher invariants of declarative YAML/JSON rule files without executing a full repository scan.

Flags & Arguments
Option / ArgumentDescriptionDefault
[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, markdownterminal
Practical Examples
$ eforge rules check
$ eforge rules check .eforge/rules/custom-rules.yaml
Exit Codes Contract
[0] All declarative rule files are syntactically valid
[2] ConfigurationError: invalid rule ID, unknown matcher, or missing required field

eforge rules init

Governance
eforge rules init [OPTIONS]

Generate a starter declarative rule template in .eforge/rules/custom-rules.yaml with examples for all 6 deterministic matchers.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
-o, --output <PATH>Output file path<path>/.eforge/rules/custom-rules.yaml
--forceForce overwrite if destination file already existsfalse
--format <FMT>Output format: terminal, json, markdownterminal
Practical Examples
$ eforge rules init
$ eforge rules init --force
Exit Codes Contract
[0] Starter custom-rules.yaml template created

eforge hook install

Governance
eforge hook install [OPTIONS]

Install native sub-200ms Git hook scripts into .git/hooks/ while preserving any pre-existing foreign hooks as <hook>.forge-backup.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--hook <TYPE>Hook type to install: pre-commit, pre-push, allall
--forceForce overwrite of existing hook filesfalse
--format <FMT>Output format: terminal, json, markdownterminal
Practical Examples
$ eforge hook install
$ eforge hook install --hook pre-commit
Exit Codes Contract
[0] Git hooks installed with 0o755 executable permissions

eforge hook run

Governance
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
<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, markdownterminal
Practical Examples
$ eforge hook run pre-commit
$ eforge hook run pre-push --fail-on critical
Exit Codes Contract
[0] Staged/unpushed changes passed verification
[1] Findings exceeded fail_on threshold; commit/push blocked

eforge hook status

Governance
eforge hook status [OPTIONS]

Inspect the installation, backup preservation, and configuration status of Git hooks in the repository.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--format <FMT>Output format: terminal, json, markdownterminal
Practical Examples
$ eforge hook status
$ eforge hook status --format json
Exit Codes Contract
[0] Hook status report displayed

eforge hook uninstall

Governance
eforge hook uninstall [OPTIONS]

Remove ELCODE Forge Git hook scripts from .git/hooks/ and automatically restore any .forge-backup files.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
--hook <TYPE>Hook type to uninstall: pre-commit, pre-push, allall
--format <FMT>Output format: terminal, json, markdownterminal
Practical Examples
$ eforge hook uninstall
$ eforge hook uninstall --hook pre-push
Exit Codes Contract
[0] Hooks removed and backups restored

eforge policy check

Governance
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
--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, markdownterminal
Practical Examples
$ eforge policy check
$ eforge policy check --policy ./policies/enterprise-gate.yaml --format markdown
Exit Codes Contract
[0] PolicyVerdict::Passed — all constraints satisfied
[1] PolicyVerdict::Warning — warning threshold reached
[2] ConfigurationError — no policy defined or invalid YAML/JSON
[4] SecurityPolicyFailure — one or more policy constraints violated

eforge audit

Compliance
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
--standard <STD>Compliance framework standard: soc2, owasp, iso27001soc2
-p, --path <PATH>Target repository directory.
--format <FMT>Output format: terminal, json, markdownterminal
-o, --output <PATH>Optional file path to write the rendered audit report—
Practical Examples
$ eforge audit --standard soc2
$ eforge audit --standard owasp --format markdown -o owasp-audit.md
$ eforge audit --standard iso27001 --format json -o iso27001.json
Exit Codes Contract
[0] All evaluated compliance clauses passed
[4] SecurityPolicyFailure: one or more compliance clauses failed

eforge report

Integration
eforge report [OPTIONS]

Generate a deterministic, timestamp-free ReportBundle JSON for Web Intelligence Dashboard consumption and optionally save a commit history snapshot.

Flags & Arguments
Option / ArgumentDescriptionDefault
-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 include10
--no-gitSkip Git history and working-tree diff inspectionfalse
--save-historyPersist an idempotent history snapshot to .eforge/history/<ts>-<sha12>.jsonfalse
Practical Examples
$ eforge report -o forge-report.json
$ eforge report --save-history -o forge-report.json
Exit Codes Contract
[0] Deterministic ReportBundle JSON emitted

eforge serve

Integration
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
-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—
Practical Examples
$ eforge serve --port 7878
$ eforge serve --port 7878 --allow-origin http://localhost:5173
Exit Codes Contract
[0] Server exited cleanly

eforge schema

Integration
eforge schema [OPTIONS]

Export the canonical JSON Schema for ReportBundle and IR types (single source of truth for @elcode-forge/schema and dashboard validation).

Flags & Arguments
Option / ArgumentDescriptionDefault
-o, --output <PATH>Optional file path to write the rendered JSON Schema—
Practical Examples
$ eforge schema -o packages/forge-schema/report-bundle.schema.json
Exit Codes Contract
[0] JSON Schema rendered deterministically

eforge mcp

Integration
eforge 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>.

Flags & Arguments
Option / ArgumentDescriptionDefault
-p, --path <PATH>Target repository directory.
Practical Examples
$ eforge mcp --path /path/to/repo
Exit Codes Contract
[0] MCP stdio server closed cleanly on EOF

eforge login

Integration
eforge login [OPTIONS]

Authenticate with a remote or self-hosted ELCODE Forge Server, validate /api/v1/health, and store credentials in ~/.eforge/credentials.yaml (0o600).

Flags & Arguments
Option / ArgumentDescriptionDefault
--server <URL>Remote server URLhttps://forge.elcode.id
--token <TOKEN>Personal Access Token or Service Account Key—
--username <USER>Optional username or service account identifier—
--no-validateSkip remote server /api/v1/health validation checkfalse
Practical Examples
$ eforge login --server http://localhost:8080 --token ef_admin_key
Exit Codes Contract
[0] Credentials verified and saved to ~/.eforge/credentials.yaml

eforge logout

Integration
eforge logout [OPTIONS]

Remove stored credentials for a specified or default remote ELCODE Forge Server.

Flags & Arguments
Option / ArgumentDescriptionDefault
--server <URL>Remote server URL to log out from (or default server if omitted)—
Practical Examples
$ eforge logout
$ eforge logout --server http://localhost:8080
Exit Codes Contract
[0] Stored credentials removed

eforge auth status

Integration
eforge auth status [OPTIONS]

Display current remote authentication status, active server, masked token, and credential store source (also supports eforge auth login / logout).

Flags & Arguments
Option / ArgumentDescriptionDefault
--server <URL>Remote server URL to inspect (or default server if omitted)—
--format <FMT>Output format: terminal, jsonterminal
Practical Examples
$ eforge auth status
$ eforge auth status --format json
Exit Codes Contract
[0] Authentication status displayed with masked token

eforge push

Integration
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
-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, markdownterminal
Practical Examples
$ eforge push
$ eforge push --branch main --format json
Exit Codes Contract
[0] Snapshot pushed and indexed on Forge Server

eforge pull

Integration
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
-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, markdownterminal
Practical Examples
$ eforge pull
$ eforge pull --branch develop
Exit Codes Contract
[0] Baseline snapshot saved to .eforge/baseline.json

eforge sync

Integration
eforge 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.

Flags & Arguments
Option / ArgumentDescriptionDefault
-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, markdownterminal
Practical Examples
$ eforge sync
$ eforge sync --branch main --fail-on high --format markdown
Exit Codes Contract
[0] Bidirectional sync completed and policy threshold passed
[1] Findings met or exceeded --fail-on severity