From 9492cd9782e275627309747ef8a2979625353d61 Mon Sep 17 00:00:00 2001 From: AnnatarHe Date: Sun, 1 Mar 2026 12:07:09 +0800 Subject: [PATCH] feat(init): auto-install CC and Codex OTEL configs during init Make `shelltime init` a true one-stop setup by automatically installing Claude Code and Codex OTEL configurations after daemon install. Failures are non-blocking to avoid halting the init process. Co-Authored-By: Claude Opus 4.6 --- commands/init.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/commands/init.go b/commands/init.go index fac4657..dc57169 100644 --- a/commands/init.go +++ b/commands/init.go @@ -7,7 +7,7 @@ import ( var InitCommand *cli.Command = &cli.Command{ Name: "init", - Usage: "Initialize shelltime: authenticate, install hooks, and start daemon", + Usage: "Initialize shelltime: authenticate, install hooks, start daemon, and configure AI code integrations", Flags: []cli.Flag{ &cli.StringFlag{ Name: "token", @@ -37,6 +37,16 @@ func commandInit(c *cli.Context) error { return err } + // Step 4: Install Claude Code OTEL configuration + if err := commandCCInstall(c); err != nil { + color.Red.Printf("Failed to install Claude Code OTEL config: %v\n", err) + } + + // Step 5: Install Codex OTEL configuration + if err := commandCodexInstall(c); err != nil { + color.Red.Printf("Failed to install Codex OTEL config: %v\n", err) + } + color.Green.Println("ShellTime is fully initialized and ready to use!") return nil }