@secapi/cli is the command-line client for retrieving source-backed SEC filings, filing data, and account context from a terminal or agent runner.
npm install -g @secapi/cli
export SECAPI_API_KEY="secapi_..."
secapi filings latest --ticker AAPL --form 10-KThe command writes JSON to stdout with the current filing's accession number, filing date, SEC source URL, and request ID. Those live values can change when a newer filing is available.
The CLI sends SECAPI_API_KEY as x-api-key to https://api.secapi.ai and calls the public REST contract. For an MCP-compatible client, use the hosted MCP server; the CLI can generate supported client configuration without storing a key.
Node.js and npm are required. The preferred executable is secapi; omni-sec remains a compatibility alias. See the CLI guide and API reference, check status, or contact support.
secapi filings latest --help
secapi doctor
secapi mcp install --client claude-codedoctor checks the selected origin, credential source, API health, and account context without printing credential values. Use --base-url <url> only for an environment you control. For CI and agent runners, keep credentials out of command arguments: set SECAPI_API_KEY, or pipe a key with --api-key-stdin.
printf '%s' "$SECAPI_API_KEY" | secapi health --api-key-stdinsecapi agent-context --output secapi-cli-context.json writes a machine-readable command inventory. secapi init --client cursor --print shows generated client configuration without writing it. Profiles store environment-variable names, not credential values.
MIT