cli

package
v0.5.15 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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