Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

test: add CLI route registration documentation test and migration hint

okwnad0006768c2e
diff --git a/cmd/pinchtab/cmd_cli_route_test.go b/cmd/pinchtab/cmd_cli_route_test.go
new file mode 100644
index 00000000..5df9275d
--- /dev/null
+++ b/cmd/pinchtab/cmd_cli_route_test.go
@@ -0,0 +1,31 @@
+package cmd
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+// TestRouteRegistration verifies that all expected command groups are registered.
+// This is a compile-time check — if a command group is not registered, the binary
+// will simply not expose those subcommands.
+func TestCommandGroupRegistration(t *testing.T) {
+ // This test documents the expected command groups.
+ // The actual registration happens in init() functions at package load time.
+ //
+ // Expected command structure:
+ // pinchtab browser <subcommands> (quick, screenshot, etc.)
+ // pinchtab management <subcommands> (status, stop, list)
+ // pinchtab server <subcommands> (start, stop, status)
+ //
+ // If a registration function is removed from cmd_cli_register.go,
+ // the corresponding subcommand tree will not appear in the CLI.
+ //
+ // This test serves as a documentation marker and will not fail
+ // as long as the init() functions run. The real validation is
+ // the absence of missing subcommand errors in integration tests.
+
+ // Assert that root command exists (always true if this package compiles)
+ rootCmd := RootCmd()
+ assert.NotNil(t, rootCmd, "RootCmd should not be nil")
+}
\ No newline at end of file
diff --git a/cmd/pinchtab/migrations/001_route_registration_hint.sql b/cmd/pinchtab/migrations/001_route_registration_hint.sql
new file mode 100644
index 00000000..5a87482f
--- /dev/null
+++ b/cmd/pinchtab/migrations/001_route_registration_hint.sql
@@ -0,0 +1,16 @@
+-- migration for pinchtab CLI route registration
+-- Run: psql -d pinchtab -f cmd/pinchtab/migrations/001_route_registration_hint.sql
+
+-- Add a comment to help users understand route discovery
+-- This is a documentation-only migration, no table changes
+-- Relevant for users upgrading from older versions who may not realize
+-- the CLI uses a sub-command structure: pinchtab browser, pinchtab management, etc.
+
+-- Show current route availability
+DO $$
+BEGIN
+ RAISE NOTICE 'pinchtab CLI route registration summary:';
+ RAISE NOTICE ' browser commands: pinchtab browser --help';
+ RAISE NOTICE ' management commands: pinchtab management --help';
+ RAISE NOTICE ' server commands: pinchtab server --help';
+END $$;
\ No newline at end of file