Skip to content

Latest commit

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

tty

Natural language to shell commands. Describe what you want, get a command instantly, confirm, run.

Usage

tty "find all rust files over 1MB"
> find . -name '*.rs' -size +1M [enter] run [esc] cancel

Examples

# file operations
tty "delete all .tmp files in this directory"
tty "rename all .jpeg files to .jpg"
tty "find the 10 largest files in this project"# git
tty "undo my last commit but keep the changes"
tty "show commits from this week that touched src/"
tty "diff what I have staged"# system
tty "what's using port 3000"
tty "how much disk space is left"
tty "kill all node processes"# data processing
tty "extract emails from log.txt"
tty "convert data.csv to json"
tty "count lines of code by file extension"# networking
tty "download this url and save as page.html"
tty "check if example.com is responding"

Research mode

For tasks that need context from your system, -r lets the model inspect your environment before suggesting a command (read-only, sandboxed):

tty -r "open my most recent pdf"
tty -r "which python package is biggest"
tty -r "what branch has the most recent commit"

Pipe mode

When piped, outputs just the raw command with no UI:

tty "list files"| sh
tty "find todo comments"| pbcopy

Flags

FlagDescription
--thinkExtended reasoning before suggesting a command
-r / --researchMulti-turn mode: inspects your system first
--show-reasoningDisplay the model's explanation
--debugShow timing diagnostics

Zsh integration

Add this to your .zshrc to translate natural language inline with Ctrl+G:

tty-widget() {
[[ -z"$BUFFER" ]] &&returnlocal result=$(tty "$BUFFER"2>/dev/null)if [[ -n"$result" ]];then
BUFFER="$result"
CURSOR=${#BUFFER}fi
zle redisplay
}
zle -N tty-widget
bindkey '^G' tty-widget

Type find all rust files on your command line, press Ctrl+G, and your input gets replaced with the actual command ready to review and run.

Setup

cargo install --path .

Either set an environment variable:

export GROQ_API_KEY="your-key-here"

Or generate a config file:

tty init
# edit ~/.config/tty/config.toml with your API key

Supports Groq and Ollama backends. Auto-detects your OS, shell, and installed tools (fd, rg, jq, etc.) to tailor suggestions to your environment.

Important

This is a proof of concept.

About

Natural language to shell commands

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages