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.
Commands
keenable --help lists these commands. keenable <command> --help shows each oneâs flags and examples.
Installation
Install the CLI with one of these methods:$CARGO_HOME/bin, usually ~/.cargo/bin. If your shell canât find keenable after the install, add that folder to your PATH. From CLI 0.6.1, the macOS and Linux archives are .tar.gz, so the installer doesnât need xz.
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.
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 withman. 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:
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: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:
keenable login --api-key checks the key with the API before it saves the key. If the API rejects the key with 401 or 403, the CLI doesnât save it and exits with code 1. If the check gets no answer, or another error, the CLI prints Could not verify API key (network error) â saving anyway and saves the key. An empty key is refused with exit code 1: the CLI sends no request and keeps the key you saved before.
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. If stdin is a terminal, --api-key - asks for the key and doesnât show what you type.
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: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:
--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:
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:
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, runkeenable login --non-interactivefor 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--completewas 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-interactiveexits with the exit codes of search and fetch, such as4when rate limited, or6when the endpoint isnât found becauseKEENABLE_API_URLhas 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.
To make step 1 the default in an agentâs environment, export KEENABLE_NON_INTERACTIVE once:
keenable login then prints the same line of JSON as keenable login --non-interactive and exits. keenable login --api-key and keenable login --complete ignore the variable. It takes the same values as KEENABLE_YES. KEENABLE_NON_INTERACTIVE needs CLI 0.10.0 or later.
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 stops the CLIâs background daemon and removes the saved key for the current base URL. It names the keys it kept for other base URLs, and lists the clients that still hold a key. To remove the key from those clients too, run keenable reset --all.
To use a key without saving it, set KEENABLE_API_KEY or pass --api-key to keenable search, fetch, monitors or status. The flag overrides the variable, and both override the saved key. An empty --api-key value fails with Empty API key and exit code 1, so a script with an unset variable never falls back to the saved key or to keyless calls. An empty KEENABLE_API_KEY prints warning: KEENABLE_API_KEY is set but empty; ignoring it. on stderr, and the command runs as if the variable werenât set.
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.
keenable status > status.txt keeps it. The header, warnings and hints go to stderr:
--json, the CLI prints the same facts on stdout:
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:
Without a key,
keenable status doesnât call the Keenable API, and exits with code 0. The text output prints Not logged in â search and fetch use the free tier and a keenable login hint on stderr, and the API: and Default mode: lines on stdout. With --json, it prints "authenticated":false and "tier":"keyless". If keys are saved only for other base URLs, it prints "authenticated":false and lists those base URLs in key_saved_for. The CLI never sends those keys to the current base URL.
If the API rejects the key, the command prints the error like keenable search does and exits with code 3. If the error text contains the key, the CLI masks it first. If the base URL answers without an organization, it isnât the Keenable API: the command exits with code 1. If the config file canât be read or isnât valid JSON, the command says so and exits with code 1 instead of reporting no key. If the request fails before the API answers, it exits with code 7. See Errors. If only the balance canât be read, balance is null, a warning goes to stderr, and the command exits with code 0.
MCP setup
These commands show which AI clients have Keenable configured, add it to them or remove it:configure-mcp and reset take the same client flags. --all selects every client the CLI detects on the machine:
~ is your home directory, %USERPROFILE% on Windows. If KEENABLE_HOME is set, the CLI uses that directory instead, for these files and for its own ~/.keenable folder. A client counts as detected when the folder that holds its file exists. Claude Code counts when ~/.claude or ~/.claude.json exists. On Windows, --devin writes %USERPROFILE%\.config\devin\mcp_config.json, but Devin Desktop reads %APPDATA%\devin\mcp_config.json. Copy the keenable entry to that file by hand.
A client flag for a client that isnât detected prints a warning, such as Cursor is not installed, and the command skips that client. If no selected client is left, configure-mcp prints No matching clients found to configure and exits with code 1. reset prints No clients with Keenable MCP configuration found to reset. and exits with code 0. reset --all selects only the clients that have Keenable configured.
configure-mcp adds a keenable entry that points at https://api.keenable.ai/mcp. The entry carries the API key saved for https://api.keenable.ai in the X-API-Key header. Your clients call production, so configure-mcp ignores KEENABLE_API_KEY, KEENABLE_API_URL and keys saved for other base URLs. It checks the saved key against https://api.keenable.ai before it writes:
- If the API rejects the key, the entry gets no key, and the CLI says to run
keenable login. - If the check fails on the network, the entry keeps the key.
- If no key is saved, the entry gets no key. Running
configure-mcpagain then removes a key that an earlier run wrote.
https://api.keenable.ai/mcp-public, instead, because /mcp publishes OAuth discovery, which can make Codex start a browser sign-in. To add your key later, run keenable login, then configure-mcp again.
configure-mcp also turns off the clientâs own web search, so the agent uses Keenable:
- In Claude Code, it adds
WebSearchandWebFetchtopermissions.denyin~/.claude/settings.json. Claude Code reads denies only from that file, so the CLI removes the denies an older version wrote to~/.claude.json. It also removes both tools from the allow lists in~/.claude.json,~/.claude/settings.jsonand the project.claude/settings.local.jsonfiles it finds. It looks in your home directory and its direct subfolders, and up to three levels deep under~/dev,~/projects,~/src,~/repos,~/workand~/code. It skips hidden folders,node_modules,targetandvendor. - In OpenCode, it sets
permission.websearchtodeny.
configure-mcp also removes entries under other names that point at api.keenable.ai or api-test.keenable.ai. It replaces a keenable entry that runs npx mcp-remote with a direct HTTP entry, which needs no Node.js. It warns about other search MCP servers whose names contain brave-search, tavily, bing, exa, perplexity, serper, firecrawl or browserbase, and leaves them in place.
To keep the clientâs own web search, pass --keep-builtin-tools. The CLI then adds the keenable entry and leaves the deny lists and allow lists alone. keenable configure-mcp with no flags and keenable doctor show Built-in search tools kept on for that client instead of a problem. keenable doctor --json adds "builtin_tools_kept": true to that client in clients. reset leaves any deny you set yourself.
keenable reset removes the keenable entry and turns those tools back on. It also puts back the WebSearch and WebFetch allow entries that configure-mcp removed and recorded, in ~/.claude.json, ~/.claude/settings.json and project .claude/settings.local.json files. An older configure-mcp recorded none, so restore entries it removed from a backup or by hand. If a file it removed them from is gone, reset skips it and prints a warning. If the file canât be read or isnât valid JSON, reset exits with code 1; fix the file and run the same command again, such as keenable reset --claude-code. That run puts the entries back even when the keenable entry is already gone. reset doesnât restore MCP entries that configure-mcp replaced or removed as duplicates. For Codex and Cursor, and for a routing rule, see Make Keenable the default web tool.
In Claude Code, reset removes only the denies that configure-mcp recorded as its own, in managed_deny_tools in ~/.keenable/config.json, and any denies left in ~/.claude.json. Without that record, which an older CLI didnât write, it removes both WebSearch and WebFetch. In OpenCode, it leaves the websearch deny alone if the deny was there before configure-mcp ran. For Codex, it also deletes the files in ~/.codex/cache/codex_apps_tools that mention Keenable.
From CLI 0.12.0, before it changes anything, configure-mcp lists each client and the files it writes. It names up to ten project .claude/settings.local.json files whose allow list it changes, then counts the rest (and 3 more); it changes all of them. It prints the list with --yes too. Without --yes, it then asks Make the changes above?. A project settings file that canât be read or isnât valid JSON is named in the list and left alone. If a write fails, for example to ~/.claude/settings.json, or a project settings file canât be read, it prints Some clients could not be configured and exits with code 1. Older versions can exit with 0 when ~/.claude/settings.json canât be written.
configure-mcp and reset add one line to ~/.keenable/changes.jsonl for each file they change. Each line has unix_time, command, client, file and changes. Each change has an op (add, remove or set) and a key such as permissions.deny, and, where it applies, a value and a previous value. A removed list item has only value, such as {"op":"remove","key":"permissions.allow","value":"WebFetch"}. The log names MCP entries, such as mcpServers.keenable, without their contents, so your API key never goes in it. Logging is best effort: the CLI writes the client file first, and if it canât add the line, it prints a warning and the command still succeeds. A failed write to a client file is an error.
configure-mcp and reset ask you to confirm before they write. Without client flags they only show status and never ask. If stdin isnât a terminal, they exit with code 1 unless you pass --yes (-y) or set KEENABLE_YES=1. From CLI 0.12.0, the hint then says to confirm the listed changes with the user before running the command again with --yes. configure-mcp also skips the question if you chose Proceed and donât ask again at its prompt; reset always asks. The CLI saves that choice as skip_setup_confirmation in ~/.keenable/config.json. From CLI 0.12.0, keenable config shows it, and keenable config unset skip_setup_confirmation brings the question back. The CLI prints that command when you choose Proceed and donât ask again. With an older version, delete the key from the file by hand.
From CLI 0.12.0, inside Claude Code, a run that would change Claude Codeâs own tool permissions ignores KEENABLE_YES and the saved choice. Answer the prompt, or pass --yes on the command line, which a run without a terminal needs. For configure-mcp, thatâs a run that would add a deny or remove an allow entry, or that canât tell because a permission or project settings file canât be read. For reset, itâs a run that would remove a deny or put an allow entry back. reset lists those changes by file before it asks, and with --yes too. The CLI only checks that --yes is on the command line. Whether Claude Code shows you the command before it runs depends on its permission settings, so an agent should ask you before it passes --yes.
The change list, the log, --keep-builtin-tools and restoring allow entries need CLI 0.12.0 or later.
For an agent with no MCP client, install the CLIâs agent skills, or the keyless agent skill.
Skip the confirmation prompt
--yes (-y) skips the confirmation prompt of one command. To skip it for every command of a CI job or an agentâs environment, export KEENABLE_YES once:
KEENABLE_YES does what --yes does for configure-mcp, reset and keenable setup skills. It applies in a terminal too, so set it only where nobody should be asked. From CLI 0.12.0, it doesnât count inside Claude Code for a configure-mcp or reset run that changes Claude Codeâs own tool permissions (see above), or for setup skills installing into Claude Code (see Agent skills). Answer the prompt there, or pass --yes.
From CLI 0.12.0, KEENABLE_YES doesnât skip the prompt of keenable monitors delete: only --yes on the command line does, because a delete canât be undone. CLI 0.10.0 to 0.11.x accept KEENABLE_YES there too.
The CLI ignores spaces around the value and its case. 1, true, yes and on turn the variable on. Unset, empty, 0, false, no and off leave it off. Any other value also leaves it off, and the CLI prints a warning on stderr, such as warning: ignoring KEENABLE_YES="maybe": set it to 1, true, yes or on to turn it on. The CLI reads the variable only where a prompt would follow, so a status run or a command with --yes never warns about it.
KEENABLE_YES needs CLI 0.10.0 or later.
Agent skills
From CLI 0.12.0, the CLI installs five agent skills that teach coding agents to search and read the web withkeenable search and keenable fetch:
The skills are built into the CLI, so the installed skills match the installed CLI version:
--agent, setup skills installs for every agent whose folder exists on the machine. If CLAUDE_CONFIG_DIR is an absolute path, Claude Codeâs folder and its user skills folder move with it. An absolute XDG_CONFIG_HOME moves the OpenCode and Devin folders the same way. Neither applies when KEENABLE_HOME is set, and --project folders stay as listed:
setup skills lists each folder it writes, then asks you to confirm. If there are changes to apply and it isnât a dry run, it needs a terminal on stdin and stderr for the question. Without one, it exits with code 1 unless you pass --yes (-y) or set KEENABLE_YES=1. The skills pre-approve the read-only keenable search and keenable fetch commands in Claude Code (allowed-tools). The keenable skill also pre-approves keenable status, keenable doctor and keenable --version. So inside Claude Code, installing into Claude Code ignores KEENABLE_YES: answer the prompt, or pass --yes on the command line. An agent should ask you before it passes --yes.
If a skill folder exists that setup skills didnât install, for example one from npx skills add, the command leaves it alone. Pass --force to replace it: the command then takes over the skillâs file paths in that folder. It overwrites them, or keeps a file whose content already matches, and replaces a link at one of those paths with a plain file without changing what the link pointed to. Other files in the folder are kept.
The command never writes or deletes through a link at or inside a skill folder. It leaves alone a link inside a skill folder it installed, and a folder that now resolves to another place than where it was installed. The skills folder itself, such as ~/.claude/skills, can be a link: the command follows it, and the plan shows where it leads, so check that destination before you confirm.
The command records each skill file path it owns in ~/.keenable/config.json, and adds a line to ~/.keenable/changes.jsonl for each folder whose files it changes. --remove deletes the recorded paths, including a recorded file you edited, and keeps files at other paths. After keenable update, run your install command again, with the same --agent and --project options, from the same project folder for a project install. Skills that are already up to date arenât rewritten.
keenable setup also lists each project the command installed into, and whether those skills are up to date. keenable docs skills opens this section.
Start a new agent session after you install, so the agent loads the skills. keenable setup mcp is the same command as keenable configure-mcp, with the same flags.
To install the same skills without the CLIâs installer, run npx skills add keenableai/keenable-cli. The skillsâ source is the skills folder of the CLI repository.
Verify the setup
configure-mcp --verify runs one search from the CLI against https://api.keenable.ai, the API your client configs point at, with the key your clients hold. It needs CLI 0.11.0 or later.
keenable with one result. It sends the key the clients got, or no key on the public tier. Then it prints the search time to stderr:
configure-mcp exits with code 1. The client configs it wrote stay in place. If you cancel the confirmation prompt, the CLI changes nothing and doesnât search.
To check the clients you configured earlier without changing any config, pass --verify without client flags:
keenable entries. Each line names the clients that send that key:
keenable login. The CLI never prints a key, and it masks any copy of the key in the APIâs error. It takes a key only from an entry that points at https://api.keenable.ai/mcp or https://api.keenable.ai/mcp-public. For a client whose entry points anywhere else, or whose config file canât be read, the CLI sends nothing and prints Verify: not checked: <client>: <reason>. When no client has Keenable configured and every config file can be read, the CLI searches once with the key saved for https://api.keenable.ai, or with no key if none is saved. A failed search or a client that wasnât checked makes the command exit with code 1. The CLI doesnât search with keys in entries under other names. A passing search doesnât clear a Duplicate entries issue in the client status: run configure-mcp for that client to remove the duplicates.
Without flags, keenable configure-mcp lists the issues of each configured client, such as a different API key or duplicate entries. An entry whose URL isnât the one configure-mcp writes shows Points at an older endpoint. Run configure-mcp for that client to update it. CLI 0.10.0 and older check the URL only on entries without a key.
configure-mcp, reset, logout and doctor find the key in a clientâs X-API-Key header whatever its letter case, such as x-api-key. CLI 0.10.0 and older read the header only as X-API-Key.
Check your setup
keenable doctor checks your setup in one run and tells you what to fix: the CLI version, the network, your API key, the background daemon and the MCP setup of your AI clients. It needs CLI 0.11.0 or later.
â (ok), â (warning) or â (failure), and a Fix: line when the check has a fix:
With
--json, the CLI prints the checks on stdout. Each check has name, status (ok, warn or fail) and message. A warning or failure can also have a fix, so read it only when itâs there. mcp_clients also lists each detected client in clients, with name, flag, configured and issues. A client you set up with --keep-builtin-tools also has "builtin_tools_kept": true when its built-in search tools are on (CLI 0.12.0 or later). The key is left out otherwise:
clients is an empty list when the CLI detects no client. When the CLI canât find your home directory, it canât look for clients, so mcp_clients is a warning without clients.
ok is false when a check failed. The command exits with code 1 when a check failed, with 0 otherwise, warnings included, and with 2 for invalid arguments.
keenable doctor changes nothing. It writes no file, not even the update-check cache, and it doesnât start or stop the daemon. It takes --api-key and KEENABLE_API_KEY like keenable status, and it never sends a saved key to another base URL (see Saved keys and other base URLs). An invalid KEENABLE_API_URL or an unusable SSL_CERT_FILE is a failed check. With an invalid KEENABLE_API_URL, the checks that need the API (api_reachable, api_key and daemon) show as warnings that say Skipped, and the other checks still run.
Search
keenable search prints YAML for agents by default. These examples show each flag:
Read the query from stdin
Pass- as the query to read it from stdin, such as the output of another command. The CLI trims the input and joins its lines with single spaces:
keenable search "rust async". To search for a lone -, pipe it in: echo - | keenable search -. Empty input exits with code 2. So does - when stdin is a terminal, so the command never waits for you to type. Reading the query from stdin needs CLI 0.8.0 or later.
Stdin follows the same rules as for fetch URLs: input that isnât UTF-8 text or holds more than 1 MiB exits with code 2, and a byte-order mark at the start is skipped.
Exclude domains
--exclude-domain leaves hosts out of the results. Repeat the flag or separate hosts with commas. These two commands send the same list:
--exclude-domain .gov drops irs.gov, www.nasa.gov and every other host that ends in .gov. The CLI trims spaces around each entry and sends a blank entry, such as the end of a.com,, as "", which the API rejects. When a script builds the flag from a variable that can be empty, leave the flag out instead. A rejected entry prints the invalid_filter error with the entry and the reason, and the command exits with code 8. The rules and limits are on Exclude domains.
Search mode
--mode takes pro or realtime; any other value is a usage error with exit code 2, before any request (CLI 0.7.2 and older exit with 1). If you leave it out, the CLI sends the default_search_mode you saved with keenable config. If you saved none, the API uses your organizationâs default mode, or pro if the organization has none. A saved forced_search_mode wins over all of these. --mode standard, the older name of realtime, still works but isnât listed in --help. To set the mode for every search, save it with keenable config:
keenable config prints the settings to stderr. keenable config get prints the value to stdout, so a script can read it. If the setting has no value, it prints nothing and exits with code 1. An unknown key, or a value that isnât allowed, is a usage error with exit code 2 (CLI 0.6.1 and older exit with 1). The CLI keeps these settings in ~/.keenable/config.json. skip_setup_confirmation (true or false) is what Proceed and donât ask again saves at the configure-mcp prompt. keenable config shows it from CLI 0.12.0.
When forced_search_mode overrides a different --mode, the search still runs with the forced mode, and the CLI prints one line to stderr, such as warning: --mode realtime ignored: forced_search_mode is pro (keenable config unset forced_search_mode). stdout and the exit code donât change. This warning needs CLI 0.9.0 or later.
Moderation
--moderation takes moderate or strict and removes results that a safety model judges unsafe at that level. Removed results arenât replaced, so a search can return fewer results, or none. Without the flag, or with an empty value (--moderation ""), results arenât moderated. Any other value is a usage error with exit code 2. The API rejects the flag with exit code 8 for a URL query that is fetched as is. See Moderation replaces safety_mode.
If the API reports a deprecated request parameter, the YAML output carries its warnings list and each warning also goes to stderr as a warning: ⌠line. -p prints each warning. --moderation and the warnings need CLI 0.7.1 or later.
Date and time filters
--acquired-after, --acquired-before, --published-after and --published-before each accept one of these formats:
- A date in RFC 3339
full-dateform (YYYY-MM-DD). It covers that whole day in UTC. An--*-afterflag resolves to00:00:00on that date, and a--*-beforeflag resolves to23:59:59.999, so pages from the named day are kept at either end. To cut at an exact instant, pass a timestamp instead. - A timestamp in ISO 8601 form (
YYYY-MM-DDTHH:MM:SS[.sss][ÂąHH:MM]). If you leave out the timezone offset, the timestamp is read as UTC. - A relative delta (
<number><unit>, such as7dor30min). It resolves to the request time minus the delta, truncated to the minute, even if you set--query-time. The units aremin(minutes),h(hours),d(days),w(weeks),mo(30 days) andy(365 days).
2026-05-18T14:23:45Z, --acquired-after 2h resolves to 2026-05-18T12:23:00Z. A page acquired at 12:22:59Z is dropped, and a page acquired at 12:23:00Z is kept.
Point-in-time search
--query-time runs the search against the index as it stood at one instant. Pages acquired after that instant are left out, so you get the results the index would have returned then. The flag takes the same formats as the filters above.
This command searches the index as it stood on 30 May 2025:
--query-time. To bound results around a past instant, use dates. This command returns pages published in the 30 days before 13 June 2026, as the index stood then:
--query-time resolves to 00:00:00 UTC, the start of the day. A date-only --*-before flag resolves to the end of the day. So --query-time 2026-06-13 cuts at the start of 13 June, and --acquired-before 2026-06-13 keeps all of 13 June.
Fetch
keenable fetch prints a pageâs content as YAML by default:
POST /v1/fetch, so it also takes --schema (a JSON Schema, inline or @file, for a typed answer in structured), --links N and --images N. One call counts as one request toward the rate limit, and each page is billed as one fetch. With several URLs, the YAML output is results: one page or {url, error} per URL, in request order. The command fails only when every URL failed. Without a key, the CLI calls POST /v1/fetch/public with one URL, and takes --max-chars, --prompt, any --max-age-hours and --session-id. Several URLs, --schema, --links and --images need a key: without one, the command stops with API key required and exit code 2, and sends no request. That limit is the CLIâs own. The keyless API takes up to 10 URLs per call, with schema, links and images, under the keyless rate limit. To use that from code without a key, call the endpoint or use an SDK. Several URLs, --schema, --links, --images and --max-age-hours need CLI 0.6.1 or later; 0.6.0 and older take --live instead of --max-age-hours 0. Without a key, CLI 0.6.1 takes only --max-age-hours 0. Any other value needs CLI 0.7.1 or later.
--max-age-hours -1 reads only Keenableâs indexed copy and never the live page, as max_age_hours: -1 does on the API. See Where pages come from. If Keenable has no indexed copy of the page, the command fails with not_stored and exits with code 8. Any other negative value is a usage error with exit code 2. -1 needs CLI 0.7.1 or later.
The CLI checks these values before it sends a request. A value outside them is a usage error with exit code 2:
Unlike other usage errors, the keyless
API key required error prints like an API error: YAML on stdout, or one line of JSON with --json, plus error: API key required: ⌠on stderr.
Each URL, from the command line or from stdin, must be an absolute http:// or https:// URL. Anything else, such as example.com/page, is a usage error with exit code 2, and the CLI sends no request. The error suggests the fix, such as did you mean https://example.com/page?. The same goes for an empty search query. This check needs CLI 0.9.0 or later. Older versions send the request, and the API rejects it with exit code 8.
Scripts written for CLI 0.6.0 can keep --live: itâs a hidden, deprecated alias of --max-age-hours 0 and prints warning: --live is deprecated; use --max-age-hours 0 on stderr. Passing --live together with --max-age-hours is a usage error with exit code 2. The alias needs CLI 0.8.0 or later. CLI 0.6.1 to 0.7.2 reject --live as an unknown flag.
In the output, published_at and acquired_at are RFC 3339 timestamps in UTC, such as 2026-11-03T19:34:43Z. Search results use the same format.
The CLI keeps the fields the API sends for each page, apart from the deprecated description. Every page has image and favicon. --links and --images add links and images, --schema adds structured or answer_error, and --max-age-hours adds stale. See What each page returns.
With -p and several URLs, each page prints under an [i/n] label on stdout. For a URL that failed, stdout gets one line, <url>: failed (<code>), with the error title in place of the code when the API sent none. The error message and hint go to stderr.
Read URLs from stdin
Pass- among the URLs to read more URLs from stdin, one per line. The CLI trims each line and skips blank lines and lines that start with #:
-, so results lists them in that position, and - itself doesnât count as a URL. - can appear once. The total must still be 1 to 20 URLs, and more than one URL needs an API key. Otherwise the command exits with code 2 before it sends a request. It also exits with 2 when stdin is a terminal, isnât UTF-8 text, or holds more than 1 MiB. A byte-order mark at the start, as some Windows editors save, is skipped. Reading URLs from stdin needs CLI 0.8.0 or later.
Truncated content
If the page is longer than--max-chars, the API cuts the content. The YAML output has total_chars, the length of the full page content, and truncated, which is true when the content was cut. This command caps the content at 100 characters:
--max-chars. With -p, the CLI prints that hint below the content. If the content isnât cut, the output has truncated: false.
Monitors
keenable monitors creates monitors and reads their results. A monitor is a standing query: each newly crawled page that is news about its topic becomes one of its results. Monitors needs an API key, so run keenable login first. Without a key, the command stops with exit code 3.
create and update take these flags:
--every <INTERVAL>, such as6hor1d, runs the monitor at that interval.--cron <EXPR>runs it on a five-field cron expression.--timezone <TZ>sets an IANA time zone for it (default UTC).--timezonewithout--cronis a usage error with exit code2.--once <WHEN>runs it once:now, after a delay such as2h, or at a time such as2026-12-01T12:00:00Z.--name <NAME>names the monitor.--max-results <N>caps the results of one run, from 1 to 100 (default 10).--include-domainand--exclude-domainkeep results to these sites, or keep these sites out. Repeat the flag or pass a comma-separated list.--textalso returns each resultâs page text: the first 6,000 characters, kept for 3 days.--webhook <URL>sends events to a public HTTPS address, and--event <EVENT>picks which ones.--metadata key=valueadds your own tag to every webhook. Repeat it for more tags.
--every, --cron and --once. Without a schedule, the monitor runs only when you trigger it. The API checks the scheduleâs limits: see Schedules. update changes only the flags you pass, and also takes --query for a new topic, --no-schedule and --no-webhook. update with no flags is a usage error with exit code 2.
list takes --status (active, paused, disabled or completed), --name (monitors whose name contains the text), --limit (1 to 100, default 50) and --cursor (the next_cursor of the previous page).
Monitors are free for now, and an organization can have up to 100 active monitors. See Limits.
If you pass --webhook, create prints webhook.secret (whsec_...) once. Store it: you need it to verify webhook signatures. --idempotency-key <KEY> makes a retry safe: the same key with the same flags returns the monitor the first call created. delete asks before it deletes. Without a terminal it needs --yes, or KEENABLE_YES=1 in the environment. From CLI 0.12.0, only --yes on the command line counts, because a delete canât be undone. The prompt and the refusal name the monitor, such as "EU AI Act enforcement" (mon_123). If your agent runs the CLI, it should ask you before it passes --yes.
The other subcommands are get, run (one run and its results), deliveries (webhook attempts of the last 7 days) and stats. Bulk actions have no subcommand: use the API or an SDK. Run keenable monitors <subcommand> --help for each oneâs flags. Output, errors and exit codes work as they do for search and fetch.
Session IDs
--session-id <ID> tags a search or fetch with your own ID. Pass the same ID on every call in one agent run to group those calls. The CLI sends the ID as the APIâs session_id parameter. The API keeps the first 128 characters of the ID.
These commands group a search and a fetch under one session:
Output formats
keenable search, keenable fetch and keenable monitors print YAML on stdout by default. --json prints the same fields as compact one-line JSON on stdout instead. -p prints a readable view of the results on stdout, so keenable search "AI news" -p > results.txt keeps them. The header, warnings, hints and errors go to stderr. The CLI styles stdout only when itâs a terminal and NO_COLOR isnât set. --json and -p canât be used together: the command exits with code 2. --json, and -p printing to stdout, need CLI 0.8.0 or later. Earlier versions print -p results to stderr.
-p is short for --pretty. An empty NO_COLOR counts as not set, as no-color.org defines it. On keenable monitors, -p, --json, --fields, --jq and --api-key work before or after the subcommand, so keenable monitors -p list and keenable monitors list -p do the same.
Pick fields and filter with jq
--fields and --jq trim the output to what your script needs. Both work on keenable search, keenable fetch and keenable monitors, and both print JSON, so you donât need --json with them. They need CLI 0.8.0 or later.
--fields takes a comma-separated list of keys and keeps only those keys in each result. You can repeat the flag. This command keeps the title and URL of each search result:
results has only title and url, and the other top-level keys, such as query, stay as the API sent them.
What counts as a result depends on the command:
The keys come out in the order you list them. If no result has a key you asked for, the CLI prints
warning: field "<name>" is not in any result to stderr and still exits with code 0.
--jq runs a jq filter over the JSON output. The CLI has a jq interpreter built in, so you donât need jq installed. It prints each value the filter returns on its own line, as soon as the filter returns it. Strings print without quotes, as jq -r prints them, and other values print as compact JSON. When stdout is a terminal, the CLI drops control characters from those strings, so page text canât restyle your terminal. This command prints the URL of each search result, one per line:
--fields runs first and --jq reads its output:
<title>: <url>.
keenable fetch https://example.com --jq .content prints only the page text. keenable monitors list --jq '.data[].id' prints the ID of each monitor.
These cases stop the command:
- A filter that doesnât compile or imports a file (
import,include), an empty key name such as--fields title,,url, or either flag with-pexits with code2before the CLI sends a request. - A filter that fails while it runs, such as
keyson a string, or that returns a value JSON canât hold, such as an object with a number as a key, prints the lines it produced so far, thenerror: jq: <message>to stderr, and exits with code1. - If the command fails with an error, such as a rate limit or a page that failed when you fetch one URL, the CLI ignores both flags and prints the JSON error described in Errors.
results with url and error keys. --fields keeps that entry whole, and --jq sees it whole. If every URL failed, the CLI ignores both flags, prints the full results as JSON, then error: all <count> URLs failed to stderr, and exits with the code of the most common error.
keenable monitors create and keenable monitors update with --webhook return the webhook secret only once. With either flag, the CLI also prints it to stderr as warning: webhook secret: <secret>, so it isnât lost when your filter leaves it out.
Errors
If a command fails, it exits with a nonzero code. Without-p, keenable search, keenable fetch and keenable monitors print the error to stdout as YAML, or as one line of JSON with --json, so your agent can parse it like a result. The JSON error has the same keys as the YAML one. They also print a one-line summary to stderr.
A usage error, such as an unknown flag or a value out of range, exits with code 2 before the CLI sends a request. It prints the message and usage on stderr and nothing on stdout. The keyless fetch error API key required is the one usage error that prints a YAML or JSON error on stdout (see Fetch).
This command asks for an out-of-range number of results:
Branch on
type and code when theyâre present, not on the text of error or message. To read the section for a code, open the errorâs docs_url, or run keenable docs errors <code> with CLI 0.11.0 or later. See Open the docs.
On a 429, the hint starts with when to retry. A wait of a minute or more also shows in minutes and hours, followed by the exact seconds. This keyless search hit the hourly limit and must wait 622 seconds:
error: Rate limit exceeded: ⌠Retry after 10m 22s (622s). A wait under a minute reads Retry after 2s. With a key, the hint reads Rate limit reached for your API key. Retry after âŚ, or run `keenable login` to switch accounts. instead. retry_after stays the number of seconds. If the API sends no Retry-After but an X-RateLimit-Reset header, the hint reads Retry after <time>, with the time as the header sent it. If it sends neither, the hint starts with Retry later.
With -p, the CLI prints the error and the hint to stderr. If the request failed before the API answered, a Cause: line names the underlying network error; with -v, the full error chain replaces it. The CLI adds a Docs: line with the docs_url and a Request ID: line when the API sent them. When your credits are used up, it also prints Add credits: with the billing_url.
billing_url, the minutes-and-hours retry time and the retry time in the stderr summary need CLI 0.9.0 or later. Earlier versions end the keyless 429 hint with or run `keenable login` to authenticate and increase your limits.
Exit codes
keenable search, keenable fetch and keenable monitors exit with a code for each kind of failure, so a script can branch without reading the output. Search and fetch do so from CLI 0.5.1. Earlier versions exit with 1 for every failure. See Updating.
The codes:
When the API sends an error
type, it sets the code: for example, every rate_limit_error exits with 4. keenable status uses the same codes, and with --json it prints its error as one line of JSON on stdout. It needs CLI 0.9.0 or later. Other commands exit with 1 on any error, except keenable update --check, which exits with 7 when it canât get the latest version (see Updating), and the two-step agent login (see Log in from an agent in two steps). Arguments the CLI canât parse, such as an unknown flag or an unknown keenable docs topic, exit with 2 in every command.
keenable monitors has two cases of its own:
- Without an API key, it exits with
3before it sends a request. keenable monitors deletewithout--yesexits with1and deletes nothing when it canât ask you to confirm, for example when stdin isnât a terminal. Before CLI 0.12.0,KEENABLE_YES=1in the environment counts as--yeshere too. From CLI 0.12.0, the error hascode: confirmation_required, so an agent can tell it needs your OK, and its hint says to confirm with you first. If you answer no at the prompt, it exits with0.
Balance left
With an API key, a billed search or fetch response carries ausage object that says what your organization has left after the call. YAML and --json output include it as the API sends it. With -p, the CLI prints it on one line on stderr:
usage.balance in US dollars, exactly as the API sends it in amount_decimal. If the response has no usage.balance but has usage.credits_remaining, the line shows that instead, in credits of $0.004 each, as Credits left: N (https://keenable.ai/console). If it has neither, for example when the balance couldnât be read, the CLI prints no line. A fetch of several URLs prints one line, with the lowest balance any of its pages reports. Keyless calls report no usage and print no line. Balance left needs CLI 0.10.0 or later. CLI 0.5.1 to 0.9.0 print Credits left when the response has usage.credits_remaining, and older versions print no line. See Balance and usage.
Open the docs
keenable docs opens the page of these docs for a topic in your browser, so you can read about a command or an error without searching:
Opened <url> to stderr. With --print, or when stdout isnât a terminal, it opens nothing and prints only the URL on stdout, so a script or an agent can read it. If the browser doesnât open, the CLI prints Could not open a browser. Open this link: to stderr and the URL on stdout. The command makes no API call and needs no key. keenable docs needs CLI 0.11.0 or later.
Each topic opens one page or section. Topics and aliases ignore case. The skills topic needs CLI 0.12.0 or later:
An unknown topic is a usage error: the CLI exits with code
2 and lists the topics.
After errors, an error code opens its section under Error codes, the same address as the errorâs docs_url. The CLI trims spaces around the code and ignores its case. - works in place of _, so invalid-api-key opens the same section. A code the CLI doesnât know still gets a link of the same form, with a warning on stderr that the page may have no section for it. A code after any other topic exits with code 2, and so does a code that is empty after trimming or has any character other than ASCII letters, digits, _ and -.
Updating
The CLI checks for updates once per hour. When a newer version is out, commands with human-readable output (search, fetch and monitors with -p, and login, config, configure-mcp and the like) end with a notice on stderr that names the version and the command to update with. From version 0.7.2 the notice also links the latest release notes.
These commands never check, so scripts and agents see no notice:
search,fetchandmonitorswithout-p: YAML,--json,--fieldsand--jqoutputstatus --json,login --non-interactiveandlogin --completeupdate,doctor,docs,completionandmansetupwithout a subcommand, andsetup skills --dry-run
keenable update instead. On a Homebrew install, keenable update exits with code 1 and prints the brew command above. On a copy installed another way, such as with cargo or by copying the binary, it exits with code 1 and prints the installer command to reinstall with. The CLI changelog lists what changed in each version, and marks changes that can break a script.
To see whether a newer version exists without installing it, run:
--json to get the same report as one line of JSON on stdout:
install_method is installer for an install made with an installer script, homebrew for Homebrew, and other for anything else. An other install canât update itself, so update_command is the installer command. The installer puts the latest version in $CARGO_HOME/bin (usually ~/.cargo/bin). If the copy you checked is somewhere else, remove it or put that directory first on your PATH.
The command exits with 0 whether or not an update exists. If it canât get a usable version from GitHub, it exits with 7 and prints the error and a hint. For a connection problem the hint is about HTTPS_PROXY or NO_PROXY; when GitHubâs per-address limit is hit, it says to retry later. --json works only with --check: keenable update --json is a usage error with exit code 2. --check and --json need CLI 0.9.0 or later.
Proxies and corporate networks
The CLI trusts its bundled root certificates and your operating systemâs certificate store, so a company root CA installed on the machine works without setup. If your network inspects TLS and the CA isnât in the system store, pointSSL_CERT_FILE at a PEM bundle that contains it:
SSL_CERT_DIR works too. When either is set, the CLI uses it instead of the system store and keeps its bundled roots. If the file is missing or isnât valid PEM, a command that calls the network stops with Invalid SSL_CERT_FILE: <path>: <reason> and exits with code 1. Commands that make no network call, such as keenable config, run as usual. An empty SSL_CERT_FILE or SSL_CERT_DIR counts as unset.
To send requests through a proxy, set HTTPS_PROXY or ALL_PROXY. Put a proxy login in the URL. Hosts in NO_PROXY are reached directly, and lowercase names work too. Without these variables, the CLI uses the macOS or Windows system proxy settings. PAC files arenât supported. For an http:// base URL, the CLI reads HTTP_PROXY instead of HTTPS_PROXY. To reach a local gateway directly, add its host to NO_PROXY.
KEENABLE_API_URL set, that is your API host, and that is the host to add to NO_PROXY (an IPv6 address without brackets, such as ::1). CLI 0.8.0 and older always name api.keenable.ai. In YAML output, the error adds cause and hint:
-v (--verbose) to any command to see the proxy in use, the certificate sources the CLI loaded and the full error chain. With -v, a search or fetch skips the background daemon and sends the request itself, so the output describes that request:
API base URL
To send the CLIâs API calls to another address, such as a local gateway, setKEENABLE_API_URL to its base URL. Without it, the CLI calls https://api.keenable.ai. This command sends a search to a gateway on port 8080:
http://127.0.0.1:8080/v1/search, or to /v1/search/public if no API key is set. The value must follow these rules:
- It starts with
https://. Plainhttp://works only forlocalhost,127.0.0.1and::1. - It has no query string and no fragment.
- It has no user name or password.
- The CLI keeps a path prefix. With
https://gateway.example.com/keenable, searches go tohttps://gateway.example.com/keenable/v1/search. - The CLI removes trailing slashes.
- An empty value, or one of only spaces, counts as unset.
monitors, status, login and doctor use this URL. configure-mcp doesnât, because your clients call production: it writes the production MCP URL, https://api.keenable.ai/mcp, into them, checks the key saved for https://api.keenable.ai against that address, and runs the --verify search there. The SDKs read the same variable, but their rules for the value can differ.
If the value breaks a rule, these commands, and configure-mcp, exit with code 1 before they send a request. This is the YAML output for KEENABLE_API_URL=http://example.com keenable search "rust async":
--json, and for status --json, the error is one line of JSON with the same keys. In both cases a one-line error: ⌠summary goes to stderr. With -p, for status without --json, and for login and configure-mcp, the CLI prints the message and hint to stderr.
keenable doctor doesnât stop: it reports a failed api_url check and skips the checks that call the API. The other checks still run, and the version check can still ask GitHub for the latest release. See Check your setup.
Saved keys and other base URLs
The CLI sends a saved API key only to the base URL it was saved for.keenable login saves the key for the current KEENABLE_API_URL, or for https://api.keenable.ai when the variable isnât set, and keeps the keys you saved for other base URLs. keenable logout removes only the key for the current base URL. When you have a key saved for https://api.keenable.ai but none for the current base URL, a search, fetch or monitors command stops with exit code 1 and sends nothing, so a KEENABLE_API_URL set by a projectâs environment canât send your key to another host:
KEENABLE_API_KEY or --api-key, or run keenable login with KEENABLE_API_URL set.
The CLI follows a redirect only to the same scheme, host and port. A redirect to another host, or from https to http, fails with exit code 7, and the API key isnât sent.
Environment variables
The CLI reads these variables:
The CLI also reads the lowercase
https_proxy, http_proxy, all_proxy and no_proxy.
Background daemon
On macOS and Linux,keenable search and keenable fetch send their requests through a background process, the daemon. It keeps the connection to the API open, so the next search or fetch doesnât open a new one. The first search or fetch starts it, and it exits after 5 minutes without a request. On Windows the CLI runs no daemon and every command calls the API directly.
The CLI runs one daemon for each API base URL. The daemon for https://api.keenable.ai listens on ~/.keenable/daemon.sock and writes its process ID to ~/.keenable/daemon.pid. With KEENABLE_API_URL set, the files are ~/.keenable/daemon-<hash>.sock and daemon-<hash>.pid, so switching base URLs leaves the other daemon running. Only your user can connect to the socket. If the socket path reaches the operating systemâs limit (104 bytes on macOS, 108 on Linux), for example with a long KEENABLE_HOME, the CLI calls the API directly.
These requests go directly to the API, not through the daemon:
- A search or fetch with
--api-keyorKEENABLE_API_KEY. The daemon uses the saved key. - Any command with
-v, so the proxy, certificates and errors it shows are the commandâs own. - Every other command, including
keenable monitors. A create or delete that the daemon retried could run twice.
- If the daemon runs a different CLI version or binary, for example after an upgrade, the next search or fetch stops it and starts a new one.
- If the proxy or certificate variables, the certificate files or
KEENABLE_APP_TITLEchanged since the daemon started, the daemon exits and that request goes directly to the API. The next search or fetch starts a new daemon. - If a request through the daemon fails on the network, other than a timeout, the CLI stops the daemon and retries the request once directly. A fetch with an API key isnât retried, because the API may have billed the pages already: the CLI stops the daemon and prints the error.
keenable login and keenable logout stop every daemon, so the next command starts one with the new key. A keenable update that installs a new version stops them too.
To stop every daemon by hand, run:
Related pages
Connect your agent (MCP)
Connect the Keenable MCP server to Claude Code, Cursor, Codex and other clients for web search and fetch with no key. Sign in for higher limits and Monitors.
Claude
Add Keenable web search to Claude from the Connectors Directory, or to Claude Code with one command, and keep Claudeâs own web search from competing.
Quickstart
Give your agent web search in under two minutes, with no account or API key. Paste one prompt into your coding agent, or install the SDK and search.
Keyless access
How to call search and fetch with no API key: the /public paths, the X-Keenable-Title header, /mcp-public, and the keyless limit per IP address.