Skip to main content

TONI - Terminal Operation Natural Instruction

TONI is a lightweight CLI tool that translates natural language into terminal commands using AI. Simply describe what you want to do, and TONI will suggest the appropriate command for your system.

PyPI version

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.

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:

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

License

MIT

Acknowledgements

  • YAI for the inspiration
  • Google Gemini and OpenAI for their powerful AI APIs

Metadata

Release files for toni-cli 0.1.23

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.23
File Size Uploaded Provenance Actions
toni_cli-0.1.23.tar.gz 13.9 kB Without provenance Details for toni_cli-0.1.23.tar.gz

Built distribution (wheel)

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

Total release size: 26.4 kB

Release files / toni_cli-0.1.23.tar.gz

Download URL toni_cli-0.1.23.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
004898363308c8682b72dda23ea55ffafae5523666a41451849c519090e0db6e
BLAKE2b-256 checksum
How to use checksums
0d5472a0794b466b3b138254db8419687b7d2f967a186d852ad320a7265614d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

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

Download URL toni_cli-0.1.23-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29a94316b77af353e2662b2ddb8248fd65c41f8dd3a6945651a29e5918aa7a52
BLAKE2b-256 checksum
How to use checksums
32108656a9ddc16fdb80a0d62678b94b5eb092978ec90ac13945c79eebd029ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for toni-cli 0.1.23

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