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-projectvalidate
Validates a ForSure file without generating the structure:
bash
forsure validate <file>Example:
bash
forsure validate project.forsureinit
Creates a new ForSure file with a basic structure:
bash
forsure init [filename]Example:
bash
forsure init my-project.forsureCommon 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-projectValidate a ForSure file
bash
forsure validate project.forsureGenerate with verbose output
bash
forsure generate project.forsure --output ./my-project --verboseForce overwrite existing files
bash
forsure generate project.forsure --output ./my-project --forceConfiguration
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: