Skip to main content
  • An application created with fjall create app, so it has a fjall/<app>/infrastructure.ts file.
  • At least one codemod (fjall add, fjall modify, or fjall remove) that wrote a snapshot to the application’s .fjall/history directory. A brand-new application with no edits has no snapshots to list.
  • Node 22.3 or later.
Every codemod that edits 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

In a terminal, fjall history opens a snapshot picker rather than printing a list:
The picker lists every retained snapshot, newest first, each labelled with its timestamp and size. Ten rows are visible at a time and the arrow keys scroll through the rest. Select one, and a confirmation screen shows the snapshot path, timestamp, and size before anything is written. The confirmation defaults to No, so pressing enter cancels. Add --non-interactive to print the listing instead:
Output is one row per snapshot with its ISO 8601 timestamp, size in bytes, and absolute path:
Restore a specific snapshot by timestamp. This skips the picker in every shell, so it is the form to use in scripts and CI:
Copy the timestamp verbatim from the listing. Snapshots are recorded to the second, so a millisecond-precision timestamp such as 2026-05-29T14:02:11.482Z matches nothing and the command exits with Snapshot not found for timestamp '...'.

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:
  1. Looks up the snapshot matching that timestamp.
  2. Writes a .bak backup of the current infrastructure.ts, so the pre-restore state is recoverable with fjall undo.
  3. Overwrites infrastructure.ts with the snapshot contents.
If no snapshot matches, Fjall prints the available-snapshots hint and exits without touching 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 with FJALL_CODEMOD_HISTORY_LIMIT:
Values above 1000 are clamped to 1000. Invalid or non-positive values fall back to 10.

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.