FoundryKit

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 --yes

foundrykit 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 --tailwind

Development 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 --https

foundrykit 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 --watch

foundrykit 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 --open

Component 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/ui

foundrykit 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 --layout

Testing 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 --headless

Linting 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 json

foundrykit 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 --write

Configuration Commands

foundrykit config

Manage FoundryKit configuration.

foundrykit config <command> [options]

Commands:

  • show - Show current configuration
  • update - Update configuration
  • reset - Reset to defaults
  • validate - Validate configuration

Examples:

# Show configuration
foundrykit config show

# Update configuration
foundrykit config update

# Reset to defaults
foundrykit config reset

# Validate configuration
foundrykit config validate

foundrykit 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 --json

foundrykit 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.js

Documentation Commands

foundrykit docs

Manage project documentation.

foundrykit docs <command> [options]

Commands:

  • generate - Generate documentation
  • serve - Serve documentation locally
  • build - Build documentation for production

Examples:

# Generate documentation
foundrykit docs generate

# Serve documentation
foundrykit docs serve

# Build documentation
foundrykit docs build

foundrykit 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 html

Utility 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 --json

foundrykit 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 --force

foundrykit setup

Set up additional project features.

foundrykit setup <feature> [options]

Features:

  • hooks - Set up Git hooks
  • ci - Set up CI/CD
  • deploy - Set up deployment
  • monitoring - Set up monitoring

Examples:

# Set up Git hooks
foundrykit setup hooks

# Set up CI/CD
foundrykit setup ci

# Set up deployment
foundrykit setup deploy

Global 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 docs

Exit Codes

The CLI uses standard exit codes:

  • 0 - Success
  • 1 - General error
  • 2 - Configuration error
  • 3 - Build error
  • 4 - Test failure
  • 5 - Lint error

Environment Variables

The CLI respects these environment variables:

  • FOUNDRYKIT_CONFIG - Path to config file
  • FOUNDRYKIT_DEBUG - Enable debug mode
  • FOUNDRYKIT_SILENT - Suppress output
  • FOUNDRYKIT_CWD - Working directory

Next Steps