Context
The current integration tests in tests/integration_test.go mutate os.Args and os.Stdout globally. Even with the C6/C7 fixes in v0.2.0, the approach is fragile because Cobra's PersistentPreRun hooks and flag default values are set once at package init. The correct pattern is to expose a NewRootCmd() constructor in internal/cli that returns a fresh *cobra.Command per call, making each test fully isolated without process-level side effects.
Acceptance criteria
Context
The current integration tests in tests/integration_test.go mutate os.Args and os.Stdout globally. Even with the C6/C7 fixes in v0.2.0, the approach is fragile because Cobra's PersistentPreRun hooks and flag default values are set once at package init. The correct pattern is to expose a NewRootCmd() constructor in internal/cli that returns a fresh *cobra.Command per call, making each test fully isolated without process-level side effects.
Acceptance criteria