TuMarca

CLI

Use the Saastro CLI to add components to your project.

CLI

The Saastro CLI helps you initialize your project and add components.

Installation

You can run the CLI directly with npx:

npx saastro <command>

Or install it globally:

npm install -g saastro

Commands

init

Initialize your project with Saastro UI configuration.

npx saastro init

This command will:

  • Create a components.json configuration file
  • Configure your Tailwind CSS
  • Add required CSS variables
  • Set up the cn utility function

Options:

OptionDescription
-y, --yesSkip confirmation prompts
-c, --cwd <path>Set working directory

add

Add components to your project.

npx saastro add [components...]

Examples:

# Add a single component
npx saastro add button

# Add multiple components
npx saastro add button card badge

# Add all components
npx saastro add --all

Options:

OptionDescription
-y, --yesSkip confirmation prompts
-o, --overwriteOverwrite existing files
-a, --allAdd all available components
-p, --path <path>Custom path for components

diff

Check for updates to components.

npx saastro diff [component]

Shows the difference between your local component and the registry version.

Configuration

The CLI uses a components.json file in your project root:

{
  "$schema": "https://ui.saastro.io/schema.json",
  "style": "default",
  "tailwind": {
    "config": "tailwind.config.mjs",
    "css": "src/styles/globals.css",
    "baseColor": "slate"
  },
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils"
  }
}

Configuration Options

PropertyDescription
styleThe style preset to use (default, new-york)
tailwind.configPath to your Tailwind config file
tailwind.cssPath to your global CSS file
tailwind.baseColorBase color for the theme
aliases.componentsImport alias for components
aliases.utilsImport alias for utilities

Registry

Components are fetched from the Saastro registry at https://ui.saastro.io/r/.

You can also use a custom registry by setting the SAASTRO_REGISTRY_URL environment variable.