

cfor
(command for) is an AI-powered terminal assistant that helps you find and
execute commands without digging through man pages. Simply ask what you want to
do in natural language, and cfor
will suggest relevant commands with brief
explanations.
The name reflects its usage pattern: cfor [what you want to do]
is like asking
“what’s the command for [task]?” – making it intuitive to use for finding the
right commands for your tasks.
- Natural Language Queries: Ask for commands in plain English
- Smart Command Suggestions: Get multiple command variations with inline comments
- Interactive Selection: Choose the right command from a list of suggestions
- Terminal Integration: Selected commands are automatically inserted into your terminal prompt
- OpenAI Integration: Powered by OpenAI’s language models (supports multiple models)
brew install cowboy-bebug/tap/cfor
Requirements:
- Go 1.24 or later
git clone https://github.com/cowboy-bebug/cfor.git && cd cfor
make install
cfor [question]
cfor "listing directories with timestamps"
cfor "installing a new package for a pnpm workspace"
cfor "applying terraform changes to a specific resource"
cfor "running tests in a go project"
cfor
requires an OpenAI API key to function. You can set it up in one of two
ways:
# Use a general OpenAI API key
export OPENAI_API_KEY="sk-..."
# Or use a dedicated key for cfor (takes precedence)
export CFOR_OPENAI_API_KEY="sk-..."
By default, cfor
uses gpt-4o
. You can switch to other supported models:
export CFOR_OPENAI_MODEL="gpt-4o"
make build # Build the binary
make install # Install to your GOPATH
make clean # Clean build artifacts
- Linux (amd64, arm64)
- macOS (amd64, arm64)
Contributions are welcome! Feel free to open issues or submit pull requests.
MIT

Leave a Reply