@appollo-ui/cli
v0.1.2
Published
Add Appollo UI components to your Salesforce SFDX project
Readme
@appollo-ui/cli
A CLI to add Appollo UI components to your Salesforce SFDX project — similar to how shadcn/ui works for React.
Installation
No installation required. Use npx:
npx @appollo-ui/cli <command>Or install globally:
npm install -g @appollo-ui/cliCommands
init
Initialize Appollo UI in your SFDX project. Detects your sfdx-project.json and creates an appollo.json config file.
npx @appollo-ui/cli initOptions:
| Option | Description |
|--------|-------------|
| --cwd <path> | Working directory (default: process.cwd()) |
| --yes | Skip prompts and use detected defaults |
| --lwc-path <path> | Override the detected LWC directory path |
This creates appollo.json in your project root:
{
"$schema": "https://appolloui.dev/registry/schema.json",
"lwcPath": "force-app/main/lwc"
}add
Add one or more components to your project. Automatically resolves and installs dependencies.
# Add specific components
npx @appollo-ui/cli add button
npx @appollo-ui/cli add accordion button badge
# Interactive multi-select (no arguments)
npx @appollo-ui/cli add
# Install everything
npx @appollo-ui/cli add --allOptions:
| Option | Description |
|--------|-------------|
| --cwd <path> | Working directory (default: process.cwd()) |
| --yes | Skip prompts (overwrite existing files) |
| --overwrite | Overwrite existing component files |
| --all | Install all available components |
list
List all available components in the registry.
npx @appollo-ui/cli listConfiguration — appollo.json
The appollo.json file is created by init and used by add to locate your LWC directory.
{
"$schema": "https://appolloui.dev/registry/schema.json",
"lwcPath": "force-app/main/lwc",
"registryUrl": "https://appolloui.dev/registry"
}| Field | Description | Required |
|-------|-------------|----------|
| lwcPath | Path to your LWC directory (relative to project root) | Yes |
| registryUrl | Override the registry URL | No |
| $schema | JSON schema for editor support | No |
Environment Variables
| Variable | Description |
|----------|-------------|
| APPOLLO_REGISTRY_URL | Override the component registry URL (useful for self-hosted registries or local development) |
Example:
APPOLLO_REGISTRY_URL=http://localhost:3000 npx @appollo-ui/cli add buttonHow It Works
- Registry: Components are hosted as JSON files at appolloui.dev/registry. Each component JSON contains the full source of all LWC files.
- Dependency resolution: When you add a component, the CLI recursively resolves all
registryDependenciesand installs them too. - File writing: Files are written directly into your
{lwcPath}/{componentName}/directory — no build step required.
Requirements
- Node.js 18+
- Salesforce SFDX project (with
sfdx-project.json)
License
MIT
