clean
Purge generated data — run artifacts, history ledger, and auth profiles. Never deletes form YAMLs. Use delete.md for library forms. To remove one past run/batch (and its history rows), prefer gform run delete.
scopes
gform clean artifacts
gform clean art # short alias
gform clean history
gform clean hist # short alias
gform clean auth
gform clean all| scope | removes |
|---|---|
artifacts | run/batch dirs under $GFORM_HOME/artifacts/ |
history | history.jsonl (dedupe fingerprint ledger) |
auth | all auth profiles and cookies |
all | artifacts + history + auth |
Every scope shows a preview first, then asks for confirmation on TTY.
non-interactive / CI
gform clean artifacts --yes
gform clean history -y
gform clean all --yes--yes / -y skips the confirm prompt — required on non-TTY (CI, pipes).
age-filtered artifacts
gform clean artifacts --older-than 30
gform clean all --older-than 7 --yesOnly removes artifact dirs older than N days. Applies to artifacts and all scopes. History and auth in all are still fully cleared.
live / running protect
Artifacts that look still running (status + recent manifest writes vs form timeout) are skipped by clean artifacts / clean all. The command reports how many were skipped and asks you to wait for the other terminal, or pass --force to remove them anyway (including stale-running orphans).
gform clean artifacts --force --yeswhat clean does not touch
$GFORM_HOME/forms/— library YAMLs./forms/— project-local forms- browser default preference
- CLI version check cache (
$GFORM_HOME/state/)
preview output
Before confirming, clean prints counts and sample paths so you know what will go. Aborted runs exit code 1.
gform clean artifacts
# preview …
# Delete artifacts? (y/N)when to use each scope
| goal | command |
|---|---|
| disk space from old runs | clean artifacts --older-than 30 |
| reset dedupe ledger | clean history |
| sign out everywhere | clean auth or auth delete <name> |
| factory reset (keep forms) | clean all --yes |
| remove a form definition | gform delete <name> — not clean |
gotchas
clean authremoves all profiles — not just the active one.- Artifact index (
index.json) rebuilds on nextgform run list. - Skipped-run manifests count as artifacts too.
gform run listafterclean artifactsshows "No artifacts yet."
related
- artifacts.md — what artifacts contain
- delete.md — remove library forms
- run.md —
run listbefore cleaning - auth.md — profile storage