From 569691db1dfcd66ec182154a0dede3971dcc21f1 Mon Sep 17 00:00:00 2001 From: Fabio Mora Date: Tue, 6 Jan 2026 12:52:34 -0600 Subject: [PATCH 1/2] fix: version not set correctly via ldflags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cobra command was initialized at package load time, copying the default "dev" value before main() could update cli.Version via ldflags. Added SetVersion() function that updates both cli.Version and rootCmd.Version, and call it from main() before Execute(). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- cmd/ch/main.go | 5 +++-- internal/cli/root.go | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cmd/ch/main.go b/cmd/ch/main.go index 371b009..37f1d51 100644 --- a/cmd/ch/main.go +++ b/cmd/ch/main.go @@ -17,10 +17,11 @@ var ( func main() { // Set version info for CLI - cli.Version = version + v := version if commit != "none" && len(commit) > 7 { - cli.Version = fmt.Sprintf("%s (%s, %s)", version, commit[:7], date) + v = fmt.Sprintf("%s (%s, %s)", version, commit[:7], date) } + cli.SetVersion(v) if err := cli.Execute(); err != nil { fmt.Fprintf(os.Stderr, "Error: %v\n", err) diff --git a/internal/cli/root.go b/internal/cli/root.go index 31d6dab..fb31ec0 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -20,6 +20,13 @@ func Execute() error { return rootCmd.Execute() } +// SetVersion sets the version string for the CLI. +// Must be called before Execute() to take effect. +func SetVersion(v string) { + Version = v + rootCmd.Version = v +} + var rootCmd = &cobra.Command{ Use: "ch", Short: "Claude History - view Claude Code conversation history", From b143ed1e94d5d49384c3c5d428d765162def1fe2 Mon Sep 17 00:00:00 2001 From: Fabio Mora Date: Tue, 6 Jan 2026 15:47:44 -0600 Subject: [PATCH 2/2] fix(ci): update golangci-lint and fix list default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update golangci-lint to v2.0 for Go 1.25 compatibility - Fix list command to exclude agents by default (was true, now false) This aligns with README documentation and E2E test expectations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .github/workflows/ci.yml | 2 +- internal/cli/list.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7423f8..d40686a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: go-version-file: go.mod - uses: golangci/golangci-lint-action@v6 with: - version: v1.62 + version: v2.0 build: strategy: diff --git a/internal/cli/list.go b/internal/cli/list.go index 780582a..9593853 100644 --- a/internal/cli/list.go +++ b/internal/cli/list.go @@ -30,7 +30,7 @@ var ( ) func init() { - listCmd.Flags().BoolVarP(&listAgents, "agents", "a", true, "Include agent/subagent conversations (default: true)") + listCmd.Flags().BoolVarP(&listAgents, "agents", "a", false, "Include agent/subagent conversations") listCmd.Flags().StringVarP(&listProject, "project", "p", "", "Filter by project path") listCmd.Flags().IntVarP(&listLimit, "limit", "n", 50, "Limit number of results") listCmd.Flags().BoolVarP(&listGlobal, "global", "g", false, "List from all projects")