CLI

Search your Airweave collections, manage sources, and trigger syncs, all from the terminal.

The Airweave CLI lets you interact with your collections from the command line. It’s designed for both developers and AI agents: interactive mode gives you rich output with spinners and prompts, while piped or non-TTY mode outputs clean JSON for scripting.

Installation

Verify the installation:

$airweave --version

Authentication

Before using the CLI, authenticate with your Airweave account. There are two methods: browser-based login (OAuth) and API key.

Browser login

$airweave auth login

This opens a browser window where you sign in via Auth0. The CLI stores the access token and organization ID in ~/.airweave/config.json.

API key login

$airweave auth login --api-key

You’ll be prompted for your API key, base URL, and an optional default collection. The key is validated before being saved.

Check auth status

$airweave auth status

Log out

$airweave auth logout

Searching

The primary use case — search any collection from your terminal:

$airweave search "quarterly revenue figures" --collection finance-data
FlagShortDescription
--collection-cCollection readable ID to search
--top-k-kNumber of results to return (default: 10)

If you’ve set a default collection (via login or environment variable), you can omit --collection:

$airweave search "how does authentication work?"

Piping results

When stdout is not a TTY (e.g. piped to another command), the CLI automatically outputs JSON:

$airweave search "refund policy" | jq -r '.results[0].md_content'

You can also force JSON output in interactive mode:

$airweave search "deploy steps" --json | jq '.results[0]'

Collections

List collections

$airweave collections list

Create a collection

$airweave collections create --name "My Data" --readable-id my-data
FlagShortDescription
--name-nDisplay name for the collection (required)
--readable-id-rCustom readable ID (optional, auto-generated if omitted)

Get collection details

$airweave collections get my-data-x7k9m

Sources

List source connections

$airweave sources list --collection my-data

Add a source connection

$airweave sources add slack --collection my-data --name "Team Slack"
FlagShortDescription
--collection-cCollection readable ID
--name-nDisplay name for the connection
--credentialsJSON string with authentication credentials
--configJSON string with source-specific configuration
--sync / --no-syncWhether to trigger a sync after creation (default: sync)

Trigger a sync

$airweave sources sync <source-connection-id>

Use --force for a full re-sync instead of incremental:

$airweave sources sync <source-connection-id> --force

Global flags

These flags work with any command:

FlagShortDescription
--version-vPrint version and exit
--jsonForce JSON output
--quiet-qSuppress spinners and interactive output (implies --json)

Configuration

The CLI resolves configuration in this order: CLI flagsenvironment variablesconfig filedefaults.

Environment variables

VariableDescription
AIRWEAVE_API_KEYAPI key (overrides config file)
AIRWEAVE_BASE_URLAPI base URL (default: https://api.airweave.ai)
AIRWEAVE_COLLECTIONDefault collection readable ID

Config file

Stored at ~/.airweave/config.json:

1{
2 "api_key": "sk-...",
3 "base_url": "https://api.airweave.ai",
4 "collection": "my-default-collection"
5}

Self-hosted instances

Point the CLI at your own Airweave deployment:

$airweave auth login --api-key --base-url https://your-airweave-instance.com

Or set the environment variable:

$export AIRWEAVE_BASE_URL="https://your-airweave-instance.com"

For custom Auth0 configurations, set these additional variables:

VariableDescription
AIRWEAVE_AUTH0_DOMAINAuth0 domain for browser login
AIRWEAVE_AUTH0_CLIENT_IDAuth0 client ID
AIRWEAVE_AUTH0_AUDIENCEAuth0 audience

Output behavior

The CLI adapts its output based on context:

ContextBehavior
Interactive terminalRich output with colors, spinners, and tables
Piped or redirectedClean JSON on stdout
--json flagForces JSON output
--quiet flagSuppresses all interactive elements, implies --json

Errors always go to stderr. In JSON mode, errors are formatted as:

1{
2 "error": {
3 "message": "Collection not found",
4 "code": "not_found"
5 }
6}

Exit codes: 0 for success, 1 for failure.


Command reference

airweave [--version] [--json] [--quiet] <command>
Commands:
search Search a collection
auth Authentication management
login Authenticate (browser or API key)
status Print current auth state
logout Clear stored credentials
collections Collection management
list List all collections
create Create a new collection
get Get collection details
sources Source connection management
list List source connections
add Add a new source connection
sync Trigger a sync