Skip to content

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 ​

bash
gform clean artifacts
gform clean art                    # short alias
gform clean history
gform clean hist                   # short alias
gform clean auth
gform clean all
scoperemoves
artifactsrun/batch dirs under $GFORM_HOME/artifacts/
historyhistory.jsonl (dedupe fingerprint ledger)
authall auth profiles and cookies
allartifacts + history + auth

Every scope shows a preview first, then asks for confirmation on TTY.

non-interactive / CI ​

bash
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 ​

bash
gform clean artifacts --older-than 30
gform clean all --older-than 7 --yes

Only 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).

bash
gform clean artifacts --force --yes

what 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.

bash
gform clean artifacts
# preview …
# Delete artifacts? (y/N)

when to use each scope ​

goalcommand
disk space from old runsclean artifacts --older-than 30
reset dedupe ledgerclean history
sign out everywhereclean auth or auth delete <name>
factory reset (keep forms)clean all --yes
remove a form definitiongform delete <name> — not clean

gotchas ​

  • clean auth removes all profiles — not just the active one.
  • Artifact index (index.json) rebuilds on next gform run list.
  • Skipped-run manifests count as artifacts too.
  • gform run list after clean artifacts shows "No artifacts yet."