Command Reference
Complete reference for all FoundryKit CLI commands
Command Reference
Complete reference for all FoundryKit CLI commands, options, and usage examples.
Project Commands
foundrykit create
Create a new FoundryKit project.
foundrykit create <project-name> [options]Arguments:
project-name- Name of the project to create
Options:
--interactive, -i- Use interactive mode for setup--template <template>- Use a specific template--package-manager <manager>- Specify package manager (npm, yarn, pnpm)--typescript, -ts- Enable TypeScript--tailwind, -tw- Include Tailwind CSS--testing, -t- Include testing setup--linting, -l- Include linting setup--git, -g- Initialize Git repository--yes, -y- Skip prompts and use defaults
Examples:
# Basic project creation
foundrykit create my-app
# Interactive setup
foundrykit create my-app --interactive
# With specific options
foundrykit create my-app --typescript --tailwind --testing
# Skip prompts
foundrykit create my-app --yesfoundrykit init
Initialize FoundryKit in an existing project.
foundrykit init [options]Options:
--force, -f- Overwrite existing configuration--package-manager <manager>- Specify package manager--typescript, -ts- Enable TypeScript--tailwind, -tw- Include Tailwind CSS
Examples:
# Initialize in current directory
foundrykit init
# Force reinitialize
foundrykit init --force
# With specific features
foundrykit init --typescript --tailwindDevelopment Commands
foundrykit dev
Start the development server.
foundrykit dev [options]Options:
--port <port>- Specify port number (default: 3000)--host <host>- Specify host (default: localhost)--open, -o- Open browser automatically--https- Enable HTTPS--mode <mode>- Set mode (development, production)
Examples:
# Start development server
foundrykit dev
# Custom port and host
foundrykit dev --port 8080 --host 0.0.0.0
# Open browser automatically
foundrykit dev --open
# Enable HTTPS
foundrykit dev --httpsfoundrykit build
Build the project for production.
foundrykit build [options]Options:
--out-dir <dir>- Output directory (default: dist)--sourcemap- Generate source maps--minify- Minify output--mode <mode>- Set build mode--watch, -w- Watch for changes
Examples:
# Build for production
foundrykit build
# Custom output directory
foundrykit build --out-dir build
# Generate source maps
foundrykit build --sourcemap
# Watch mode
foundrykit build --watchfoundrykit preview
Preview the production build locally.
foundrykit preview [options]Options:
--port <port>- Specify port number (default: 4173)--host <host>- Specify host (default: localhost)--open, -o- Open browser automatically--out-dir <dir>- Build output directory
Examples:
# Preview production build
foundrykit preview
# Custom port
foundrykit preview --port 5000
# Open browser automatically
foundrykit preview --openComponent Commands
foundrykit add component
Add a new component to your project.
foundrykit add component <name> [options]Arguments:
name- Name of the component to create
Options:
--path <path>- Specify component path--typescript, -ts- Create TypeScript component--styled, -s- Include styled components--test, -t- Include test file--story, -st- Include Storybook story--docs, -d- Include documentation
Examples:
# Create basic component
foundrykit add component Button
# With TypeScript
foundrykit add component Button --typescript
# With tests and documentation
foundrykit add component Button --test --docs
# Custom path
foundrykit add component Button --path src/components/uifoundrykit add page
Add a new page to your project.
foundrykit add page <name> [options]Arguments:
name- Name of the page to create
Options:
--path <path>- Specify page path--typescript, -ts- Create TypeScript page--layout- Include layout component--test, -t- Include test file
Examples:
# Create basic page
foundrykit add page Home
# With TypeScript
foundrykit add page Home --typescript
# With layout
foundrykit add page Home --layoutTesting Commands
foundrykit test
Run tests for your project.
foundrykit test [options]Options:
--watch, -w- Watch mode--coverage- Generate coverage report--verbose- Verbose output--passWithNoTests- Pass if no tests found--testNamePattern <pattern>- Run tests matching pattern
Examples:
# Run all tests
foundrykit test
# Watch mode
foundrykit test --watch
# With coverage
foundrykit test --coverage
# Run specific tests
foundrykit test --testNamePattern "Button"foundrykit test:e2e
Run end-to-end tests.
foundrykit test:e2e [options]Options:
--browser <browser>- Specify browser (chrome, firefox, safari)--headless- Run in headless mode--port <port>- Specify port for dev server
Examples:
# Run e2e tests
foundrykit test:e2e
# Specific browser
foundrykit test:e2e --browser firefox
# Headless mode
foundrykit test:e2e --headlessLinting and Formatting
foundrykit lint
Run ESLint on your code.
foundrykit lint [options]Options:
--fix- Automatically fix problems--format <format>- Output format (stylish, json, html)--max-warnings <number>- Maximum number of warnings--cache- Use cache
Examples:
# Run linting
foundrykit lint
# Fix automatically
foundrykit lint --fix
# Custom format
foundrykit lint --format jsonfoundrykit format
Format your code with Prettier.
foundrykit format [options]Options:
--check- Check if files are formatted--write- Write formatted files--ignore-path <path>- Path to ignore file
Examples:
# Format all files
foundrykit format
# Check formatting
foundrykit format --check
# Write formatted files
foundrykit format --writeConfiguration Commands
foundrykit config
Manage FoundryKit configuration.
foundrykit config <command> [options]Commands:
show- Show current configurationupdate- Update configurationreset- Reset to defaultsvalidate- Validate configuration
Examples:
# Show configuration
foundrykit config show
# Update configuration
foundrykit config update
# Reset to defaults
foundrykit config reset
# Validate configuration
foundrykit config validatefoundrykit config show
Display the current configuration.
foundrykit config show [options]Options:
--json- Output as JSON--yaml- Output as YAML
Examples:
# Show configuration
foundrykit config show
# JSON output
foundrykit config show --jsonfoundrykit config update
Update the configuration interactively.
foundrykit config update [options]Options:
--file <path>- Configuration file path--force- Overwrite existing configuration
Examples:
# Interactive update
foundrykit config update
# Update specific file
foundrykit config update --file custom.config.jsDocumentation Commands
foundrykit docs
Manage project documentation.
foundrykit docs <command> [options]Commands:
generate- Generate documentationserve- Serve documentation locallybuild- Build documentation for production
Examples:
# Generate documentation
foundrykit docs generate
# Serve documentation
foundrykit docs serve
# Build documentation
foundrykit docs buildfoundrykit docs generate
Generate component documentation.
foundrykit docs generate [options]Options:
--out-dir <dir>- Output directory--format <format>- Output format (mdx, html)--components <path>- Components directory path
Examples:
# Generate documentation
foundrykit docs generate
# Custom output directory
foundrykit docs generate --out-dir docs
# Specific format
foundrykit docs generate --format htmlUtility Commands
foundrykit info
Display project information.
foundrykit info [options]Options:
--json- Output as JSON--verbose- Verbose output
Examples:
# Show project info
foundrykit info
# JSON output
foundrykit info --jsonfoundrykit update
Update FoundryKit CLI and dependencies.
foundrykit update [options]Options:
--check- Check for updates only--force- Force update--prerelease- Include prerelease versions
Examples:
# Check for updates
foundrykit update --check
# Update to latest version
foundrykit update
# Force update
foundrykit update --forcefoundrykit setup
Set up additional project features.
foundrykit setup <feature> [options]Features:
hooks- Set up Git hooksci- Set up CI/CDdeploy- Set up deploymentmonitoring- Set up monitoring
Examples:
# Set up Git hooks
foundrykit setup hooks
# Set up CI/CD
foundrykit setup ci
# Set up deployment
foundrykit setup deployGlobal Options
All commands support these global options:
--help, -h- Show help--version, -v- Show version--verbose- Verbose output--quiet- Suppress output--config <path>- Use custom config file--cwd <path>- Set working directory
Command Aliases
Common command aliases for convenience:
# Development
foundrykit d # foundrykit dev
foundrykit serve # foundrykit dev
# Building
foundrykit b # foundrykit build
foundrykit p # foundrykit preview
# Testing
foundrykit t # foundrykit test
foundrykit test:e2e # foundrykit test:e2e
# Linting
foundrykit l # foundrykit lint
foundrykit f # foundrykit format
# Configuration
foundrykit c # foundrykit config
foundrykit conf # foundrykit config
# Documentation
foundrykit doc # foundrykit docsExit Codes
The CLI uses standard exit codes:
0- Success1- General error2- Configuration error3- Build error4- Test failure5- Lint error
Environment Variables
The CLI respects these environment variables:
FOUNDRYKIT_CONFIG- Path to config fileFOUNDRYKIT_DEBUG- Enable debug modeFOUNDRYKIT_SILENT- Suppress outputFOUNDRYKIT_CWD- Working directory
Next Steps
- Learn about configuration options for customization
- Explore advanced usage for complex workflows
- Review best practices for optimal CLI usage