CLI
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
pip (recommended)
npm
From source
Verify the installation:
Authentication
Before using the CLI, authenticate with your Airweave account. There are two methods: browser-based login (OAuth) and API key.
Browser 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
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
Log out
Searching
The primary use case — search any collection from your terminal:
If you’ve set a default collection (via login or environment variable), you can omit --collection:
Piping results
When stdout is not a TTY (e.g. piped to another command), the CLI automatically outputs JSON:
You can also force JSON output in interactive mode:
Collections
List collections
Create a collection
Get collection details
Sources
List source connections
Add a source connection
Trigger a sync
Use --force for a full re-sync instead of incremental:
Global flags
These flags work with any command:
Configuration
The CLI resolves configuration in this order: CLI flags → environment variables → config file → defaults.
Environment variables
Config file
Stored at ~/.airweave/config.json:
Self-hosted instances
Point the CLI at your own Airweave deployment:
Or set the environment variable:
For custom Auth0 configurations, set these additional variables:
Output behavior
The CLI adapts its output based on context:
Errors always go to stderr. In JSON mode, errors are formatted as:
Exit codes: 0 for success, 1 for failure.