Skip to main content

TONI — Terminal Operation Natural Instruction

Describe in plain English, get a shell command. Gemini OpenAI Mistral DeepSeek Ollama Groq … one ~/.toni via litellm.

PyPI version PyPI Downloads Python 3.10+ License: MIT GitHub Stars

TONI is a lightweight CLI that translates natural language into terminal commands — system-aware (Linux/macOS/Windows), verifies the binary exists, and optionally executes.

Inspiration

TONI was inspired by YAI (Yet Another Interpreter), but with a focused approach. While YAI offers a comprehensive terminal experience, TONI is designed specifically to suggest and execute single commands based on natural language descriptions.

Features

  • Translates natural language to terminal commands
  • Unified LLM via litellm: single entry point for 100+ providers (OpenAI, Gemini, Mistral, DeepSeek, OpenRouter, Ollama, Groq, etc.) — no per-provider boilerplate
  • Cross-platform: Works on Linux, macOS, and Windows
  • System-aware: Detects your OS and generates platform-appropriate commands
  • Verifies command availability before execution
  • Saves executed commands to shell history (ZSH on Unix, custom history on Windows)
  • Simple to use and install

Installation

# Install from PyPI
pip install toni-cli

# Or with pipx (recommended)
pipx install toni-cli

Windows Installation

TONI works on Windows via pip or pipx:

# Using pip
pip install toni-cli

# Or with pipx (recommended)
pipx install toni-cli

Note: On Windows, TONI generates Windows-native commands (CMD/PowerShell) and saves command history to ~/.toni_history.

Demo

TODO: record 10s vhs/asciinema GIF — toni find large files → du -h . | sort -rh | head

$ toni find all python files containing "error"
Detected system: Linux (manjaro)
Suggested command: grep -r "error" --include="*.py" .
Explanation: Search recursively for "error" in Python files
Do you want to execute the command? (Y/n):

Configuration

TONI uses a configuration file at ~/.toni (INI format) and env vars. Since 0.1.23 all providers are routed through litellm — one completion() call for 100+ models, no per-provider boilerplate. Old ~/.toni files remain fully compatible.

Built-in Providers

Defaults (override in ~/.toni or env):

Provider Model default Env var Priority
GEMINI gemini-2.0-flash GOOGLEAI_API_KEY 40
OPENAI gpt-4o-mini OPENAI_API_KEY 50
MISTRAL mistral-small-latest MISTRAL_API_KEY 30
DEEPSEEK deepseek-v4-flash DEEPSEEK_API_KEY 25
OPENROUTER openrouter/free OPENROUTER_API_KEY 50
export GOOGLEAI_API_KEY='your-gemini-api-key'
export OPENAI_API_KEY='your-openai-api-key'
export MISTRAL_API_KEY='your-mistral-api-key'

Per-provider ~/.toni overrides:

[GEMINI]
model=gemini-2.5-flash-lite
priority=40

[OPENAI]
model=gpt-4o-mini
priority=50

Custom Providers (litellm)

Any section with url is treated as an OpenAI-compatible endpoint (model → openai/<model> + api_base=url). Built-ins map to litellm prefixes (gemini/, openai/, mistral/, deepseek/, openrouter/).

Example: Ollama (local)

[ollama]
url = http://localhost:11434/v1
key = ollama
model = llama3.2:latest
priority = 100

Example: Groq / OpenRouter / custom gateway

[groq]
url = https://api.groq.com/openai/v1
model = llama-3.1-8b-instant
env-key = GROQ_API_KEY
priority = 90

[openrouter]
url = https://openrouter.ai/api/v1
key = sk-or-v1-xxx...
model = anthropic/claude-3.5-sonnet
priority = 80

Priority & Fallback

  • All providers (custom + native) are merged and tried in priority descending (higher first, default 50).
  • disabled=true skips a provider; failure falls through to next.
  • env-key lets a section read its key from a custom env var (e.g. env-key=GROQ_API_KEY).

Environment Variables

For any custom provider [my-provider], you can set the key via:

export MY_PROVIDER_API_KEY='your-key'

or env-key in the INI. GOOGLEAI_API_KEY is also accepted for GEMINI.

Usage

Simply type toni followed by your natural language description:

# Basic file operations
toni list all pdf files in current directory
toni find all files modified in the last 7 days

# System queries
toni show my disk usage
toni what processes are using the most memory

# Complex tasks
toni create a backup of my Documents folder
toni find the largest files in this directory

Examples

Linux/macOS

$ toni find all python files containing the word "error"

Detected system: Linux (arch)
Suggested command: grep -r "error" --include="*.py" .
Explanation: Search recursively for the word "error" in all Python files in the current directory
Do you want to execute this command? (y/n):

Windows

> toni find all python files containing the word "error"

Detected system: Windows 10 (10.0.19045)
Suggested command: findstr /s /i "error" *.py
Explanation: Search for "error" in all Python files recursively
Do you want to execute this command? (Y/n):

Development

To contribute to TONI:

git clone https://github.com/Dakai/toni.git
cd toni
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate
  1. Install for development:
pip install -e .
  1. Make your changes and submit a pull request!

License

MIT

Acknowledgements

  • YAI for the inspiration
  • BerriAI/litellm for the unified LLM gateway
  • Google Gemini, OpenAI, Mistral, DeepSeek for their APIs

Metadata

Release files for toni-cli 0.1.28

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for toni-cli 0.1.28
File Size Uploaded Provenance Actions
toni_cli-0.1.28.tar.gz 16.2 kB Without provenance Details for toni_cli-0.1.28.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for toni-cli 0.1.28
File Interpreter ABI Platform Actions
toni_cli-0.1.28-py3-none-any.whl Python 3 none any Details for toni_cli-0.1.28-py3-none-any.whl

Total release size: 30.5 kB

Release files / toni_cli-0.1.28.tar.gz

Download URL toni_cli-0.1.28.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
057e41bd874f68c35270d6a5e2b44f14698e33bf592887977edb46f7934565cd
BLAKE2b-256 checksum
How to use checksums
7c73360fe50872ec1b9bec77ab5e138158950989ea20faad88155e6890ac85c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / toni_cli-0.1.28-py3-none-any.whl

Download URL toni_cli-0.1.28-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
688f42e10ea3b04bc180445df942fc2ca6d912295a31540d2ca420217b39878c
BLAKE2b-256 checksum
How to use checksums
1078e0577e69cfa6b8935ed14926f201147212e03afac8d7fc2e4583ae8b5831
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for toni-cli 0.1.28

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page