What installing the Expand CLI adds on top of the hosted MCP server. Terminal fetches, the Expand Skill, the OpenCode web-fetch hook, and proxy support.
The hosted MCP server gives an agent Fetch with nothing installed. The expandai CLI is the local path. Install it when you want one of these:
expandai fetch <url> prints Markdown text, for you or for an agent that runs shell commands.SKILL.md the agent loads on demand. It says when to use Expand, how to cite what it fetched, and how to read the Appendix.webfetch call through Expand, so the agent gets rendered Markdown without being told to use a specific tool.HTTP_PROXY, HTTPS_PROXY, and NO_PROXY.npm install -g expandai
expandai loginexpandai login offers browser sign-in or an API key prompt. Credentials are stored in ~/.config/expandai/config.json, or under $XDG_CONFIG_HOME when it is set. No key is written into any agent's config file.
Every command also runs without a global install, through npx -y expandai <command>.
expandai init finds the coding agents on your machine, signs you in if needed, and configures the ones you pick.
expandai init --detect
expandai init--detect lists what would be configured and changes nothing. Without it, init asks for a scope, shows the detected agents with all of them selected, and writes to the ones you confirm. Every agent gets the Expand Skill and the MCP server, and OpenCode also gets the web-fetch hook. The per-agent table is on CLI: Commands.
Scope is global or project. Project scope writes into the current repository, so collaborators who clone it inherit the setup. Global scope applies to every session on the machine.
init does not write to Claude Code's settings.json, does not change its permissions, and does not install a hook there. Claude Code's built-in WebFetch keeps working as before, and the Expand Skill is what routes fetches through Expand.To configure one agent and skip the questions, pass --harnesses and --scope:
expandai init --harnesses codex --scope projectEvery flag, and the per-host mcp install, skill install, and hook install commands, are on CLI: Commands.
The Skill is one Markdown file, SKILL.md, named expandai. init, skill install, and hook install copy it into the agent's skills directory, such as ~/.claude/skills/expandai/ for Claude Code or .agents/skills/expandai/ for a Codex project. Every agent gets the same file.
It tells the agent:
expandai fetch <url> before curl or a built-in web-fetch tool on any public page, and to skip Expand for localhost, private hosts, and JSON APIs.expandai snapshots get <snapshotId> --highlights <query> when it needs passages from a page it already fetched, instead of fetching the URL again.[appendix omitted: …] {N} marker is, that it is not page content, and to read the block with expandai appendix rather than refetching.more link in the frontmatter to the Snapshot's catalog. See Progressive disclosure.**Sources** block of <playground>?id=<evidence id> links, and how to narrow a table citation to one cell. See Citation links.expandai login --json itself and relaying the URL and code to the user.SKILL.md. init and status compare the installed file with the bundled one, so an outdated Skill shows as not configured until you run init again.OpenCode's webfetch tool has no JavaScript engine, so a client-rendered page comes back as an empty shell. The hook is a plugin file, expandai-webfetch.js, that init or hook install copies into ~/.config/opencode/plugins/ or .opencode/plugins/. After every webfetch call it runs expandai hook opencode with the URL, and replaces the tool's output with the Markdown text Expand returns.
The Markdown starts with a short note that carries the Snapshot ID and the capture link, and tells the agent to call get_snapshot or expandai snapshots get for more passages rather than fetching the URL again.
expandai hook install claude-code installs the Skill and the MCP server, then prints a notice for the hook step and writes nothing. The protocol runner expandai hook claude-code still exists, but setup does not register it.expandai status --harness opencode --scope project
expandai whoami
expandai uninstallstatus reports whether the Skill, the MCP server, and, for OpenCode, the hook are configured, and whether the agent needs a restart. It changes nothing. uninstall with no arguments removes every hook, Skill, and MCP entry the CLI installed, in both scopes.
init, restart the agent, including the one that ran the command.expandai mcp run serves the same three tools as the hosted server, over stdio, using the credentials from expandai login. init and mcp install register it for you. Use it where an editor cannot reach https://api.expand.ai. The config entry and the tools are on MCP tools & resources.
Everything above works without an elevated shell. Credentials are stored under your user profile. The CLI tightens the file's access control list when it can. When Windows refuses, which it does for a non-elevated account, the CLI logs a warning and continues. Run one elevated shell if you want the list tightened.
start.md.