Repository navigation
refactor(cli): split main.go into per-command files - #7
Merged
Merged
Conversation
main.go was 940 lines holding 13 cobra commands plus shared output helpers. Each command now lives in its own file alongside the existing pair.go/config.go/client.go pattern; shared output helpers (printJSON, truncate, printSearchResults) move to render.go. main.go shrinks to ~50 lines: root command, --json persistent flag, AddCommand wiring. Pure motion. Behavior, flags, output text all unchanged. Sets the stage for upcoming verbosity (charmbracelet/log) and TUI polish (charmbracelet/fang, lipgloss tables, huh prompts) without piling each onto a single 1k-line file. go build ./... clean. go test ./... green. ./bin/rememberize --help lists the same 13 commands in same order. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Apr 28, 2026
3 tasks
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.
Summary
cmd/rememberize/main.go(940 lines, 13 cobra commands + shared helpers) into per-command files alongside the existingpair.go/config.go/client.gopattern.printJSON,truncate,printSearchResults) move to a newrender.go.main.goshrinks to ~50 lines: root command,--jsonpersistent flag,AddCommandwiring.Context
First PR in the scaffolding + verbosity + Charmbracelet polish sprint (plan:
~/.claude/plans/peppy-forging-dahl.md). Pure code motion with zero behavior change — sets the stage so the upcoming PRs (logger, fang, lipgloss tables, huh prompts) each diff cleanly against one command file at a time instead of piling on a 1k-line monolith.Files
Verification
go build ./...clean.go test ./...green (pair tests untouched, exercise the same code paths).go vet ./...clean../bin/rememberize --helplists the same 13 commands in the same order../bin/rememberize --versionreportsrememberize version devas before.Test plan
git diff --statto confirm the diff is dominated by motion (insertions ≈ deletions).Out of scope
No new dependencies, no behavior change, no test changes. The next PR introduces
charmbracelet/log+--verbose/--quietflags.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.