ForSure Logo
ForSure
CLILanguageDocumentationComponents

Getting Started

IntroductionInstallationQuick StartDownloads

Syntax

Basic SyntaxFile StructureCommentsAttributesImport Directives

AI & Neural Network

OverviewExamplesAdvanced FeaturesTeam UsageAPI Reference

Examples

Basic ExamplesIntermediate ExamplesAdvanced Examples

CLI Reference

CommandsOptionsConfiguration

API Reference

OverviewNode APIProgrammatic Usage

Tools & Extensions

VS Code ExtensionSyntax HighlightingEditor Integrations
ForSure Logo
ForSure

A powerful file structure definition language and CLI tool for developers.

GitHubTwitter

Products

CLI LanguageWeb EditorIDE Extensions

Resources

DocumentationExamplesTemplatesBlog

Company

AboutCareersContactPrivacy Policy

© 2026 ForSure. All rights reserved.

TermsPrivacyCookies

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]

Core 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

Code Generation Commands

gen component

Generate a new React component with TypeScript support:

bash
forsure gen component -n my-button -t basic --typescript --test --storybook

gen hook

Generate a custom React hook:

bash
forsure gen hook -n use-data-fetcher -t api --typescript --test

gen utility

Generate a utility function:

bash
forsure gen utility -n format-currency --typescript --test

gen page

Generate a Next.js page:

bash
forsure gen page -n dashboard -t admin --typescript --test

gen layout

Generate a layout component:

bash
forsure gen layout -n main-layout -t default --typescript --test

Design System Commands

design tokens

Generate CSS variables from design tokens:

bash
forsure design tokens --format css

Generate SCSS variables:

bash
forsure design tokens --format scss

Watch for changes and auto-generate:

bash
forsure design tokens --watch

Project Management Commands

setup

Setup development environment:

bash
forsure setup

clean

Clean build artifacts:

bash
forsure clean

lint

Lint and fix code:

bash
forsure lint --fix

test

Run tests with coverage:

bash
forsure test --coverage

build

Build project for production:

bash
forsure build --production

publish

Publish package to registry:

bash
forsure publish --registry npm --tag latest

Common Options

OptionDescription
--output, -oSpecify the output directory
--force, -fOverwrite existing files
--dry-run, -dShow what would be generated without actually creating files
--verbose, -vShow detailed output
--help, -hShow 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:

  • Explore all CLI options
  • Learn about the programmatic API
  • See more examples