CLI REFERENCE

COMPLETE COMMAND REFERENCE

The FYT CLI is your primary tool for content management and build operations. Built in Go for speed and reliability.

INSTALLATION & SETUP

Getting started with the CLI
Prerequisites:
  • Go 1.21+ installed
  • Git for version control
  • Text editor (vi/vim/nano/VSCode)
Build the CLI:
BASH
# Clone the repository
git clone https://github.com/b7r-dev/fyt.git
cd fyt

# Build the CLI
make build

# Verify installation
./fyt --version
Quick Start:
BASH
# Initialize new project
./fyt init my-project

# Or initialize in current directory
./fyt init .

# Show help
./fyt --help

COMMAND CATEGORIES

Organized by function
CategoryCommandsPurpose
Project`init`Initialize new project
Content`content add`, `content list`, `content remove`CRUD operations
Validation`validate`Check content integrity
Build`build`, `dev`Build and development
Help`--help`, `--version`Documentation

PROJECT MANAGEMENT

Initialize and configure projects
./fyt init [directory]
Initialize a new FYT project with default structure.
Syntax:
BASH
./fyt init <directory>
./fyt init .              # Current directory
Example:
BASH
# Create new project
./fyt init my-brutal-site
cd my-brutal-site

# Initialize in current directory
mkdir my-site && cd my-site
./fyt init .
Creates:
  • content/ directory structure
  • src/ React components
  • package.json with dependencies
  • esbuild.config.cjs build configuration
  • README.md project documentation

CONTENT ADD

Create new content
./fyt content add [type] [name]
Create new content files with proper structure.
Syntax:
BASH
./fyt content add page <name>
./fyt content add component <name>
./fyt content add blog <title>
Examples:
BASH
# Add new page
./fyt content add page pricing
# Creates: content/pages/pricing.yaml

# Add component documentation
./fyt content add component brutal-modal
# Creates: content/components/brutal-modal.yaml

# Add blog post
./fyt content add blog "Brutal Design Principles"
# Creates: content/blog/2025-01-20-brutal-design-principles.yaml
Generated Template:
YAML
meta:
  title: "Page Title"
  description: "Page description"
  slug: "/page-name"

hero:
  title: "HERO TITLE"
  subtitle: "Hero subtitle"
  lead_text: "Lead paragraph"

sections:
  - id: "section-1"
    type: "content"
    title: "Section Title"
    content: |
      Content goes here
    variant: "brutal"

CONTENT LIST

View all content
./fyt content list
List all content files in the project.
Syntax:
BASH
./fyt content list [--type=<type>]
Examples:
BASH
# List all content
./fyt content list

# List only pages
./fyt content list --type=page

# List only blog posts
./fyt content list --type=blog
Output:
TEXT
PAGES (5):
  - about.yaml → /about
  - build.yaml → /build
  - docs.yaml → /docs
  - home.yaml → /
  - pricing.yaml → /pricing

BLOG POSTS (3):
  - 2025-01-15-welcome.yaml → /blog/welcome
  - 2025-01-20-brutal-design.yaml → /blog/brutal-design
  - 2025-01-25-performance.yaml → /blog/performance

COMPONENTS (8):
  - button.yaml
  - card.yaml
  - typography.yaml
  ...

CONTENT REMOVE

Delete content safely
./fyt content remove [name]
Remove content files with confirmation.
Syntax:
BASH
./fyt content remove <name>
./fyt content remove <name> --force
Examples:
BASH
# Remove page (with confirmation)
./fyt content remove pricing

# Remove without confirmation
./fyt content remove pricing --force

# Remove blog post
./fyt content remove blog/welcome
Confirmation Prompt:
TEXT
Remove content/pages/pricing.yaml? (y/N): y
✓ Removed content/pages/pricing.yaml
⚠ Check for broken links: ./fyt validate

VALIDATION

Check content integrity
./fyt validate
Validate all content files for syntax and structure errors.
Syntax:
BASH
./fyt validate [--strict]
Examples:
BASH
# Standard validation
./fyt validate

# Strict mode (fails on warnings)
./fyt validate --strict
Checks:
YAML syntax validity
Required fields present
No markdown headings in content fields
Slug uniqueness
Internal link validity
File naming conventions
Output:
TEXT
Validating content...

✓ content/pages/about.yaml
✓ content/pages/build.yaml
✗ content/pages/pricing.yaml
  - Missing required field: meta.description
  - Invalid slug format: /pricing/

2 files valid, 1 file with errors

COMMON WORKFLOWS

Command combinations
Create and Edit Page:
BASH
# Create new page
./fyt content add page features

# Edit with vi
vi content/pages/features.yaml

# Validate
./fyt validate

# Build and preview
npm run dev
Update Existing Content:
BASH
# List all content
./fyt content list

# Edit specific file
vi content/pages/about.yaml

# Validate changes
./fyt validate
Delete and Clean Up:
BASH
# Remove content
./fyt content remove old-page

# Check for broken links
./fyt validate

# Fix any broken links
vi content/pages/home.yaml

NEXT STEPS

Learn More: