Skip to content

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

feat: add 'pinchtab profiles' cli command to list available profiles

Mario807c7f94405a
diff --git a/cmd/pinchtab/cmd_cli.go b/cmd/pinchtab/cmd_cli.go
index 9de3677c..984dfcd4 100644
--- a/cmd/pinchtab/cmd_cli.go
+++ b/cmd/pinchtab/cmd_cli.go
@@ -15,7 +15,7 @@ import (
)
func printHelp() {
- fmt.Printf(`pinchtab %s — Browser control for AI agents
+ fmt.Printf(`pinchtab %s - Browser control for AI agents
MODES:
pinchtab Start server (default port 9867)
@@ -42,6 +42,7 @@ CLI COMMANDS:
pinchtab eval <expression> Run JavaScript
pinchtab pdf [-o file] [options] Export page as PDF (see PDF FLAGS)
pinchtab instances List running instances
+ pinchtab profiles List available profiles
pinchtab health Check server status
SNAPSHOT FLAGS:
@@ -100,7 +101,7 @@ var cliCommands = map[string]bool{
"screenshot": true, "ss": true,
"eval": true, "evaluate": true,
"pdf": true, "health": true,
- "help": true, "quick": true, "instances": true,
+ "help": true, "quick": true, "instances": true, "profiles": true,
}
func isCLICommand(cmd string) bool {
@@ -151,6 +152,8 @@ func runCLI(cfg *config.RuntimeConfig) {
cliHealth(client, base, token)
case "instances":
cliInstances(client, base, token)
+ case "profiles":
+ cliProfiles(client, base, token)
case "quick":
cliQuick(client, base, token, args)
case "help":
@@ -159,7 +162,7 @@ func runCLI(cfg *config.RuntimeConfig) {
}
func cliHelp() {
- fmt.Print(`Pinchtab CLI — browser control from the command line
+ fmt.Print(`Pinchtab CLI - browser control from the command line
Usage: pinchtab <command> [args] [flags]
@@ -659,6 +662,27 @@ func cliInstances(client *http.Client, base, token string) {
}
}
+// --- profiles ---
+
+func cliProfiles(client *http.Client, base, token string) {
+ result := doGet(client, base, token, "/profiles", nil)
+
+ // Display profiles in a friendly format
+ if profiles, ok := result["profiles"].([]interface{}); ok && len(profiles) > 0 {
+ fmt.Println()
+ for _, prof := range profiles {
+ if m, ok := prof.(map[string]any); ok {
+ name, _ := m["name"].(string)
+
+ fmt.Printf("👤 %s\n", name)
+ }
+ }
+ fmt.Println()
+ } else {
+ fmt.Println("No profiles available")
+ }
+}
+
// --- helpers ---
func doGet(client *http.Client, base, token, path string, params url.Values) map[string]any {