TrylleDocs
CLI

AI and Agent Commands

Configure direct AI providers, explain changes, draft Git text, and run local coding agents from Trylle CLI.

Trylle CLI has two separate AI execution models:

ModelCommandsExecution
Direct providerask, explain, draftSends a request directly to OpenAI, Anthropic, Ollama, or another configured provider
Local agent CLIagentStarts an installed Codex CLI, Claude CLI, or OpenCode CLI process

Direct AI is bring your own key

try ask, try explain, and try draft do not use Trylle-hosted AI or a Trylle CLI Key. The selected provider receives the request and applies its own billing. See AI usage and billing for the distinction from Trylle-hosted features.

Configure a direct provider

Run the interactive setup:

try ask --reconfigure

The wizard selects a provider, accepts an optional API key and model, and saves the result in the Trylle CLI config.json. try ai is an alias, but try ask is the canonical command name.

For a one-off override:

# OPENAI_API_KEY is already present in the environment.
try ask --provider openai --model gpt-5.3-codex-spark \
  "show the Git command that rebases this branch onto main"

Direct configuration uses these variables:

VariablePurpose
TRYLLE_AI_CONFIGPath to an explicit AI JSON configuration file
TRYLLE_AI_PROVIDERProvider ID
TRYLLE_AI_API_KEYGeneric key override
TRYLLE_AI_MODELModel override
TRYLLE_AI_THINKINGStored thinking setting
TRYLLE_AI_FASTStored fast-mode setting

Command flags and TRYLLE_AI_* values have the highest precedence, followed by an explicit --config file, values saved by the CLI, and the optional ~/.config/trylle-cli/ai.config.json fallback. Provider-native variables such as OPENAI_API_KEY or ANTHROPIC_API_KEY can supply an ephemeral key without putting it in the command line.

Passing --api-key or TRYLLE_AI_API_KEY to try ask causes that provider key to be remembered in config.json. Use the provider-native environment variable when the key should remain process-local.

Direct providers

Provider IDDefault modelNative key variable
openaigpt-5.3-codex-sparkOPENAI_API_KEY
anthropicclaude-sonnet-5ANTHROPIC_API_KEY
groqqwen/qwen3.6-27bGROQ_API_KEY
ollamallama3.2None; local endpoint
opencode-zenclaude-sonnet-5OPENCODE_API_KEY
openrouteranthropic/claude-sonnet-5OPENROUTER_API_KEY
deepseekdeepseek-chatDEEPSEEK_API_KEY
geminigemini-2.5-flashGEMINI_API_KEY
xaigrok-3XAI_API_KEY
zaiglm-5.2ZAI_API_KEY
vercelanthropic/claude-sonnet-4.5VERCEL_API_KEY

Model availability and provider pricing can change independently of the CLI. Pass --model when the provider no longer serves the listed default.

Thinking and fast flags on direct AI

The current CLI accepts and stores --thinking and --fast for direct AI configuration, but it does not pass either setting to the direct provider request. They do affect supported local providers in try agent.

Ask for a command

try ask "squash the last three commits into one"

ask prints the proposed shell command, an explanation, and any warning. It executes the command through the system shell only after an explicit y confirmation. Inspect shell operators, paths, remotes, and destructive Git operations before accepting.

try ask is an interactive confirmation flow rather than a structured-output command.

Explain changes

Without a reference, explain uses the current working-tree diff. It can also read staged changes, commits, ranges, pull requests, and a range plus working tree.

try explain
try explain --staged
try explain HEAD~1
try explain main..feature
try explain main...feature
try explain main..-
try explain 73 --origin OWNER/NAME
try explain --query "What changes the authorization boundary?" main..feature

Use the built-in commit picker with try explain --list. Scripts and agents can request structured output; the JSON object contains the provider's text under explanation.

Draft commits and branches

try draft prefers staged changes and falls back to the unstaged diff when nothing is staged:

try draft
try draft --context "preserve backward compatibility"

Generate a branch name from the current diff:

try draft branch
try draft branch --context "use a docs/ prefix"

Use --create only when the CLI should perform the Git write:

try draft --create
try draft branch --create

For commits, --create does not stage files. It runs git commit --edit --message ..., so the generated message opens in the configured editor and only already-staged changes are committed. For branches, --force deletes a conflicting local branch before recreating it. --yes skips the creation confirmation. Structured output cannot be combined with --create.

Run a local coding agent

Install and authenticate one of the supported agent CLIs, then configure Trylle:

try agent --reconfigure

Run a task with an explicit provider when useful:

try agent --provider codex-cli "fix the failing tests"
try agent --provider claude-cli --model MODEL "review this change"
try agent --provider opencode-cli "simplify the parser"

Agent settings are independent from direct AI settings and use TRYLLE_AGENT_CONFIG, TRYLLE_AGENT_PROVIDER, TRYLLE_AGENT_MODEL, TRYLLE_AGENT_THINKING, and TRYLLE_AGENT_FAST.

Agent mode grants broad permissions

try agent launches providers in unattended modes that bypass or relax their normal approval checks. Codex receives a sandbox and approval bypass, Claude receives --dangerously-skip-permissions, and OpenCode receives --auto. The process can modify Git state and access the network. Run it only in a repository and environment you trust.

The command provisions the Trylle agent skill when needed. Use --no-skill to skip provisioning for one run, or --latest-skill to replace the discovered installation with the latest published skill before starting.

try agent streams the local provider's events instead of returning one structured response.

On this page