Tell your shell
what you mean.

You know what. Smartly knows how.

smartly sends one plain English sentence to an LLM, sanitizes the reply into a single shell command, and runs it. For people who know what they want to do and would rather not remember the exact flags.

Install

brew install rizwanreza/tap/smartly

The transform

Say the outcome. Get the command.

smartly

smartly show hidden files sorted by size

ls -lahS

The flags you always have to look up. Simple requests stay simple.

smartly what changed in this repo in the last week

git log --oneline --since='1 week ago'

One command line. Never a multi-step script.

smartly kill whatever is listening on port 3000

kill $(lsof -ti :3000)

Under confirm-destructive, this one stops and asks first.

smartly delete all my branches that are already merged into main

git branch --merged main | grep -vE '^\*| main$' | xargs git branch -d

Resolved against the branches that actually exist here.

smartly replace api.example.com with api.internal in every yaml file

find . -name '*.y*ml' -exec sed -i '' 's/api\.example\.com/api.internal/g' {} +

BSD sed on macOS. On Linux the same request generates sed -i.

Auto-run is the default, so the second line is what actually ran. How to put a gate in front of it.

What it does

Commands without the ceremony.

english → command

One sentence in, one command out

Describe the result. smartly returns a single executable shell command — pipes, && and redirects allowed, multi-step scripts never.

macos + linux

Knows which userland it is on

It accounts for GNU versus BSD differences, so the same request produces sed -i '' on macOS and sed -i on Linux.

dir + git

Reads the room

By default it sends a capped directory listing plus your git branch, status and worktrees, so “all worktrees except main” resolves against what is actually there.

four providers

Your model, your billing

Anthropic and OpenAI by API key, or your own logged-in claude / codex CLI session if you already pay for a subscription.

auto · confirm · dry-run

Three ways to run it

Run immediately, ask [y/N] first, or print the command and do nothing. auto is the default.

Before you install it

Auto-run is the default.

smartly generates a command and runs it immediately, with no confirmation prompt — including when that command is destructive. There is no blocklist and no danger detector. Its sanitizer enforces that the model returned exactly one clean command line; it makes no judgement about what that line does.

That is the product working as intended, and it is the setting most worth reconsidering on a machine where a wrong rm costs you something. Two ways to change it:

Read the full execution and safety page

confirm Ask me every time

Prints the command and waits for [y/N]. Reads/dev/tty directly, and fails closed when there is no terminal.

# ~/.config/smartly/config.yaml
execution:
  mode: confirm

--dry-run Just show me

Prints the command and does nothing else. The right flag for a phrasing you are not sure about yet.

smartly --dry-run remove every merged branch

Providers

Four backends. Two ways to pay for them.

Two providers call an API with a key. Two shell out to a CLI you are already logged into — slower, but no second bill.

ProviderAuthenticationWorth knowing
anthropicANTHROPIC_API_KEYThe default. Nothing to configure beyond the key.
openaiOPENAI_API_KEYShips no default model — set providers.openai.model yourself.
claude-cliYour logged-in claude sessionNo tool access at all. Model is required in config.
codex-cliYour logged-in codex sessionRuns --sandbox read-only, but is still agentic while composing.

Provider setup and tradeoffs →

Describe the result.
Skip the flag archaeology.

brew install rizwanreza/tap/smartly