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
- A Pillar account (sign up at trypillar.com)
- Node.js 18+
Install the CLI
npm install -g pillar-cli
Run init
From your project directory:
pillar init
The CLI walks you through each step:
- Authenticate — Opens your browser to log in (or use an existing session)
- Select a product — Pick from your existing products or create a new one
- Detect framework — Identifies Next.js, Vite+React, Vue, Angular, or vanilla JS
- Install the SDK — Adds the correct package (
@pillar-ai/react,@pillar-ai/vue, etc.) - Generate starter code — Creates a provider wrapper, a starter tools file, and
.env.localwith your credentials - Sync tools — Scans your code for tool definitions and registers them with Pillar
- 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:
pillar init --agent-slug your-agent-slug
Verify the setup
After init completes, run diagnostics to confirm everything is wired up:
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:
pillar chat "how do I get started?"
Or start an interactive session:
pillar chat
Start your app
Start your dev server and open the Pillar panel to see it in action:
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:
| File | Purpose |
|---|---|
providers/PillarSDKProvider.tsx | Client component wrapping PillarProvider |
hooks/usePillarTools.ts | Starter tools file with a sample navigate tool |
.env.local | NEXT_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
- Add more tools — Define navigation, query, trigger, and form tools
- Sync tools — Set up CI/CD syncing or watch mode
- Set up your knowledge base — Add docs, files, and snippets
- Customize the panel — Position, behavior, and push mode
- CLI Reference — Full command reference for all CLI commands