CLI
The Pillar CLI (pillar-cli) is the fastest way to set up and manage your Pillar integration. It handles SDK installation, tool syncing, knowledge management, and copilot testing from the terminal.
Install
Run with npx (no install needed):
npx pillar-cli <command>
Or install globally:
npm install -g pillar-cli
Quick Setup
npx pillar-cli init
This single command detects your framework, installs the SDK, generates starter code, syncs your tools, and creates knowledge sources from your docs site. When authenticated, it provisions everything so pillar doctor passes.
Commands
pillar init
Set up Pillar in a new project. The init command:
- Detects your framework (Next.js, Vite+React, Vue, Angular, vanilla JS)
- Installs the correct SDK package
- Generates a provider wrapper, starter tools file, and
.env.local - Creates a sync secret and runs an initial tool sync
- Detects docs URLs in your project and creates knowledge sources (indexing runs in the background)
npx pillar-cli init
Options:
| Flag | Description |
|---|---|
--agent-slug <slug> | Skip the product selection prompt |
pillar sync
Scan your code for tool definitions and sync them to Pillar. This replaces the pillar-sync command from @pillar-ai/sdk and adds watch mode.
pillar sync --scan ./src # Sync oncepillar sync --scan ./src --watch # Watch for changespillar sync --scan ./src --force # Force syncpillar sync status --scan ./src # Compare local vs remote
| Flag | Description |
|---|---|
--scan <dir> | Directory to scan (default: ./src) |
--watch | Re-sync on file changes |
--force | Sync even if manifest is unchanged |
--local | Show manifest without uploading |
pillar knowledge
Manage the knowledge sources that power your copilot's answers.
pillar knowledge add https://docs.myapp.com # Add and crawlpillar knowledge list # List all sourcespillar knowledge status <id> # Check a sourcepillar knowledge sync <id> # Re-crawlpillar knowledge remove <id> # Delete
pillar doctor
Run diagnostics on your integration.
pillar doctor
Checks agent slug, sync secret (catches placeholder values), SDK version, tool sync status, knowledge source health, and embed config reachability.
pillar chat
Test your copilot from the terminal with streaming responses.
pillar chat "how do I export data?" # Single questionpillar chat # Interactive REPL
pillar auth
Manage authentication (needed for init and knowledge).
pillar auth loginpillar auth statuspillar auth logout
Configuration
The CLI reads settings from (in priority order):
- Environment variables —
PILLAR_SLUG,PILLAR_SECRET,PILLAR_API_URL - Config file —
~/.pillar/config.json - Project .env —
.env.localin the working directory
Migrating from @pillar-ai/sdk pillar-sync
If you're using pillar-sync from @pillar-ai/sdk, switch to:
npx pillar-cli sync --scan ./src
The old command continues to work but won't receive new features. The CLI version adds watch mode, status comparison, and config file support.
CI/CD
# GitHub Actions- name: Sync Pillar toolsrun: npx pillar-cli sync --scan ./srcenv:PILLAR_SLUG: ${{ secrets.PILLAR_SLUG }}PILLAR_SECRET: ${{ secrets.PILLAR_SECRET }}