forgeplan export
forgeplan export serializes the entire workspace - artifacts, links, evidence records, scoring state, and metadata - into a single JSON file. It is the mandatory backup step before any destructive operation on .forgeplan/ and the only way to produce a restorable snapshot that captures state beyond the tracked markdown.
When to use
Section titled “When to use”- Always before
rm -rf .forgeplan,forgeplan init --force, or any other destructive workspace operation. No exceptions. - Before upgrading the Forgeplan binary, as a safety net in case
forgeplan migratefails. - Periodically as a disaster-recovery backup, especially before major methodology restructurings.
- When moving a workspace between machines and you need full state (scoring, evidence decay) rather than just markdown.
- For debugging - sharing a workspace snapshot with teammates or attaching it to an issue.
When NOT to use
Section titled “When NOT to use”- As a daily git commit target - the tracked markdown under
.forgeplan/{adrs,prds,rfcs,...}is already the canonical source of truth (ADR-003). Export is for LanceDB-resident state. - For publishing or sharing with non-Forgeplan tools - the JSON schema is internal and unstable across versions.
- As a substitute for git - it is not a version history tool, just a point-in-time snapshot.
forgeplan export [OPTIONS]Options
Section titled “Options” -o, --output <OUTPUT> Output file path (default: .forgeplan/export.json) -h, --help Print help -V, --version Print versionExamples
Section titled “Examples”Example 1: Default backup
Section titled “Example 1: Default backup”forgeplan exportWrites to .forgeplan/export.json. Convenient but lives inside the very folder you might be about to delete - prefer an explicit external path for real backups.
Example 2: Pre-reinit safety backup
Section titled “Example 2: Pre-reinit safety backup”forgeplan export --output ~/backups/forgeplan-$(date +%Y%m%d-%H%M).jsoncp -r .forgeplan .forgeplan-backup-$(date +%Y%m%d)rm -rf .forgeplanforgeplan init -yforgeplan import ~/backups/forgeplan-*.jsonThe full “safe reinit” ritual. The export lands outside .forgeplan/, and a filesystem copy of the whole folder provides a secondary safety net.
Example 3: Pre-upgrade snapshot
Section titled “Example 3: Pre-upgrade snapshot”forgeplan export --output pre-v0.18-upgrade.jsoncargo install forgeplanforgeplan migrateforgeplan health# if anything looks wrong:rm -rf .forgeplan && forgeplan init -yforgeplan import pre-v0.18-upgrade.jsonCheap insurance before a version bump.
Example 4: Share workspace state with a teammate
Section titled “Example 4: Share workspace state with a teammate”forgeplan export --output snapshot.jsongh gist create snapshot.json # or attach to an issueGives a teammate everything they need to reproduce scoring, health output, and decay state - markdown alone can’t do this.
How it fits the workflow
Section titled “How it fits the workflow”export is a safety operation, not part of the artifact lifecycle. It should be muscle memory before any of the following:
rm -rf .forgeplanforgeplan init --forceforgeplan migrateon a meaningful workspace- Upgrading the binary across a major version
- Experimental bulk edits to markdown
The rule is simple: if you are about to touch the workspace in a way you can’t undo with git, export first.
Safety notes
Section titled “Safety notes”- Default path lives inside
.forgeplan/.forgeplan exportwith no arguments writes to.forgeplan/export.json, which is lost if you thenrm -rf .forgeplan. Always pass-owith a path outside the workspace for real backups. - Exports are not encrypted. They may contain LLM prompts, internal notes, and other sensitive content. Don’t commit them to public repos.
- Export + filesystem copy is the gold standard.
forgeplan export -o backup.json && cp -r .forgeplan .forgeplan-backup-$(date +%Y%m%d)gives you both a structured restore path and a raw bit-for-bit snapshot. config.yamlis NOT in the export. LLM API key settings live in.forgeplan/config.yamland must be backed up separately.- Exports are versioned to the binary. A backup made under v0.17 may require running
forgeplan migrateafter importing into v0.18.
See also
Section titled “See also”forgeplan import- the restore counterpartforgeplan init- the destructive step export usually precedesforgeplan migrate- non-destructive schema upgrade (still back up first)forgeplan scan-import- rebuild index from tracked markdownforgeplan health- verify the workspace before and after backup cycles