fjall undo restores the most recent backup of an application’s infrastructure.ts. Each fjall add, fjall remove, and fjall modify writes a sibling .bak file before changing the source. undo rolls the file back to that backup in one step.
Prerequisites
Prerequisites
- An application with an
infrastructure.tsfile (created withfjall create app). - A prior codemod (
fjall add,fjall remove, orfjall modify) on that application. The.bakfile is written by the most recent codemod, so there must be one to restore.
Restore the last change
api application:
What Happens
undo reads the .bak sidecar next to the application’s infrastructure.ts and writes its contents back over the source file.
| Step | Action |
|---|---|
| 1 | Resolve the application’s infrastructure.ts path from --app. |
| 2 | Read the sibling infrastructure.ts.bak backup. |
| 3 | Restore the backup over infrastructure.ts. |
| 4 | Print the path it restored from. |
.bak file holds a single prior version. undo reverts the most recent codemod only. To step back through older states, use the timestamped snapshots in the application’s .fjall/history directory.
If no .bak file exists, undo exits with an error and leaves infrastructure.ts untouched.
Agent mode. Pass --agent to emit a structured result for AI-agent and scripted callers. The output reports the restored path and a follow-up suggestion instead of human-readable text.
Options
| Option | Description | Default |
|---|---|---|
-a, --app <name> | Application whose infrastructure to undo. Required. | None |
-y, --yes | Skip confirmation prompts. | false |
-v, --verbose | Enable verbose logging. | false |
--non-interactive | Force plain CLI output (no interactive UI). | false |
Agent flags
These flags shape output for AI-agent and scripted callers.| Flag | Description |
|---|---|
--agent | Enable agent output mode. |
--budget <level> | Output budget: minimal, compact, or a token count. |
--fields <fields> | Request additional fields in output. |
--full | Disable content truncation. |
Next Steps
fjall add
Add a resource to an application’s infrastructure.
fjall list
List the resources defined in an application’s infrastructure.
fjall deploy
Deploy infrastructure changes to AWS.
Add resources
Walk through adding and changing resources end to end.