feat(cmd): add grut clean to remove transient session and diagnostic data#345
Open
jongio wants to merge 1 commit into
Open
feat(cmd): add grut clean to remove transient session and diagnostic data#345jongio wants to merge 1 commit into
grut clean to remove transient session and diagnostic data#345jongio wants to merge 1 commit into
Conversation
…c data grut accumulates saved session state under DataDir/sessions and watchdog diagnostic logs under DataDir/diagnostics over time, with no built-in way to reclaim that space short of deleting directories by hand. Add a `grut clean` command. Without --force it previews each target, its size, and the total space it would reclaim. With --force it deletes them. Missing targets are reported and skipped, so running on a fresh machine is a no-op. clean deliberately leaves alone anything that isn't regenerable cache: the config file, installed extensions, crash reports (owned by `grut report --clear`), the MCP audit log, and the first-run marker. Closes #342 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07f6eb49-d72f-4f2a-9285-065b5d835f5b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add a
grut cleancommand that removes grut's transient data: saved sessionstate (
DataDir/sessions) and watchdog diagnostic logs (DataDir/diagnostics).Why
These directories grow over time and there was no built-in way to reclaim the
space. You had to find the data dir and delete subdirectories by hand.
Behavior
grut clean(default): preview mode. Lists each target, its size, and thefull path, plus the total space that would be reclaimed. Deletes nothing.
grut clean --force: deletes the targets and prints the reclaimed size.not presentand skipped, so running on afresh machine is a safe no-op.
What it never touches
config.tomlextensions/(user-installed)crashes/(usegrut report --clear)mcp-audit.logTesting
go build ./...go test ./cmd/...(8 new tests: preview, force, exclude preservation,missing dirs, arg rejection, registration, dir sizing, byte humanizing)
go vet ./...,mage lint(0 issues),mage deadcode(OK), gofumpt clean--forceremoves bothtargets, second
--forcerun is idempotent.Closes #342