Start here

Getting started

Install the binary, set one environment variable, and say what you want. There is no project setup and no config file to write.

What you need

  • macOS or Linux, running bash or zsh. Windows and PowerShell are not supported yet.
  • Homebrew, or Go if you would rather build the binary yourself.
  • An ANTHROPIC_API_KEY, because smartly defaults to provider: anthropic. If you would rather use an existing Claude or ChatGPT subscription, or OpenAI, see Providers.

Install

brew install rizwanreza/tap/smartly

The macOS binaries are signed with an Apple Developer ID and notarized, so Gatekeeper lets them run with no extra steps.

Or build it yourself with Go:

go install github.com/rizwanreza/smartly-cli/cmd/smartly@latest

That puts a binary named smartly in your Go bin directory. If the command is not found afterwards, that directory is not on your PATH:

export PATH="$PATH:$(go env GOPATH)/bin"   # add to ~/.zshrc

Prebuilt binaries for macOS and Linux are also on the releases page.

Set your API key

Out of the box smartly needs only this. No config file is required.

export ANTHROPIC_API_KEY="sk-ant-..."   # add to ~/.zshrc

Your first command

Start with --dry-run, which prints the command and does nothing else:

smartly --dry-run show hidden files sorted by size
ls -lahS

Drop the flag when you want it to run:

smartly show hidden files sorted by size

Put a gate in front of it

If you would rather approve every command, switch execution mode once and forget about it:

smartly config init                              # writes a default config.yaml

Then set execution.mode in that file:

execution:
  mode: confirm

Now every request prints the command and waits for [y/N]. You can also force the prompt for a single call with --confirm, without changing any config. Both are covered in Execution and safety.

Next

  • Usage — how to phrase requests, and what smartly will and will not generate.
  • Shell integration — required if you want a generated cd or export to affect your shell.
  • Execution and safety — auto, confirm, dry-run, and what gets written to your history log.