cli

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KnownTools = []ToolDefinition{
	{
		Name:                    "Google Gemini CLI",
		BinaryName:              "gemini",
		ProviderKey:             constant.GeminiCLI,
		DefaultArgs:             []string{},
		JSONFormatArgs:          []string{"--output-format=json"},
		StreamFormatArgs:        []string{"--output-format=stream-json"},
		SupportsJSON:            true,
		SupportsStream:          true,
		SupportsAttachments:     true,
		AttachmentPrefix:        "@",
		SandboxFlag:             "-s",
		AutoApproveFlag:         "-y",
		YoloFlag:                "--yolo",
		SessionFlag:             "--resume=",
		UseStdin:                true,
		PositionalArgsSeparator: "--",
	},
	{
		Name:                "Mistral Vibe CLI",
		BinaryName:          "vibe",
		ProviderKey:         constant.VibeCLI,
		DefaultArgs:         []string{"-p"},
		SupportsJSON:        false,
		SupportsStream:      false,
		SupportsAttachments: true,
		AttachmentPrefix:    "@",
		AutoApproveFlag:     "--auto-approve",
		YoloFlag:            "--auto-approve",
		SessionFlag:         "--continue",
	},
	{
		Name:                "Anthropic Claude CLI",
		BinaryName:          "claude",
		ProviderKey:         constant.ClaudeCLI,
		DefaultArgs:         []string{"--print"},
		JSONFormatArgs:      []string{"--output-format=json"},
		StreamFormatArgs:    []string{"--output-format=stream-json"},
		SupportsJSON:        true,
		SupportsStream:      true,
		SupportsAttachments: false,
		AutoApproveFlag:     "--dangerously-skip-permissions",
		YoloFlag:            "--dangerously-skip-permissions",
		SessionFlag:         "--resume",
	},
	{
		Name:                "OpenAI Codex CLI",
		BinaryName:          "codex",
		ProviderKey:         "codex",
		DefaultArgs:         []string{"-p"},
		SupportsJSON:        false,
		SupportsStream:      false,
		SupportsAttachments: false,
		SandboxFlag:         "--sandbox",
		AutoApproveFlag:     "--full-auto",
		YoloFlag:            "--full-auto",
	},
}

KnownTools lists all CLI tools that SwitchAI supports as proxies.

Functions

This section is empty.

Types

type DiscoveredTool

type DiscoveredTool struct {
	Definition ToolDefinition
	Path       string
}

DiscoveredTool represents a tool found on the local system.

func DiscoverInstalledTools

func DiscoverInstalledTools() []DiscoveredTool

DiscoverInstalledTools scans the system PATH for known CLI tools.

type ToolDefinition

type ToolDefinition struct {
	Name             string   // Display name (e.g., "Google Gemini CLI")
	BinaryName       string   // Binary name to look for (e.g., "gemini")
	ProviderKey      string   // The provider key used in SwitchAI (e.g., "geminicli")
	DefaultArgs      []string // Default arguments to prepend (e.g., []string{"-p"})
	JSONFormatArgs   []string // Args to enable JSON output (e.g., ["--output-format=json"])
	StreamFormatArgs []string // Args to enable streaming JSON (e.g., ["--output-format=stream-json"])
	SupportsJSON     bool     // Whether the CLI supports JSON output format
	SupportsStream   bool     // Whether the CLI supports streaming JSON format

	// Capability and Flag mapping fields
	SupportsAttachments bool   // Whether the CLI supports @-command style attachments
	AttachmentPrefix    string // Prefix for attachments (e.g., "@")
	SandboxFlag         string // CLI flag for sandbox mode (e.g., "-s")
	AutoApproveFlag     string // CLI flag for auto-approval (e.g., "-y")
	YoloFlag            string // CLI flag for YOLO mode (e.g., "--yolo")
	SessionFlag         string // CLI flag for sessions (e.g., "--resume=" or "--continue")
	// Security fields
	UseStdin                bool   // Whether to pass the prompt via stdin instead of arguments
	PositionalArgsSeparator string // Separator to use before positional arguments (e.g., "--")
}

ToolDefinition represents a supported CLI tool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL