Complete reference for the Composter CLI tool.
# Global installation (recommended)
npm install -g composter-cli
# Or use npx without installation
npx composter-cli <command>Login to your Composter account.
Usage:
composter loginInteractive prompts:
- Email address
- Password
Session:
- Session stored in
~/.config/composter/session.json - Valid for 30 days
- Automatically refreshed on use
Example:
$ composter login
? Email: user@example.com
? Password: ********
✓ Login successful!Logout and clear your session.
Usage:
composter logoutExample:
$ composter logout
✓ Logged out successfullyCreate a new category to organize components.
Usage:
composter mkcat <category-name>Arguments:
category-name- Name of the category (alphanumeric, hyphens, underscores)
Example:
$ composter mkcat buttons
✓ Category 'buttons' created successfullyDelete a category and all its components.
Usage:
composter rmcat <category-name>Arguments:
category-name- Name of the category to delete
Warning: This permanently deletes all components in the category!
Example:
$ composter rmcat old-components
? Are you sure you want to delete 'old-components'? (y/N) y
✓ Category 'old-components' deletedList all your categories.
Usage:
composter lscatAlias:
composter lsExample:
$ composter lscat
Categories:
• buttons (5 components)
• forms (3 components)
• layouts (2 components)Add or update a component in your vault.
Usage:
composter push <category> <title> <file>Arguments:
category- Target category nametitle- Component name (must be unique within category)file- Path to component file (.jsx,.tsx,.js)
Options:
--description <text>- Component description--tags <tag1,tag2>- Comma-separated tags
Example:
$ composter push buttons "PrimaryButton" ./src/components/Button.jsx
✓ Component 'PrimaryButton' pushed to 'buttons'
# With description and tags
$ composter push buttons "PrimaryButton" ./Button.jsx \
--description "Primary action button" \
--tags "ui,button,primary"Download a component from your vault.
Usage:
composter pull <category> <title> <destination>Arguments:
category- Source category nametitle- Component namedestination- Local directory path
Example:
$ composter pull buttons "PrimaryButton" ./components/
✓ Component saved to ./components/PrimaryButton.jsx
$ composter pull forms "LoginForm" ./src/forms/
✓ Component saved to ./src/forms/LoginForm.jsxList all categories or components in a category.
Usage:
# List all categories
composter ls
# List components in a category
composter ls <category>Arguments:
category(optional) - Category to list components from
Example:
# List all categories
$ composter ls
Categories:
• buttons (5 components)
• forms (3 components)
# List components in category
$ composter ls buttons
Components in 'buttons':
• PrimaryButton
• SecondaryButton
• IconButton
• ToggleButton
• LinkButtonRemove a component from your vault.
Usage:
composter rm <category> <title>Arguments:
category- Category containing the componenttitle- Component name to delete
Example:
$ composter rm buttons "OldButton"
? Are you sure you want to delete 'OldButton' from 'buttons'? (y/N) y
✓ Component deletedSearch for components across all categories.
Usage:
composter search <query>Arguments:
query- Search term (searches titles and descriptions)
Example:
$ composter search modal
Found 3 components:
• ui/Modal
• dialogs/ConfirmModal
• overlays/ImageModalShow detailed information about a component.
Usage:
composter info <category> <title>Arguments:
category- Category containing the componenttitle- Component name
Example:
$ composter info buttons "PrimaryButton"
PrimaryButton
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Category: buttons
Created: 2024-12-15
Updated: 2024-12-18
Size: 1.2 KB
Description: Primary action button with hover effects
Tags: ui, button, primary
Preview URL: https://composter.vercel.app/components/123Show CLI version.
Usage:
composter --version
# or
composter -vExample:
$ composter --version
composter-cli version 1.0.11Show help for all commands.
Usage:
composter --help
# or
composter -h
# Help for specific command
composter <command> --helpExample:
$ composter push --help
Usage: composter push <category> <title> <file>
Push a component to your vault
Options:
--description <text> Component description
--tags <tags> Comma-separated tags
-h, --help Show helpConfigure CLI behavior with environment variables:
# Custom API base URL (for self-hosted instances)
export COMPOSTER_API_URL="https://your-api.com/api"
# Disable color output
export NO_COLOR=1
# Custom session file location
export COMPOSTER_SESSION_PATH="~/.composter/session.json"Create ~/.composterrc for persistent configuration:
{
"apiUrl": "https://composter.onrender.com/api",
"defaultCategory": "components",
"autoUpdate": true,
"colorOutput": true
}| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Authentication error |
| 3 | Network error |
| 4 | File not found |
| 5 | Invalid arguments |
# 1. Login
composter login
# 2. Create categories
composter mkcat ui
composter mkcat hooks
composter mkcat utils
# 3. Push components
composter push ui "Button" ./src/components/Button.jsx
composter push ui "Modal" ./src/components/Modal.jsx
composter push hooks "useFetch" ./src/hooks/useFetch.js
# 4. List everything
composter ls
# 5. Search for specific component
composter search modal
# 6. Pull component to new project
composter pull ui "Button" ./components/
# 7. Clean up old components
composter rm ui "OldButton"When working on the composter CLI itself, use the local package to iterate and debug quickly.
- Install and run locally:
cd cli
npm install
# Run a subcommand directly (use npx or node)
npx node ./bin/composter.js ls- Session file location (useful when testing auth):
~/.config/composter/session.json
- Run CLI against a local API instance by overriding the API URL:
export COMPOSTER_API_URL="http://localhost:3000/api"
npx node ./bin/composter.js ls- Tips:
- Use
DEBUGorNODE_DEBUGenv vars in the CLI package if you add logging. - When updating the CLI code, re-run the
npx node ./bin/composter.jscommand to pick up changes.
- Use
# Push multiple components
for file in ./src/components/*.jsx; do
name=$(basename "$file" .jsx)
composter push ui "$name" "$file"
done
# Pull all components from a category
composter ls buttons | while read component; do
composter pull buttons "$component" ./components/buttons/
doneAfter installing MCP integration, your AI assistant can use these commands:
You: "List my button components"
AI: [Uses composter ls buttons internally]
You: "Show me the Modal component code"
AI: [Uses composter pull to fetch and display code]
Run composter login to authenticate.
Use composter lscat to see available categories.
Use composter rm to delete the old version first, or the push will update it.
Check your internet connection and API status.
For more issues, see troubleshooting.md.