CLI
Every input is a flag or stdin. Designed so humans and coding agents can run it without menus.
Command tree
tny # interactive TUI, fresh session
tny ask [prompt] # one turn, then exit
tny resume [last|<id>] # interactive resume
tny sessions
tny session last|<id>
tny providers
tny tasks
tny task show NAME # inspect one resolved preset
tny models
tny permissions
tny workspace list|add|remove|clear
tny status
tny doctor
tny usage
tny login | logout | setup
Global flags
Global flags are leading — they come before the command.
tny --provider openai|codex|grok|NAME [command]
tny --cwd DIR
tny --model ID
tny --task NAME # runtime preset: review|optimizer|document|retro|task-creation
tny --add-dir DIR # repeatable, process-only
tny --permission-mode ask|auto|yolo # default: yolo
tny --json # where listed
tny -r # session picker (TUI)
tny -c # resume last for this workspace
Runtime task presets
--task NAME selects one of the built-ins review,
optimizer, document, retro, or
task-creation, or a custom
Markdown file at .tny/tasks/NAME.md (project) or
~/.tny/tasks/NAME.md (user). Project definitions win. Files may
use only name: and description: frontmatter and a
non-empty UTF-8 body no larger than 256 KiB. SSH sessions use built-ins only.
The selected name/source/digest is recorded with the session; resuming restores
it and rejects a mismatched explicit selector. --agent CMD remains
a removed legacy option.
cat > .tny/tasks/release-review.md <<'TASK'
---
name: release-review
description: Review release-readiness risks
---
Inspect correctness, compatibility, rollback, and test coverage.
TASK
tny --task release-review ask "Review this release"
Ask the bundled authoring preset to create a reusable task. It defaults to
.tny/tasks/NAME.md, validates the result when CLI access is available,
and gives you a new invocation without automatically executing the task.
tny --task task-creation ask "Create a task named release-review for reviewing releases"
tny task show release-review
Help shape
Every subcommand has --help with copy-paste examples. Missing required values print the error, then a correct example, then exit 1. No timed prompts.
tny ask --helpProvider flags
| Provider | Flags / env |
|---|---|
| codex | --chatgpt-token, --chatgpt-account-id, CHATGPT_ACCESS_TOKEN, CHATGPT_ACCOUNT_ID; else ~/.tny/codex-auth.json (tny --provider codex login) or $CODEX_HOME/auth.json; TNY_CODEX_BASE_URL |
| openai | --base-url, --api-key-env, OPENAI_BASE_URL, OPENAI_API_KEY |
JSON where it matters
--json is accepted on ask, status, doctor, permissions, models, tasks, task show, session, sessions, workspace, and usage.
Examples
tnytny ask "explain src/main.c"tny --task review ask "inspect the current diff"tny task show reviewtny ask --json --provider openai "list exported symbols"tny --provider openai ask --model gpt-5.4 "fix the leak"