Skip to content

feat: chezmoi dotfile manager support (80-90% token savings)#418

Closed
jsoyer wants to merge 3 commits intortk-ai:masterfrom
jsoyer:feat/chezmoi-support
Closed

feat: chezmoi dotfile manager support (80-90% token savings)#418
jsoyer wants to merge 3 commits intortk-ai:masterfrom
jsoyer:feat/chezmoi-support

Conversation

@jsoyer
Copy link

@jsoyer jsoyer commented Mar 8, 2026

Summary

Adds rtk chezmoi with 9 filtered subcommands covering the full daily chezmoi workflow. Auto-rewrite hook intercepts all commands transparently.

Commands

Command Output Savings
chezmoi diff File-level summary: M .zshrc +3/-1 instead of full git diff ~85%
chezmoi apply ok ✓ 2 files applied ~90%
chezmoi status chezmoi status: 1 added, 2 modified + file list ~75%
chezmoi managed File count grouped by directory ~70%
chezmoi add <files> ok ✓ 1 file added ~85%
chezmoi re-add <files> ok ✓ 1 file re-added ~85%
chezmoi update ok ✓ updated (2 source files changed, 2 dotfiles applied) ~90%
chezmoi unmanaged File count grouped by directory ~70%
chezmoi doctor Header summary + warnings/errors only (ok lines suppressed) ~80%

All other subcommands passthrough transparently (e.g. chezmoi edit, chezmoi cd, chezmoi init).

Example output

$ rtk chezmoi diff
chezmoi diff: 2 files
  M .zshrc                                             +3/-1
  A .config/nvim/lua/plugins.lua                       +42

$ rtk chezmoi update
ok ✓ updated (2 source files changed, 2 dotfiles applied)

$ rtk chezmoi update   # nothing to pull
ok ✓ already up to date

$ rtk chezmoi doctor   # all good
chezmoi doctor: ok (12 checks passed)

$ rtk chezmoi doctor   # issues found
chezmoi doctor: 11 ok, 1 warning, 0 errors
warning    key (no GPG key configured)

Test plan

  • cargo fmt --all && cargo clippy --all-targets && cargo test — 740 tests, 0 failures
  • 31 chezmoi-specific unit tests with token savings assertions (≥60% each)
  • Hook rewrite covers all 9 subcommands
  • chezmoi doctor preserves non-zero exit code when issues found
  • chezmoi update handles both "already up to date" and actual pull cases

🤖 Generated with Claude Code

jsoyer and others added 3 commits March 8, 2026 11:19
Adds rtk chezmoi with 4 filtered subcommands:
- diff: file-level summary instead of full git diff (85% savings)
- apply: "ok ✓ N files applied" summary (90% savings)
- status: grouped counts with file list (75% savings)
- managed: file count grouped by directory (70% savings)

Unknown subcommands passthrough transparently.

Auto-rewrite hook updated to intercept chezmoi diff/apply/status/managed.
Registry rules added for discover and rtk rewrite integration.
14 unit tests, all passing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- rtk chezmoi add <files>: "ok ✓ N files added" (85% savings)
- rtk chezmoi re-add <files>: "ok ✓ N files re-added" (85% savings)
- Hook rewrite updated for chezmoi add/re-add
- Registry pattern extended to include add and re-add
- 5 new unit tests (19 total)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- update: "ok ✓ updated (N source files changed, M dotfiles applied)" or
  "ok ✓ already up to date" (90% savings vs raw git+apply output)
- unmanaged: file count grouped by directory, same pattern as managed (70%)
- doctor: header summary + only warnings/errors, suppresses ok lines (80%)

Hook rewrite and registry extended to cover all 3 new subcommands.
12 new unit tests (31 chezmoi total, 740 overall).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aeppling
Copy link
Contributor

aeppling commented Mar 9, 2026

Hello,

Thanks for contributing,
Please read CONTRIBUTING.md, your branch should be from develop and the PR should target develop branch

Then we will be able to review & merge if valid :)

@jsoyer
Copy link
Author

jsoyer commented Mar 9, 2026

Closing in favor of #436 which correctly targets the develop branch as per CONTRIBUTING.md.

@jsoyer jsoyer closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants