Search documentation

Search documentation

CLI Setup

The Pillar CLI detects your framework, installs the SDK, generates starter code, syncs your tools, and sets up knowledge sources — all in one command.

Prerequisites

Install the CLI

bash
npm install -g pillar-cli

Run init

From your project directory:

bash
pillar init

The CLI walks you through each step:

  1. Authenticate — Opens your browser to log in (or use an existing session)
  2. Select a product — Pick from your existing products or create a new one
  3. Detect framework — Identifies Next.js, Vite+React, Vue, Angular, or vanilla JS
  4. Install the SDK — Adds the correct package (@pillar-ai/react, @pillar-ai/vue, etc.)
  5. Generate starter code — Creates a provider wrapper, a starter tools file, and .env.local with your credentials
  6. Sync tools — Scans your code for tool definitions and registers them with Pillar
  7. Set up knowledge — Detects docs URLs in your project and creates knowledge sources (indexing runs in the background)

If you already know which product to use, skip the selection prompt:

bash
pillar init --agent-slug your-agent-slug

Verify the setup

After init completes, run diagnostics to confirm everything is wired up:

bash
pillar doctor

This checks your agent slug, sync secret, SDK version, tool sync status, knowledge source health, and embed config reachability.

Test the copilot

You can test your copilot without starting the app:

bash
pillar chat "how do I get started?"

Or start an interactive session:

bash
pillar chat

Start your app

Start your dev server and open the Pillar panel to see it in action:

bash
npm run dev

Click the sidebar tab on the screen edge to open the panel, then try asking it to use one of your tools.

What init generates

The CLI creates framework-appropriate files. For a Next.js project, you'll get:

FilePurpose
providers/PillarSDKProvider.tsxClient component wrapping PillarProvider
hooks/usePillarTools.tsStarter tools file with a sample navigate tool
.env.localNEXT_PUBLIC_PILLAR_AGENT_SLUG and PILLAR_SECRET

For other frameworks the file names differ, but the structure is the same: a provider, a tools file, and environment config.

Next steps