CLI Reference
The Presetter CLI provides powerful commands for managing your project configuration and running scripts efficiently.
Available Commands
Project Setup
presetter bootstrap- Setup project according to specified preset
Script Execution
presetter run <task>- Run a single script or taskpresetter run-s <tasks...>- Run multiple scripts sequentiallypresetter run-p <tasks...>- Run multiple scripts in parallel
Command Shortcuts
For convenience, Presetter provides these standalone binaries:
run→presetter runrun-s→presetter run-srun-p→presetter run-p
Global Options
All commands support these global options:
--help- Show help information for the command--version- Show version number
Advanced Pattern Matching
Presetter supports sophisticated task selection patterns:
Single-level Wildcards (*)
test:*- Run all direct subtasks oftestbuild:*- Run all direct subtasks ofbuild
Multi-level Wildcards (**)
test:**- Run all test-related tasks at any depthbuild:**- Run all build-related tasks recursively
Specific Pattern Examples
# Available tasks: task1, task1:subtask1, task1:subtask2, task1:subtask1:deep
presetter run "task1:*" # Runs: task1:subtask1, task1:subtask2
presetter run "task1:**" # Runs: task1:subtask1, task1:subtask2, task1:subtask1:deep
presetter run "task1:*:deep" # Runs: task1:subtask1:deep
Argument Handling
Global Arguments
Use -- to separate global arguments that apply to all tasks:
presetter run-s lint test build -- --verbose --strict
Task-Specific Arguments
For sequential and parallel execution, specify arguments per task:
presetter run-s "lint -- --fix" "test -- --coverage" "build -- --minify"
Argument Substitution
Use {@} to inject global arguments into specific positions:
presetter run-s "test -- {@} --coverage" "lint -- --fix {@}" -- --verbose
# Expands to: test --verbose --coverage && lint --fix --verbose
Quick Start Examples
Basic Usage
# Setup project with preset
presetter bootstrap
# Run single task
presetter run build
# Run with arguments
presetter run test -- --watch
Sequential Execution
# Basic sequence
presetter run-s clean build
# With arguments
presetter run-s "lint -- --fix" "test -- --coverage" build
Parallel Execution
# Run multiple tasks simultaneously
presetter run-p lint test typecheck
# With arguments
presetter run-p "test -- --watch" "lint -- --cache"
Pattern-Based Selection
# Run all test variants
presetter run "test:*"
# Run all build-related tasks
presetter run "build:**"
Integration with Package Scripts
Presetter merges template scripts with your local package.json scripts, with local scripts taking priority:
{
"scripts": {
"build": "presetter run build",
"test": "presetter run test",
"ci": "presetter run-s lint test build"
}
}
Error Handling
- Exit codes: Commands return appropriate exit codes for CI/CD integration
- Script failures: In sequential mode, execution stops on first failure
- Parallel failures: All tasks complete, but command fails if any task fails
- Pattern matching: No error if pattern matches no tasks (returns success)
Next Steps
Explore each command in detail: