Search documentation

Search documentation

Customize your docs experience — choose your preferred framework for code examples:

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):

bash
npx pillar-cli <command>

Or install globally:

bash
npm install -g pillar-cli

Quick Setup

bash
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:

  1. Detects your framework (Next.js, Vite+React, Vue, Angular, vanilla JS)
  2. Installs the correct SDK package
  3. Generates a provider wrapper, starter tools file, and .env.local
  4. Creates a sync secret and runs an initial tool sync
  5. Detects docs URLs in your project and creates knowledge sources (indexing runs in the background)
bash
npx pillar-cli init

Options:

FlagDescription
--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.

bash
pillar sync --scan ./src # Sync once
pillar sync --scan ./src --watch # Watch for changes
pillar sync --scan ./src --force # Force sync
pillar sync status --scan ./src # Compare local vs remote
FlagDescription
--scan <dir>Directory to scan (default: ./src)
--watchRe-sync on file changes
--forceSync even if manifest is unchanged
--localShow manifest without uploading

pillar knowledge

Manage the knowledge sources that power your copilot's answers.

bash
pillar knowledge add https://docs.myapp.com # Add and crawl
pillar knowledge list # List all sources
pillar knowledge status <id> # Check a source
pillar knowledge sync <id> # Re-crawl
pillar knowledge remove <id> # Delete

pillar doctor

Run diagnostics on your integration.

bash
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.

bash
pillar chat "how do I export data?" # Single question
pillar chat # Interactive REPL

pillar auth

Manage authentication (needed for init and knowledge).

bash
pillar auth login
pillar auth status
pillar auth logout

Configuration

The CLI reads settings from (in priority order):

  1. Environment variablesPILLAR_SLUG, PILLAR_SECRET, PILLAR_API_URL
  2. Config file~/.pillar/config.json
  3. Project .env.env.local in the working directory

Migrating from @pillar-ai/sdk pillar-sync

If you're using pillar-sync from @pillar-ai/sdk, switch to:

bash
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

yaml
# GitHub Actions
- name: Sync Pillar tools
run: npx pillar-cli sync --scan ./src
env:
PILLAR_SLUG: ${{ secrets.PILLAR_SLUG }}
PILLAR_SECRET: ${{ secrets.PILLAR_SECRET }}