CLI Reference
Complete reference for Frontfriend CLI commands
CLI Reference
The Frontfriend CLI helps you manage design tokens and components in your project.
Installation
The CLI is included when you install the Frontfriend package:
Global Options
All commands support these global options:
--verbose- Enable verbose output for debugging--help- Show help for any command
Commands
init
Initialize or update design tokens from your Frontfriend project.
Options:
--force- Force refresh tokens, ignoring cache
Examples:
status
Check your Frontfriend configuration and cache status.
Output includes:
- Configuration file location and validity
- ff-id from config
- Cache status and age
- Token summary
add
Add generated pages or entire projects from the Frontfriend platform to your local codebase.
Arguments:
<type>- Eitherpageorproject<id>- The page ID or project ID from Frontfriend platform
Options:
--name <name>- Custom name for the component (default: derives from page title)--path <path>- Custom output path (default:src/pages)--force- Overwrite existing files without prompting--pages <ids>- When adding a project, specify which pages to include (comma-separated)
Examples:
Features:
- Automatically downloads required UI components
- Converts imports to use your local component paths
- Handles component naming and exports
- Shows progress for multi-page imports
- Validates ff-id to ensure pages belong to your design system
download
Download pre-built components to your project.
Arguments:
<components...>- Component names to download (orallfor all components)
Note: When using all, the command will download both standard components and any custom components specific to your ff-id.
Options:
-f, --framework <framework>- Framework version (react or vue)-o, --output <path>- Custom output directory--overwrite- Overwrite existing files
Examples:
Post-download: After successful downloads, the CLI will display any required dependencies that need to be installed.
clean
Clear the Frontfriend token cache.
Configuration
The CLI reads configuration from frontfriend.config.js in your project root.
Config Format
Config Options
ff-id(required) - Your Frontfriend project IDaliases(optional) - Path aliases for component downloadsui- Where UI components should be downloaded
Exit Codes
0- Success1- General error2- Configuration error3- Network error4- Invalid arguments
Troubleshooting
Command not found
Ensure you're using npx or have added to package.json scripts:
Permission errors
On Unix systems, you may need to make the CLI executable:
Behind a proxy
Set standard Node.js proxy environment variables: