Detailed reference for all CampsiteJS CLI commands with examples and options.
Help & Version
camper --help / camper -h
Shows comprehensive help with all commands, examples, and descriptions.
camper --help
Output includes:
- All available commands organized by category
- Usage examples for each command
- Command aliases and shortcuts
- Tips for getting started
camper --version / camper -v
Displays the current version of basecampjs installed.
camper --version
# Output: 0.0.8
Project Initialization
camper init
Initializes Campsite in the current directory. This command sets up a minimal project structure for an existing directory.
camper init
What it creates:
src/pages/- Directory for page contentsrc/layouts/- Directory for layout templatespublic/- Directory for static assetscampsite.config.js- Configuration filepackage.json- Node.js dependencies.gitignore- Git ignore rules- Sample page and basic layout
Features:
- Detects if already initialized and warns you
- Creates sensible defaults based on detected template engine
- Non-destructive (wonβt overwrite existing files)
Example output:
ποΈ Initializing Campsite in current directory...
β
Created src/pages/
β
Created src/layouts/
β
Created public/
β
Created campsite.config.js
β
Created package.json
β
Created .gitignore
β
Created src/pages/index.njk
β
Created src/layouts/base.njk
π² Campsite initialized! Run 'camper dev' to start.
Development Commands
camper dev
Starts the development server with hot reloading. Watches src/ and public/ directories for changes.
camper dev
Features:
- Hot module reloading
- Auto-rebuild on file changes
- Live browser refresh
- Development-optimized builds (faster, unminified)
- Detailed error messages
Default server:
- URL:
http://localhost:3000 - Configurable port via config file
Example output:
ποΈ Starting Campsite dev server...
π₯ Watching for changes in src/ and public/
β
Dev server running at http://localhost:3000
π² Happy camping!
camper build
Creates an optimized production build. Outputs to dist/ (or configured outDir).
camper build
Production optimizations:
- Minified HTML (if
minifyHTML: true) - Minified CSS (if
minifyCSS: true) - Cache-busted assets (if
cacheBustAssets: true) - Optimized file structure
- Static file copying
Example output:
ποΈ Building your Campsite...
π Processing pages... (23 pages)
π¨ Processing layouts... (5 layouts)
π§© Processing partials... (8 partials)
π¦ Processing collections... (3 collections)
β
Build complete! Output: ./dist/
π² Ready to deploy!
camper serve
Serves the built site from dist/ directory on http://localhost:4173.
camper serve
Use cases:
- Preview production build locally
- Test optimizations and minification
- Verify cache-busting
- Check relative paths
Example output:
ποΈ Serving built site from dist/
π₯ Server running at http://localhost:4173
πΊοΈ Press Ctrl+C to stop
camper preview
Combines build + serve for quick production testing.
camper preview
Equivalent to:
camper build && camper serve
Utility Commands
camper clean
Removes the dist/ folder (or configured outDir) for fresh builds.
camper clean
Use cases:
- Clean up before deployment
- Resolve build caching issues
- Free up disk space
Example output:
ποΈ Cleaning build directory...
β
Removed dist/
π² Fresh start ready!
camper check
Validates project structure, configuration, and dependencies.
camper check
Checks performed:
campsite.config.jsexists and is valid- Required directories exist (
src/pages,src/layouts) - Pages directory has content
- Layouts directory has templates
package.jsonexists- Dependencies are installed
Example output:
ποΈ Checking Campsite project...
β
campsite.config.js found
β
src/pages/ directory exists (23 pages)
β
src/layouts/ directory exists (5 layouts)
β
package.json found
β οΈ Tip: Add src/partials/ for reusable components
β
Project structure looks good!
π² Happy camping!
camper list
Lists all content with counts organized by type.
camper list
Shows:
- Pages (with file paths)
- Layouts
- Components
- Partials
- Collections
- Data files
Example output:
ποΈ Campsite Content Overview
π Pages (23):
- src/pages/index.njk
- src/pages/about.njk
- src/pages/docs/index.md
...
π¨ Layouts (5):
- src/layouts/base.njk
- src/layouts/docs.njk
...
π§© Partials (8):
- src/partials/hero.njk
- src/partials/navbar.njk
...
π¦ Collections (3):
- src/collections/site.json
- src/collections/navbar.json
...
π² Total: 39 files
camper upgrade
Updates basecampjs to the latest version.
camper upgrade
Process:
- Checks current version
- Fetches latest version from npm
- Runs
npm install basecampjs@latest - Shows new version
Example output:
ποΈ Checking for updates...
π¦ Current version: 0.0.7
π¦ Latest version: 0.0.8
β¬οΈ Upgrading basecampjs...
β
Successfully upgraded to 0.0.8
π² Enjoy the new features!
Next Steps
- Make Commands - Learn about content creation commands
- Configuration - Customize your setup
- CLI Overview - Back to CLI overview
π§ Quick Reference: Run camper --help anytime to see all commands!