Prerequisites
Prerequisites
- An application created with
fjall create app, so it has afjall/<app>/infrastructure.tsfile. - At least one codemod (
fjall add,fjall modify, orfjall remove) that wrote a snapshot to the application’s.fjall/historydirectory. A brand-new application with no edits has no snapshots to list. - Node 22.3 or later.
infrastructure.ts saves a timestamped snapshot in the application’s .fjall/history directory. Use fjall history to browse those snapshots and roll the file back to one of them.
List or restore snapshots
fjall history opens a snapshot picker rather than printing a list:
--non-interactive to print the listing instead:
What Happens
Listing reads the application’s.fjall/history directory and reports each recorded snapshot. No files change.
Restoring a snapshot, whether from the picker or from --restore, does three things:
- Looks up the snapshot matching that timestamp.
- Writes a
.bakbackup of the currentinfrastructure.ts, so the pre-restore state is recoverable withfjall undo. - Overwrites
infrastructure.tswith the snapshot contents.
infrastructure.ts. Run fjall history --app <name> --non-interactive first and copy an exact timestamp from the list.
Restoring rewrites the local infrastructure.ts file only. Run fjall deploy <app> afterwards to apply the restored infrastructure to AWS. To roll back the most recent codemod instead of a named snapshot, use fjall undo.
Retention
Fjall keeps the 10 most recent snapshots per infrastructure file and prunes older ones after every codemod write. A state from twenty edits ago is already gone. Raise the limit withFJALL_CODEMOD_HISTORY_LIMIT:
Agent mode
With--agent, the listing returns tabular records carrying timestamp, path, and sizeBytes, plus a total count. A --restore run returns the restore receipt instead: action, target, path, snapshotPath, and backupPath. Each branch validates --fields against its own schema, so a field name valid for the listing is rejected on a restore.
Options
Agent flags
These flags shape output for AI-agent and scripted callers.Next Steps
fjall undo
Roll back the most recent codemod from its
.bak backup.fjall list
Confirm which resources the restored infrastructure declares.
fjall validate
Check the restored infrastructure parses and typechecks.
fjall deploy
Deploy restored infrastructure to AWS.