ask README

The project's README from github.com/benja/ask. As one markdown file: README.md.

ask

A small CLI for asking AI questions from your terminal.

Motivation • Install • Usage • How it works

Ask a question and get back to your shell:

$ ask how do i find TODO or FIXME comments in src
Use ripgrep:
  rg -n 'TODO|FIXME' src

$ rg -n 'TODO|FIXME' src
src/generated/client.ts:18:// TODO: generated placeholder
src/generated/schema.ts:204:// FIXME: compatibility shim
src/api.ts:42:// TODO: retry failed requests

$ ask -c how do i exclude generated files
Add an exclude:
  rg -n --glob '!generated/**' 'TODO|FIXME' src

$ rg ...

Or just run ask to start a session:

$ ask
> why is this container restarting?
Check its exit code:
  docker inspect -f '{{.State.ExitCode}}' my-container

> it says 137. what does that mean?
Exit code 137 usually means SIGKILL, often from running out of memory.

> thank you
You're welcome.
> ^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
ask                        start a session
ask -c [QUESTION...]       continue the latest session here
ask --sessions             reopen a saved session
ask --settings             set defaults for new sessions
ask --upgrade              update ask
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
cargo test --locked
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 :)

ask (benja/ask)

Searching Database…

139 ·GitHub
Что это?Консольный CLI, позволяющий задавать вопросы ИИ и получать прямой ответ прямо в вашем шелле; работает на основе Codex, Claude Code, Pi или OpenCode.
У него собственный ИИ-движок или это обёртка над другими инструментами?Это тонкая обёртка, а не самостоятельный ИИ-движок — он запускает в режиме только для чтения тот CLI кодинг-агента, который у вас уже установлен.
Как его запустить?Запустите скрипт установки, который определит вашу платформу и установит бинарник в ~/.local/bin/ask; затем просто выполните 'ask', чтобы начать сессию, или 'ask -c', чтобы продолжить последнюю.
Нужно ли сначала настроить ИИ-подписку или API-ключ?Нужен уже установленный и залогиненный CLI одного из инструментов — Codex, Claude Code, Pi или OpenCode; сам ask не имеет собственного доступа к моделям.
Может ли ask на самом деле править мой код или запускать команды за меня?Нет — агент всегда остаётся в режиме только для чтения: он читает проект и отвечает, а команды выполняете и изменения вносите вы.
Поддерживает ли установщик Windows?Нет — установщик покрывает только Intel/ARM Mac и x86_64/ARM64 Linux, сборки для Windows нет.
Как продолжить предыдущий разговор?Выполните 'ask -c', чтобы продолжить последнюю сохранённую сессию в текущей папке — с восстановлением того же агента, модели и режима рассуждения, что использовались раньше.
Могу ли я выбрать, какого агента или модель он использует?Да — выполните 'ask --settings', чтобы задать агента, модель и reasoning по умолчанию, или используйте '/settings' внутри сессии, чтобы сменить модель этой сессии.
Он обновляется автоматически?Он раз в день проверяет наличие новой версии и сообщает, когда она доступна, но реально обновляется только по команде 'ask --upgrade'; проверку можно отключить переменной ASK_NO_UPDATE_CHECK=1.
Почему автор сделал это вместо простого использования TUI-агента?Он хотел обычную терминальную команду, которая отвечает на вопрос и сразу возвращает шелл, без фоновых изменений со стороны агента, чтобы команды по-прежнему выполнять самому и учиться.
Creator
benja
Size
0.1 MB
Stars
139
Age
1mo
Commits · 90 Days