GitHub - benja/ask: Ask, then do. Follow up when you need to. · GitHub
/" data-turbo-transient="true" />
Skip to content
Search/
Sign in<br>Sign upAppearance settings
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
benja
ask
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star<br>60
main
BranchesTags
Go to file
CodeOpen more actions menu
Latest commit
History<br>17 Commits<br>17 Commits
Folders and files<br>NameNameLast commit message<br>Last commit date<br>.github/workflows
.github/workflows
assets
assets
src
src
tests
tests
.gitignore
.gitignore
Cargo.lock
Cargo.lock
Cargo.toml
Cargo.toml
LICENSE
LICENSE
README.md
README.md
install.sh
install.sh
View all files
Repository files navigation
A small CLI for asking AI questions from your terminal.
Motivation •<br>Install •<br>Usage •<br>How it works
Ask a question and get back to your shell:
$ ask how do i find TODO or FIXME comments in src<br>Use ripgrep:<br>rg -n 'TODO|FIXME' src
$ rg -n 'TODO|FIXME' src<br>src/generated/client.ts:18:// TODO: generated placeholder<br>src/generated/schema.ts:204:// FIXME: compatibility shim<br>src/api.ts:42:// TODO: retry failed requests
$ ask -c how do i exclude generated files<br>Add an exclude:<br>rg -n --glob '!generated/**' 'TODO|FIXME' src
$ rg ...
Or just run ask to start a session:
why is this container restarting?<br>Check its exit code:<br>docker inspect -f '{{.State.ExitCode}}' my-container
> it says 137. what does that mean?<br>Exit code 137 usually means SIGKILL, often from running out of memory.
> thank you<br>You're welcome.<br>> ^D
$ ...">$ ask<br>> why is this container restarting?<br>Check its exit code:<br>docker inspect -f '{{.State.ExitCode}}' my-container
> it says 137. what does that mean?<br>Exit code 137 usually means SIGKILL, often from running out of memory.
> thank you<br>You're welcome.<br>> ^D
$ ...
Every answer is saved. Use ask -c to continue the latest one in this folder.
Motivation
I made ask because I wanted a normal terminal command for asking AI questions, whichever agent or model I used. I didn't want a TUI. I wanted to ask something, read the answer, and get my shell back.
Coding agents do a lot in the background, and I don't always want that. With ask, the agent stays read-only. I run the commands and make the changes myself. That way I actually learn.
Install
curl -fsSL https://benja.dev/ask/install.sh | sh
The installer supports Intel/ARM Macs and x86_64/ARM64 Linux. It verifies the release checksum and installs to ~/.local/bin/ask. Set ASK_INSTALL_DIR to change the destination.
Usage
ask [QUESTION...] ask once<br>ask start a session<br>ask -c [QUESTION...] continue the latest session here<br>ask --sessions reopen a saved session<br>ask --settings set defaults for new sessions<br>ask --upgrade update ask<br>ask -V print the version
Answers go to stdout. Prompts and errors go to stderr, so one-shot answers are safe to pipe. Agents start in the current directory and run read-only.
ask checks for updates at most once a day. If a new version is available, it lets you know when you get your shell back. You won't get another notice for that version. Set ASK_NO_UPDATE_CHECK=1 to turn this off. ask only updates when you run ask --upgrade.
How it works
Under the hood, ask runs Codex, Claude Code, Pi, or OpenCode using the CLI already installed and logged in on your machine.
For a new session, ask uses your default agent, model, and reasoning. Continuing a session restores those saved choices and the underlying agent session ID. Answer instructions come from the current global setting. Ask starts the selected CLI read-only in your current folder, prints the answer to stdout, and saves the turn automatically.
Agents and models
Run ask --settings to choose the default agent, model, reasoning, and answer instructions. Use /settings inside a session to change that session's model or reasoning, or to edit the global answer instructions. Start a new session to switch agents.
Contributing
Requires Rust 1.88 or newer. Before opening a pull request:
cargo fmt --check<br>cargo test --locked<br>cargo clippy --locked --all-targets -- -D warnings
Installer changes also need shellcheck install.sh tests/install.sh and sh tests/install.sh.
License
MIT. Have fun :)
About<br>Ask, then do. Follow up when you need to.<br>benja.dev/ask<br>Resources<br>Readme<br>MIT license<br>Activity<br>Stars<br>60 stars<br>Watchers<br>0 watching<br>Forks<br>1 fork<br>Report repository
Releases
Contributors
Languages
You can’t perform that action at this time.