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:
| Model | Commands | Execution |
|---|---|---|
| Direct provider | ask, explain, draft | Sends a request directly to OpenAI, Anthropic, Ollama, or another configured provider |
| Local agent CLI | agent | Starts 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 --reconfigureThe 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:
| Variable | Purpose |
|---|---|
TRYLLE_AI_CONFIG | Path to an explicit AI JSON configuration file |
TRYLLE_AI_PROVIDER | Provider ID |
TRYLLE_AI_API_KEY | Generic key override |
TRYLLE_AI_MODEL | Model override |
TRYLLE_AI_THINKING | Stored thinking setting |
TRYLLE_AI_FAST | Stored 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 ID | Default model | Native key variable |
|---|---|---|
openai | gpt-5.3-codex-spark | OPENAI_API_KEY |
anthropic | claude-sonnet-5 | ANTHROPIC_API_KEY |
groq | qwen/qwen3.6-27b | GROQ_API_KEY |
ollama | llama3.2 | None; local endpoint |
opencode-zen | claude-sonnet-5 | OPENCODE_API_KEY |
openrouter | anthropic/claude-sonnet-5 | OPENROUTER_API_KEY |
deepseek | deepseek-chat | DEEPSEEK_API_KEY |
gemini | gemini-2.5-flash | GEMINI_API_KEY |
xai | grok-3 | XAI_API_KEY |
zai | glm-5.2 | ZAI_API_KEY |
vercel | anthropic/claude-sonnet-4.5 | VERCEL_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..featureUse 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 --createFor 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 --reconfigureRun 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.