@cornect/cli
v0.1.0
Published
Command-line interface for the Cornect public API — search companies, manage exports, check credits.
Downloads
25
Maintainers
Readme
Cornect CLI
Command-line interface for the Cornect public API — search companies, manage exports, and check credits from your terminal or scripts. A third interface alongside the REST API and the MCP server, sharing the same auth + endpoints.
Install
npm install -g @cornect/cli # then: cornect <command>
# or, without installing:
npx @cornect/cli <command>Until it's published to npm, run from source:
cd cli && npm install && npm run build && npm link(thencornectis on your PATH), or invokenode /path/to/cli/dist/index.js <command>.
Authenticate
Get a token at https://app.cornect.io → Account → API tokens (read scope covers search/lookup/credits; read_write adds export creation).
cornect login # prompts for the token, validates it, stores it
cornect login --token cornect_xxx
cornect logout # removes the stored tokenThe token is saved to ~/.cornect/config.json (chmod 600). For CI/scripts,
set CORNECT_API_TOKEN instead — it overrides the stored token:
CORNECT_API_TOKEN=cornect_xxx cornect creditsBase URL defaults to https://api.cornect.io/api/v1; override with
CORNECT_API_BASE.
Global flags
--json (raw JSON, for scripting) · --csv (CSV where supported) ·
--quiet (suppress decoration) · --debug (full error detail). Colors
auto-disable when output isn't a TTY (clean pipes).
Commands
cornect search
cornect search --query fintech --country "Germany" --industry "Software" --limit 10
cornect search --country "United States" --exclude-industry "Staffing and Recruiting" \
--exclude-keyword consulting
cornect search --query saas --json | jq '.items[].domain'
cornect search --country "Germany" --csv > german-companies.csvCountry/industry filters use full NAMES, not ISO codes —
"Germany","United States","United Kingdom"(not"DE"/"US"). ISO codes match nothing. To target a city, also pass--country(city names repeat across countries — Berlin, Germany vs Berlin, Connecticut).
cornect company get <id>
cornect company get predictleads:acme.com
cornect company get predictleads:acme.com --jsoncornect export
cornect export create --name "German SaaS" --country "Germany" --industry "Software"
cornect export status <export-id>
cornect export download <export-id> --output leads.csvexport create charges 1 credit per newly-exported company and needs a
read_write token (a read token gets 403 INSUFFICIENT_SCOPE).
cornect credits
cornect credits # balance + recent transactions
cornect credits --jsonErrors
Structured API errors print cleanly and exit non-zero — 401 → "Run: cornect
login", 402 → top-up link, 403 INSUFFICIENT_SCOPE → "needs a read_write
token", 429 → rate-limited. Stack traces only with --debug.
Develop
npm install
npm run build # tsc → dist/
npm test # vitest
npm run dev -- search --query fintech # run from source via tsx