Documentation
¶
Overview ¶
Package commandai turns a request into shell-command proposals using an engine the user already has: a signed-in agent CLI, a local model, or their own API key. It never runs a proposed command.
Index ¶
- Constants
- func Cancel(requestId string)
- func GetStatus(ctx context.Context, refresh bool) wshrpc.CommandAiStatus
- func ListModels(ctx context.Context, req wshrpc.CommandAiModelsRequest) wshrpc.CommandAiModels
- func Preview(ctx context.Context, req wshrpc.CommandAiRequest) (wshrpc.CommandAiPreview, error)
- func Redact(s string) (string, int)
- func Run(ctx context.Context, req wshrpc.CommandAiRequest) (result wshrpc.CommandAiResult)
Constants ¶
View Source
const ( EngineCodex = "codex" EngineClaude = "claude" EngineOllama = "ollama" EngineOpenAI = "openai" EngineAnthropic = "anthropic" )
View Source
const ( KindCli = "cli" KindLocal = "local" KindApi = "api" )
View Source
const ( TaskCompose = "compose" TaskFix = "fix" TaskExplain = "explain" )
View Source
const ( StatusOk = "ok" StatusDisabled = "disabled" StatusNotConfigured = "notconfigured" StatusSignedOut = "signedout" StatusFailed = "failed" StatusTimeout = "timeout" StatusCanceled = "canceled" StatusEmpty = "empty" )
View Source
const ( SecretOpenAIKey = "COMMANDAI_OPENAI_KEY" SecretAnthropicKey = "COMMANDAI_ANTHROPIC_KEY" )
Variables ¶
This section is empty.
Functions ¶
func ListModels ¶
func ListModels(ctx context.Context, req wshrpc.CommandAiModelsRequest) wshrpc.CommandAiModels
func Preview ¶
func Preview(ctx context.Context, req wshrpc.CommandAiRequest) (wshrpc.CommandAiPreview, error)
func Run ¶
func Run(ctx context.Context, req wshrpc.CommandAiRequest) (result wshrpc.CommandAiResult)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.