CLI Reference
Learn how to use the ForSure command-line interface.
Basic Usage
The ForSure CLI provides commands for generating file structures from ForSure files:
bash
forsure [command] [options]
Commands
generate
Generates a file structure from a ForSure file:
bash
forsure generate <file> --output <directory>
Example:
bash
forsure generate project.forsure --output ./my-project
validate
Validates a ForSure file without generating the structure:
bash
forsure validate <file>
Example:
bash
forsure validate project.forsure
init
Creates a new ForSure file with a basic structure:
bash
forsure init [filename]
Example:
bash
forsure init my-project.forsure
Common Options
Option | Description |
---|---|
--output, -o | Specify the output directory |
--force, -f | Overwrite existing files |
--dry-run, -d | Show what would be generated without actually creating files |
--verbose, -v | Show detailed output |
--help, -h | Show help information |
Examples
Generate a project structure
bash
forsure generate project.forsure --output ./my-project
Validate a ForSure file
bash
forsure validate project.forsure
Generate with verbose output
bash
forsure generate project.forsure --output ./my-project --verbose
Force overwrite existing files
bash
forsure generate project.forsure --output ./my-project --force
Configuration
You can configure the ForSure CLI using a configuration file:
.forsurerc.json
json
{
"defaultOutput": "./output",
"ignorePatterns": [
"node_modules",
".git"
],
"attributes": {
"defaultPermissions": "644"
}
}
Learn more about configuration options:
CLI Configuration →Next Steps
Now that you understand the CLI, you can: