Skip to main content

ask

AI CLI tool for natural language interaction with LLMs.

Installation

Using Homebrew (macOS)

First, add and trust the tap:

brew tap nimahejazi/tap
brew install nh-ask-cli
brew upgrade nh-ask-cli

Note: You may need to run brew trust nimahejazi/tap if Homebrew requires verification.

From Source

Requires Python 3.9 or later.

git clone https://github.com/nimahejazi/ask.git
cd ask
pip install -e .

Usage

# Interactive chat mode
ask --it

# Quick query
ask "What is the capital of France?"

# Command mode (extract only executable commands)
ask -c "List files in current directory"

# With tools
ask -t ./tools.sh "Do something with tools"

# Notes-only mode (answer strictly from your personal notes)
ask -n "what's six sigma DMIAC?"

# Skip notes for this query
ask -N "What is the capital of France?"

# Notes
ask notes                       # interactive browser (list, view, edit, delete)
ask notes add "Deploy Checklist\nrun kubectl first #ops"
ask notes list [--tag ops]
ask notes show deploy-checklist
ask notes edit deploy-checklist      # opens $EDITOR
ask notes delete deploy-checklist
ask notes search "kubectl rollout"
ask notes reindex

Notes

ask keeps personal notes (~/.ask-notes/*.md, plain markdown — title is the first line, inline #tags allowed anywhere) and consults them when answering questions:

  • Default on: every query gets search_notes / read_note / save_note tools, so the assistant can look up a relevant note, cite it as [note: Title](file://path), and save new notes when you ask it to. Use -N/--no-notes to skip notes for a query, or -n/--notes-only to answer strictly from notes (no general knowledge). AI cannot delete notes — use ask notes delete. Read-only note tools run without confirmation; save_note still asks.
  • Semantic search: notes are embedded with your provider's embedding endpoint (ollama: nomic-embed-text — offered at setup; ChatGPT: text-embedding-3-small; LM Studio: its loaded embedding model). Providers without embeddings (Anthropic, Mock) fall back to keyword search automatically.
  • Files are the source of truth: edit ~/.ask-notes/*.md by hand anytime; the index rebuilds lazily (or force one with ask notes reindex).

Configuration

Run ask once to configure your preferred LLM provider (Mock, Ollama, LM Studio, Anthropic, or ChatGPT).

API Keys and Environment Variables

For Anthropic and ChatGPT providers, you can set your API key either in the config file (via ask interactive setup) or via environment variables. Environment variables are read without writing to the config file:

  • ANTHROPIC_API_KEY — for Anthropic
  • OPENAI_API_KEY — for ChatGPT (OpenAI-compatible)

Precedence: a key stored in ~/.askrc takes precedence over the environment variable. If no key is stored in config, the environment variable is used. ask --show-config indicates whether a key is set without ever printing its value, and key entry is masked (no echo) in the terminal.

Release files for nh-ask-cli 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nh-ask-cli 0.5.1
File Size Uploaded
nh_ask_cli-0.5.1.tar.gz 42.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nh-ask-cli 0.5.1
File Interpreter ABI Platform
nh_ask_cli-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size:73.3 kB

Release files / nh_ask_cli-0.5.1.tar.gz

Download URL nh_ask_cli-0.5.1.tar.gz
Size 42.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bf1238a89c89e35b2da439032b249b0ee042c6ae8eea92cbea8de8e168032a43
BLAKE2b-256 checksum
How to use checksums
ca8cda1d55ca318eb4fe069251f5627f8ceb57f790b14dbf982eb97f69f7628a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / nh_ask_cli-0.5.1-py3-none-any.whl

Download URL nh_ask_cli-0.5.1-py3-none-any.whl
Size 31.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1a8a757123f3b2ce919d498fa18b87fbf909eed502839cbac4f9a6accb1d97b5
BLAKE2b-256 checksum
How to use checksums
54a8e59b60805453f6ddc230483552870a047f281a925217b9bd674cc8fa3161
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.2.15

2 release files

0.2.12

2 release files

0.2.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page