The Most Powerful AI Interface Is a Pipe

Forget chat windows. Forget web apps. The most powerful way to use AI is one you already know: the Unix command line.

git diff --staged | onnai 'write a commit message'

That's it. That's the interface. And it changes everything.

The Unix Philosophy, Extended

For fifty years, Unix has operated on a simple principle: small tools that do one thing well, connected by pipes. grep finds patterns. sort orders lines. awk transforms text. Each tool is simple. Together, they're infinitely powerful.

An onnai command belongs in this family. Its job is simple: take text in, understand what you want, produce text out. It's sed with a brain.

tail -f /var/log/app.log | onnai 'alert me if something looks wrong'

The AI doesn't replace your existing tools. It amplifies them. kubectl is still the best way to get logs. The AI is the best way to understand them.

Why This Beats Chat Interfaces

When you use ChatGPT, you're context-switching. You leave your terminal. You copy text. You paste it into a browser. You copy the response. You paste it back. You've broken your flow.

When onnai is a command, your flow is unbroken:

cat api.py | onnai 'find the bug' | head -20

The data stays in the pipeline. The transformation happens in place. You never leave your environment.

Two Modes of Power

1. The Pipeline

In batch mode, AI becomes part of your automation:

# Generate commit messages
git diff --staged | onnai 'conventional commit message'

# Summarize logs
journalctl -u myapp --since '1 hour ago' | onnai 'what happened?'

# Translate config files
cat nginx.conf | onnai 'convert to Caddy format' > Caddyfile

# Analyze dependencies
pip freeze | onnai 'any security concerns here?'

The pattern is always the same: source data, pipe to AI with a prompt, capture the output. You can chain it, redirect it, background it, cron it. It's just Unix.

2. The Editor

This is where it gets magical.

In vim, you can filter any selection through an external command. Select a function, type !onnai 'add docstring', and Onnai rewrites your selection in place.

# Select a function, then:
:'<,'>!onnai 'write a Google-style docstring'

Your function is instantly documented. If you don't like it, press u to undo. Tweak the prompt. Try again. The feedback loop is measured in seconds.

This works for any transformation:

You're not leaving your editor. You're not breaking flow. The AI is just another text filter, like the dozens you already use.

Natural Language as a Scripting Language

Here's the profound shift: your prompt is the program.

Instead of writing a Python script to parse logs and extract patterns, you write:

cat error.log | onnai 'if you see a repeated pattern, summarize it'

The intent is expressed in English. The AI figures out the implementation. This doesn't replace scripting — sometimes you need precise, reproducible logic. But for ad-hoc analysis, exploration, and one-off tasks, natural language is faster.

You're no longer limited by what you can express in regex or awk syntax. You're limited only by what you can describe.

Context Is Everything

The power comes from context. When you pipe a git diff to Onnai, it sees exactly what changed. When you select a function in vim, it sees exactly that function. Onnai isn't working in a vacuum — it's working on your specific data, in your specific environment.

This is fundamentally different from asking ChatGPT "how do I write a commit message?" You're not asking for generic advice. You're saying "here's my actual diff, write this commit message." The output is immediately usable because the input was real.

The Philosophy

This approach embodies three principles:

Workflow integration. The tool meets you where you are. Terminal users stay in the terminal. Vim users stay in vim. No new interfaces to learn, no context switches to manage.

Amplification over replacement. You're still in control. You choose what to pipe. You review the output. You decide what to keep. The AI is a force multiplier, not an autopilot.

Intent-based computing. You express what you want, not how to do it. The gap between human thought and machine execution shrinks to a single pipe character.

Getting Started

Install Onnai in seconds:

curl -sSL onnai.ai/install | sh

That's it. Start piping:

# Morning routine
curl -s news.ycombinator.com | onnai 'summarize top 5 stories'

# Code review
git diff main..feature | onnai 'any concerns with this PR?'

# Learning
cat unfamiliar_code.rs | onnai 'explain what this does'

# Writing
cat draft.md | onnai 'tighten this up, remove fluff'

Want a shorter command? Create an alias:

ln -s $(which onnai) ~/bin/ai

Now cat file | ai 'prompt' works too.

The command line has always been about composing simple tools into powerful workflows. Onnai is just the newest tool in the kit — and maybe the most powerful one yet.

echo "Hello, world" | onnai 'make it dramatic'
"BEHOLD! From the void of silence, a greeting echoes across the digital cosmos: HELLO, WORLD!"

Yeah. This is going to be fun.