@answer-engine/cli
v1.0.2
Published
CLI for Answer Engine - search, retrieve, and research content from the terminal
Maintainers
Readme
@answer-engine/cli
Terminal-native CLI for Answer Engine — search, retrieve, and research content from the command line.
Install
npm install -g @answer-engine/cliQuick Start
# 1. Save your API key
ae auth login
# 2. Search your content library
ae search "customer complaints about billing"
# 3. Get full details on a result
ae get <content-id>Authentication
The CLI needs an API key to connect to your Answer Engine instance.
# Interactive login — prompts for your API key
ae auth login
# Check connection and credit balance
ae auth status
# Or use environment variables instead
export ANSWER_ENGINE_API_KEY="ae_live_..."
export ANSWER_ENGINE_API_URL="http://localhost:5050"Creating an API key (local development)
If you're running the Answer Engine dev server locally:
ae auth create-key "My CLI Key" --devThis only works against localhost and requires the --dev flag for safety.
Configuration
Config is stored at ~/.config/answer-engine/config.yml with owner-only permissions (0600).
Resolution order: CLI flags > environment variables > config file
# View current config
ae config show
# Set the API URL
ae config set api_url https://your-instance.example.com
# Set default output format
ae config set default_output json| Config Key | Env Var | Default |
|---|---|---|
| api_key | ANSWER_ENGINE_API_KEY | (none) |
| api_url | ANSWER_ENGINE_API_URL | http://localhost:5050 |
| default_output | — | auto |
Commands
Search
Search your content library using fulltext, semantic, or hybrid search.
ae search <query> [options]| Option | Description | Default |
|---|---|---|
| -t, --type <type> | Search type: hybrid, fulltext, semantic | hybrid |
| -l, --limit <n> | Maximum results | 10 |
| --include <fields> | Fields to include (comma-separated: summary, content, tags, metadata) | summary,tags |
| --content-types <types> | Filter by content types (comma-separated) | — |
| --tags <tags> | Filter by tag slugs (comma-separated) | — |
Examples:
ae search "onboarding flow"
ae search "billing" -t semantic -l 5
ae search "bugs" --tags bug,urgent --content-types ticketCost: 1 credit per search
Get
Retrieve full content items by ID.
ae get <id> [id2...] [options]| Option | Description | Default |
|---|---|---|
| --include <fields> | Fields to include (comma-separated: summary, content, tags, metadata, children, analysis) | summary,content,tags,metadata,children |
Examples:
ae get 550e8400-e29b-41d4-a716-446655440000
ae get id1 id2 id3 --include content,metadataCost: 1 credit
Summarize
Use AI to summarize or analyze content from your library.
ae summarize <prompt> [options]| Option | Description | Default |
|---|---|---|
| -l, --limit <n> | Max items to analyze | 20 |
| --content-types <types> | Filter by content types | — |
| --tags <tags> | Filter by tag slugs | — |
Examples:
ae summarize "What are the top customer complaints?"
ae summarize "Key risks" --tags finance -l 50Cost: 10 credits
Scrape
Scrape a web page and save it to your content library.
ae scrape <url> [options]| Option | Description |
|---|---|
| --html | Include raw HTML in output |
Cost: 1 credit
Crawl
Crawl multiple pages from a domain.
ae crawl <domain> [options]| Option | Description | Default |
|---|---|---|
| -m, --max-pages <n> | Maximum pages to crawl | 10 |
Examples:
ae crawl example.com
ae crawl docs.example.com -m 50Cost: 1 credit per page
Web Search
Search the web and optionally scrape results.
ae web-search <query> [options]| Option | Description |
|---|---|
| -s, --site <domain> | Limit search to a specific site |
| --scrape | Also scrape full content from result URLs |
Examples:
ae web-search "competitor analysis"
ae web-search "API documentation" -s example.comCost: 1 credit
Tags
Browse and search your content tags.
ae tags list # List all tags grouped by category
ae tags search <query> # Search tags by nameSystem
ae status # API health check + credit balance
ae schema # Full content schema (types, tags, capabilities)Output Formats
The CLI auto-detects your terminal:
- Interactive (TTY): Colored, formatted tables
- Piped: Clean JSON for scripting
Force JSON output with the --json flag:
ae search "test" --json
ae search "test" | jq '.data.results[].title'Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | User error (invalid args) |
| 2 | API error (auth, credits, server) |
| 3 | Config error (no API key) |
License
MIT
