New to FORGE? Start a free 30-day trial

Diagnostic Command

Updated on Oct 1, 2026

frg diagnose checks whether Forge is ready to run in the current project and collects diagnostic data for troubleshooting or a support request. It runs offline (no network authentication probes) and does not need a license or a working agent, so you can use it when other commands fail.

Prerequisites

  • Forge installed. No license, coding agent, or work-item context is required.
  • Run the command from the project directory you want to check.

Subcommands at a glance

frg diagnose has no subcommands. Choose a mode with options:

ModeWhat it doesTypical inputsOutputs
frg diagnoseReadiness report for the terminalProject and user configurationHuman-readable report on stdout
frg diagnose --format jsonSame report as JSONProject and user configurationJSON on stdout
frg diagnose --bundleSupport bundle archiveConfiguration, plus logs and traces when requestedfrg-diagnose-<YYYYMMDD>-<HHMMSS>.tar.gz in the current directory, or the --output path
--include-logs, --include-tracesAdds runtime files from the last 24 hoursForge log and trace filesIncluded in the bundle

Typical flow

text
frg diagnose ──► fix failed checks ──► frg diagnose ──► still failing? ──► frg diagnose --bundle --include-logs --include-traces ──► review ──► share
  1. Check readiness:
bash
frg diagnose
  1. Fix each FAIL check using the suggestion shown under it, then run frg diagnose again.
  2. If the problem persists, create a support bundle with recent logs and traces:
bash
frg diagnose --bundle --include-logs --include-traces --output ./frg-support.tar.gz
  1. Inspect the bundle before you share it:
bash
tar tzf ./frg-support.tar.gz

frg diagnose

text
frg diagnose [OPTIONS]
OptionDescriptionDefault
--format <FORMAT>Output format: human or json.human
--bundleGenerates a support bundle archive (.tar.gz).Off
-o, --output <PATH>Output path for the bundle. The file must not already exist.frg-diagnose-<timestamp>.tar.gz in the current directory
--include-tracesIncludes trace files from the last 24 hours.Off
--include-logsIncludes log files from the last 24 hours.Off
-v, --verboseIncludes detailed file paths and timing information.Off
-q, --quietSuppresses all output except errors.Off

Examples:

bash
frg diagnose --format json > diagnostic.json
frg diagnose --verbose
frg diagnose --bundle --include-logs

Report contents

The report shows the schema version (1.0.0), Forge version, collection mode (offline), an overall readiness status, and one check per category (for example initialization, agent, toolchain) with level pass or fail, a message, and a suggestion.

Example output (abbreviated, from a project without an agent or toolchain.toml):

json
{
 "version": "1.0.0",
 "status": "Error",
 "forge_version": "4.6.0",
 "collection_mode": "offline",
 "status_checks": [
 { "category": "initialization", "level": "pass", "message": "Project initialized at ." },
 { "category": "toolchain", "level": "fail",
 "message": "toolchain.toml is missing (REQUIRED)",
 "suggestion": "Run 'frg config init --issues <tool> --code <tool>' to create toolchain.toml" }
 ],
 "warnings": [],
 "collection_stats": { "files_scanned": 0, "files_collected": 0, "files_skipped": 0, "bytes_collected": 0 }
}

Support bundles

A bundle contains:

  • diagnostic.json: the report above.
  • manifest.json: an inventory of the bundle.
  • The selected log and trace files, when you pass --include-logs or --include-traces.

Diagnostic output redacts detected tokens, keys, secrets, and passwords, and runtime files are size-limited. Review the bundle before sharing it; it can still contain project names, paths, and prompts.

Exit codes

CodeMeaning
0Collection completed, whatever the readiness status (a report with status Error still exits 0).
4Invalid diagnostic arguments, for example --format xml.
Non-zeroCollection or output failed, for example when the bundle path already exists.

Troubleshooting

Invalid diagnostic arguments: Validation error: Invalid format: xml. Use 'human' or 'json'.

Cause: --format has a value other than human or json.

Solution: Run frg diagnose --format json or frg diagnose --format human.

Output file already exists: . Use --output to specify a different path.

Cause: --bundle never overwrites an existing file.

Solution:

  1. Choose a new path: frg diagnose --bundle --output ./frg-support-2.tar.gz, or
  2. Remove the old archive first.

The bundle contains no logs or traces

Cause: Logs and traces are opt-in, and only files from the last 24 hours are collected.

Solution: Add --include-logs --include-traces, and reproduce the problem shortly before you create the bundle.

See Also