翻篇收录说明
翻篇网页快照

Keenable CLI - Keenable

https://docs.keenable.ai/cli

最近抓取:2026-12-03 23:15:33(北京时间)

最近内容变化:2026-12-03 23:15:33(北京时间)

这是最近一次有效抓取的文本快照,不含网页脚本、图片和动态交互内容。实际网页可能已更新。

访问原网页

页面简介

Install the Keenable CLI, sign in once, add Keenable to Claude Code, Cursor and Codex over MCP, and search, fetch and run monitors from the terminal.

正文摘录

With keenable-cli, you search the web, fetch pages, run monitors and add Keenable to your AI clients, all from the terminal. The CLI ships as a single binary. Search and fetch work without an account. Monitors needs an API key. To use your key, run keenable login once. The CLI saves it and reuses it for every command. See Rate limits for the limits with and without a key. Installation Install the CLI with one of these methods: HomebrewmacOS / LinuxPowerShellSourcebrew install keenableai/tap/keenable-cli The macOS and Linux installer downloads a .tar.xz archive, so the machine needs xz (the xz-utils package on Debian and Ubuntu, xz on Fedora and Alpine). On a minimal image or container where xz is missing, the installer fails while it unpacks the archive. Install xz and run it again, or use Homebrew or cargo install instead. Run keenable --version to check the install. It prints the installed version. Shell completions keenable completion <shell> prints a completion script for bash, zsh, fish, PowerShell or elvish. Once your shell loads it, Tab completes the CLI’s subcommands and flags. It needs CLI 0.11.0 or later, and no login or network. Run keenable --version to check your version, and see Updating. Load the script each time the shell starts, or save it once. A saved script loads faster, but lists only the commands and flags of the version that wrote it, so save it again after keenable update. bashzshfishPowerShellelvish# Load at startup: add this line to ~/.bashrc eval "$(keenable completion bash)" # Or save it once (needs the bash-completion package) mkdir -p ~/.local/share/bash-completion/completions keenable completion bash > ~/.local/share/bash-completion/completions/keenable To check it works, start a new shell, type keenable sear and press Tab. The shell completes it to keenable search. Hidden flags, such as the deprecated --live, aren’t offered. Man pages Read the CLI’s reference offline with man. Man pages need CLI 0.11.0 or later: the release archives of 0.11.0 and later include them, earlier archives don’t. Each archive on the releases page has them in man/man1, next to the binary. You get keenable.1 and subcommand pages such as keenable-search.1, keenable-monitors-create.1 and keenable-config-set.1. They come from the same definitions as --help. keenable help has no page. In an unpacked archive, open a page by its name with an absolute -M path, or by its absolute file path: man -M "$PWD/man" keenable-search man "$PWD/man/man1/keenable-search.1" You see the keenable-search page with its synopsis and options. To read the pages from anywhere with man keenable-search, add the archive’s man folder to MANPATH, or copy man/man1/*.1 into a man1 folder that man already searches. The installer scripts install only the binary, not the man pages. Homebrew keeps the archive’s man pages in $(brew --prefix)/share/keenable-cli/man. Read them with man -M "$(brew --prefix)/share/keenable-cli/man" keenable. Quick start These commands sign you in, add Keenable to your AI clients and run a search: # Log in with your Keenable account keenable login # Configure MCP for your AI clients (Claude Code, Cursor, etc.) keenable configure-mcp --all # Search the web keenable search "rust async patterns" -p configure-mcp --all shows what it will change and asks you to confirm. The search prints ranked results with titles, URLs and excerpts. Authentication keenable login signs you in with a device code. The CLI prints a code and a link, and tries to open the link in your browser. On a remote machine, open the link in any browser and enter the code. After you approve, the CLI saves an API key to ~/.keenable/config.json. On a server or in CI, save an API key instead: # Device-code login (opens browser) keenable login # Save an API key from stdin (CI, servers) printenv KEENABLE_API_KEY | keenable login --api-key - # Save an API key given as an argument keenable login --api-key <KEY> # Clear stored credentials keenable logout keenable login --api-key checks the key with the API before it saves the key. If the API rejects the key, the CLI doesn’t save it and exits with code 1. Prefer --api-key -, which reads the key from stdin. A key passed as an argument shows up in your shell history and in the process list that other users on the machine can see. Log in from an agent in two steps An agent that can’t keep one command running while a person approves can split the login in two. The two-step login needs CLI 0.10.0 or later. The first command prints the link and the code as JSON and exits: keenable login --non-interactive You get one line of JSON on stdout: {"browser_url":"https://app.keenable.ai/link?code=ABCD-EFGH","verification_code":"ABCD-EFGH","expires_in":600,"interval":5,"next_step":["keenable","login","--complete","<DEVICE_CODE>","--interval","5","--expires-at","<UNIX_TIME>"]} The command doesn’t open a browser or wait. Show the person browser_url and verification_code. The device code appears only in next_step, never on stderr: it redeems the key once the person approves, and stderr often ends up in shared logs. The hint on stderr points at next_step. Then run next_step as an argument list, not through a shell: keenable login --complete <DEVICE_CODE> --interval 5 --expires-at <UNIX_TIME> It polls every --interval seconds until --expires-at, a time in Unix seconds. Without them, it polls every 5 seconds for up to 10 minutes. To keep the device code out of the process list, pass - in its place and pipe the code in: printf '%s\n' "$DEVICE_CODE" | keenable login --complete - --interval 5 --expires-at <UNIX_TIME> After the approval, it saves the API key the same way keenable login does and prints {"ok":true}. When the API sends the new key’s org_id, key_id and label, the JSON has them too, but never the key itself: {"ok":true,"org_id":"...","key_id":"...","label":"..."} The device code is valid for expires_in seconds and works once. For a code that expired, run keenable login --non-interactive again. A code that was already used has already issued a key: if that run saved it, use it. If you lost it, revoke it in the console before you start a new login. When a step fails after the CLI has parsed its arguments, it prints a JSON error on stdout and an error: … line on stderr. The JSON has error and hint, plus message, type, code, fix and docs_url when there are any. When the API refuses the code request, message gives its reason. Exit codes: 1: the code expired, was denied, was already used or is invalid, the wait ran out, or a local error such as a config file that can’t be written. For an expired code, run keenable login --non-interactive for a new one. For a denied code, ask the person before you request a new one. For an already-used code, see above. 7: a network error. Check the network, then run the same command again. A device code that --complete was waiting on is still valid until it expires. 9: from --complete, Keenable’s login service kept failing. The device code is still valid, so run the same command again later, before the code expires. When the API refuses the code request, --non-interactive exits with the exit codes of search and fetch, such as 4 when rate limited, or 6 when the endpoint isn’t found because KEENABLE_API_URL has a wrong path. --non-interactive, --complete and --api-key don’t work together: combining them is a usage error with exit code 2. A usage error prints no JSON: read the message on stderr. Plain keenable login waits for the approval in one command, unless KEENABLE_NON_INTERACTIVE=1 is set, which makes it run as keenable login --non-interactive. When stdin isn’t a terminal, it prints a hint about the two-step login on stderr. The CLI keeps the key in ~/.keenable/config.json, readable only by you. keenable configure-mcp also writes the key into each client’s MCP config. keenable logout removes the saved key for the current base URL and lists the clients that still hold one. To remove it from them too, run keenable reset --all. To use a key without saving it, set KEENABLE_API_KEY or pass --api-key to keenable search or keenable fetch. The flag overrides the variable, and both override the saved key. Check your login keenable status shows which account the CLI calls the API as: where the key comes from, the user and organization it belongs to, and your organization’s balance. It needs CLI 0.9.0 or later. # Account, key and balance (for people) keenable status # The same as one line of JSON (for scripts and agents) keenable status --json The report goes to stdout, so keenable status > status.txt keeps it. The header, warnings and hints go to stderr: 👀 keenable status ✓ Logged in to Example Inc as dev@example.com Key: keen_…wxyz (from ~/.keenable/config.json) Balance: $12.34 (https://keenable.ai/console) API: https://api.keenable.ai Default mode: not set (the server's default applies) With --json, the CLI prints the same facts on stdout: {"authenticated":true,"key_source":"config","key":"keen_…wxyz","api_url":"https://api.keenable.ai","user":{"email":"dev@example.com","display_name":"Ada Lovelace"},"org":{"id":"...","name":"Example Inc"},"balance":{"available":"12.34","currency":"usd"},"billing_url":"https://keenable.ai/console","default_search_mode":null,"forced_search_mode":null,"cli_version":"..."} The CLI reads the user and organization from GET /v1/auth/user and the balance from GET /v1/billing. Both calls are free. balance.available is the API’s exact amount_decimal string. default_search_mode and forced_search_mode are the search mode settings, or null when they aren’t set. A forced mode wins over --mode on every search, and the text output says so. The key is never printed in full. The CLI shows its keen_ prefix and its last 4 characters. key_source says where the key comes from: key_sourceWhere the key comes fromflag--api-keyenvKEENABLE_API_KEYconfigThe key keenable login savednullNo key Without a key, keenable status doesn’t call the Keenable API. It prints "authenticated":false and "tier":