AI agents & API
CLI
spook-cli is a zero-dependency wrapper over the agent API for terminals, shell scripts and coding agents. Everything prints JSON.
Install
Requires Node.js 18+. The package is spook-cli on npm.
bash
npm install -g spook-cli
spook helpGet an API key
Sign in to Spook and open Settings → Agent API. Generate a key (spook_agent_...) and save it:
bash
spook auth login --key spook_agent_xxxxxxxx
spook auth whoamiThe key is stored in ~/.spook/config.json (chmod 600). You can instead set SPOOK_API_KEY in the environment. Point at a different host with --base or SPOOK_BASE_URL (default https://www.tryspook.com).
Try it free (no key)
bash
spook analyze example.com # quick-win queries any domain already ranks forCommands
Everything prints JSON, so output pipes straight into jq or an agent.
Sites
spook sites List your sites
spook site <siteId> Site details
spook sites:create --name <n> --domain <d> [--publish nextjs] [--webhook <url>]
spook publishing <siteId> --integration nextjs [--mode draft|live]
spook autopilot <siteId> on|off
spook metrics <siteId> [--days 28]
spook checkout Stripe Checkout URL to add a paid site
Content
spook opportunities <siteId> [--questions] [--limit 20]
spook articles <siteId> [--limit 20]
spook article <articleId>
spook generate <siteId> "<query>" [--callback <https-url>]
spook publish <articleId>
Any tool (incl. the free AI writers)
spook tools List every tool + input schema
spook run <tool> '<json>' e.g. spook run blog-outline-generator '{"topic":"cold brew"}'Examples
bash
# Stand up a site, let Spook run it
spook sites:create --name "Acme" --domain acme.com --publish nextjs
spook opportunities <siteId> --limit 10
spook generate <siteId> "how to brew cold brew coffee"
spook article <articleId> # review the draft
spook publish <articleId>
spook autopilot <siteId> on
# Use a free AI tool
spook run content-brief-generator '{"keyword":"cold brew ratios"}'Prefer MCP?
Spook is also an MCP server at
https://www.tryspook.com/api/mcp - point any MCP client there. The CLI and MCP expose the same tools. See MCP server and the Agent API the CLI wraps.