Basilic
Development

CLI Package

TypeScript CLI to interact with the Basilic API via API key. Ideal for agentic integrations.

The @repo/cli package is the API CLI (basilic binary): call the Fastify API with an API key. It is not the project generator.

The project generator is create-basilic (npx create-basilic@latest my-app). See Getting Started and tools/create-basilic/README.md.

The @repo/cli package uses @repo/core for all requests and supports only API key auth. Auth endpoints (magic link, OAuth, passkey, etc.) are excluded.

Auth

  1. Env var: API_KEY or BASILIC_API_KEY
  2. Config file: ~/.config/basilic/config.json
  3. Interactive prompt (saves to config)
basilic config set-api-key bask_xxx_yyy

Commands

Commands mirror core API nesting: health-check, account apikeys create, account apikeys list, ai chat, etc. Use --help for OpenAPI-derived descriptions.

basilic health-check
basilic account apikeys list
basilic ai chat --body '{"messages":[{"role":"user","content":"Hello"}]}'

Local testing

  1. Start API: pnpm dev
  2. Create API key via dashboard or POST /account/apikeys/ with JWT
  3. Run: API_KEY=bask_xxx node packages/cli/dist/cli.js health-check

See packages/cli/README.md for full instructions.

Agentic integrations

The CLI is a simple alternative to MCP for agents (Cursor, Claude Code, scripts):

  • Standard stdout/JSON
  • No server setup
  • Easy to wrap in scripts: result=$(basilic ai chat --body '...')

Agents can shell out to the CLI and parse JSON output without running an MCP server.

On this page