A command-line interface for Airweave. Search across your connected sources from any terminal. Built for developers and AI agents.
pip install airweave-cliThis installs the airweave binary.
# Set your API key
export AIRWEAVE_API_KEY="your-api-key"
# Search a collection
airweave search "quarterly revenue figures" --collection finance-data
# List collections
airweave collections listThe CLI resolves credentials in this order:
AIRWEAVE_API_KEYenvironment variable~/.airweave/config.json(saved viaairweave auth login)
For interactive setup:
airweave auth loginThis prompts for your API key, validates it, and saves it locally.
Point the CLI at your own Airweave instance:
export AIRWEAVE_BASE_URL="https://airweave.internal.corp.com"Or set it during airweave auth login.
airweave search "<query>" --collection <id> --top-k 5 --format json| Flag | Short | Default | Description |
|---|---|---|---|
--collection |
-c |
$AIRWEAVE_COLLECTION |
Collection readable ID |
--top-k |
-k |
10 |
Number of results |
--format |
-f |
json |
Output format: json or text |
JSON output (default) writes pure JSON to stdout — nothing else. Pipe it:
airweave search "query" -c my-collection | jq '.results[0].md_content'airweave auth login # interactive setup
airweave auth status # show current auth state
airweave auth logout # clear saved credentialsairweave collections list # list all
airweave collections create --name "My Data" # create
airweave collections get my-data-x7k9m # get detailsairweave sources list --collection my-data # list source connections
airweave sources sync <source-connection-id> # trigger sync
airweave sources sync <id> --force # full re-syncThe CLI is designed for non-interactive use by AI agents. Every command:
- Outputs clean JSON to stdout (default)
- Sends all errors to stderr
- Uses correct exit codes (0 = success, 1 = error)
export AIRWEAVE_API_KEY="sk-..."
export AIRWEAVE_COLLECTION="my-knowledge-base"
export AIRWEAVE_BASE_URL="https://api.airweave.ai" # optional# Get the top result's content
airweave search "how to reset password" | jq -r '.results[0].md_content'
# Get the AI-generated answer
airweave search "what is our refund policy" | jq -r '.completion'
# List collection IDs
airweave collections list | jq -r '.[].readable_id'# GitHub Actions example
- name: Search Airweave
env:
AIRWEAVE_API_KEY: ${{ secrets.AIRWEAVE_API_KEY }}
AIRWEAVE_COLLECTION: docs
run: |
result=$(airweave search "deployment guide")
echo "$result" | jq '.results[:3]'No SDK imports, no MCP server, no config files — just an env var and a shell.
Config file location: ~/.airweave/config.json
{
"api_key": "sk-...",
"base_url": "https://api.airweave.ai",
"collection": "my-default-collection"
}Resolution order for all settings:
- CLI flag (e.g.
--collection) - Environment variable (e.g.
AIRWEAVE_COLLECTION) - Config file
- Default / error
git clone https://github.com/airweave-ai/cli.git
cd cli
poetry install
poetry run airweave --help