TONI — Terminal Operation Natural Instruction
Describe in plain English, get a shell command.
GeminiOpenAIMistralDeepSeekOllamaGroq… one~/.tonivialitellm.
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/asciinemaGIF —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 inprioritydescending (higher first, default50). disabled=trueskips a provider; failure falls through to next.env-keylets 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
- Create a virtual environment:
python -m venv venv
source venv/bin/activate
- Install for development:
pip install -e .
- 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.24
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| toni_cli-0.1.24.tar.gz | 14.9 kB | Without provenance | Details for toni_cli-0.1.24.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| toni_cli-0.1.24-py3-none-any.whl | Python 3 | none | any | Details for toni_cli-0.1.24-py3-none-any.whl |
Total release size: 28.0 kB
Release files / toni_cli-0.1.24.tar.gz
| Download URL | toni_cli-0.1.24.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4cad54f3a5989dd3f232b842a18c628646bad30380830667b6ba523ae0044c99
|
|
BLAKE2b-256 checksum How to use checksums |
b2efa1488e9ce89b4505e3125ffce6821d9306dfa20375bb4184a70cc7575398
|
| 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.24-py3-none-any.whl
| Download URL | toni_cli-0.1.24-py3-none-any.whl |
|---|---|
| Size | 13.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
baadacd218ceeadbcfdfab01e23611f770964da33ddd7785b368237aa4f9fe56
|
|
BLAKE2b-256 checksum How to use checksums |
3e646e2bacf17a423f8dfbeade33ddb699860f96a07b14f0610a35717428ed51
|
| 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.24
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.