Build, deploy, and manage Server-Driven UI projects with the Stac CLI.
curl -fsSL https://raw.githubusercontent.com/StacDev/cli-installer/main/install.sh | bashirm https://raw.githubusercontent.com/StacDev/cli-installer/main/install.ps1 | iexAfter installation, verify that Stac CLI is working:
stac --versionThe CLI will be installed to ~/.stac/bin/ and automatically added to your PATH.
| Command | Description | Requires Auth |
|---|---|---|
login | Authenticate with Google OAuth | ❌ |
logout | Clear stored authentication tokens | ❌ |
status | Show authentication status | ❌ |
init | Initialize Stac in project | ✅ |
build | Convert Dart widgets to JSON | ❌ |
deploy | Build and deploy to Stac Cloud | ✅ |
project list | List all cloud projects | ✅ |
project create | Create new cloud project | ✅ |
Before using most CLI commands, you'll need to authenticate with Stac Cloud.
# Authenticate with Google OAuth stac login # This opens your browser for OAuth authentication # Your credentials are securely stored locally# Check your authentication status stac status# Clear stored authentication tokens stac logoutUse this to set up Stac in an existing Flutter/Dart project. It links your local app to a Stac Cloud project and scaffolds required files.
⚠️ Note: You must be authenticated (stac login) before runningstac init.
# Initialize Stac in the current project stac init- ✅ Creates
stac/folder for Stac DSL widgets - ✅ Adds
lib/default_stac_options.dartwith yourStacOptions(e.g.,projectId) - ✅ Updates
pubspec.yamlwithstacand related dependencies - ✅ Optionally links to an existing Stac Cloud project
your-flutter-project/ ├── lib/ │ ├── default_stac_options.dart │ └── main.dart ├── stac/ │ └── stac_widget.dart └── pubspec.yaml # Build all widgets in current project stac build # Build specific project directory stac build --project /path/to/project # Build with validation (enabled by default) stac build --validate # Build with verbose output stac build --verbose| Option | Description | Default |
|---|---|---|
-p, --project | Project directory path | Current directory |
--validate | Validate generated JSON | true |
-v, --verbose | Show detailed build output | false |
The build command converts Stac widget definitions from the stac/ folder into JSON format in the build/ folder.
# Build and deploy to Stac Cloud stac deploy # Deploy specific project directory stac deploy --project /path/to/project # Skip build and deploy existing files stac deploy --skip-build # Deploy with verbose output stac deploy --verbose| Option | Description | Default |
|---|---|---|
-p, --project | Project directory path | Current directory |
--skip-build | Skip building before deployment | false |
-v, --verbose | Show detailed deployment output | false |
Note: By default,
stac deployautomatically runsstac buildbefore deploying. Use--skip-buildto deploy existing build files without rebuilding.
# List all your Stac Cloud projects stac project list # Output as JSON format stac project list --jsonThe list command shows:
- 📋 Project name and ID
- 📝 Project description
- 📅 Created and updated timestamps
# Create a new project on Stac Cloud stac project create --name "My App" --description "My SDUI app" # Short form stac project create -n "My App" -d "My SDUI app"After creating a project, run stac init to initialize it locally.
Here's a typical workflow to get started with Stac CLI:
# 1. Authenticate with Stac Cloud (one-time setup) stac login # 2. List available projects (optional) stac project list # 3. Navigate to your Flutter/Dart project cd your-flutter-project # 4. Initialize Stac in your project stac init # 5. Create your widget definitions in the stac/ folder # Edit stac/your_screen.dart with your Stac widgets # 6. Build and deploy to Stac Cloud stac deployOnce set up, your typical development cycle will be:
# Make changes to widgets in stac/ folder # ... # Build and deploy changes stac deploy # Or build locally first to test stac build stac deploy --skip-build| Option | Description |
|---|---|
-v, --verbose | Show additional command output |
--version | Print tool version |
--help | Print usage information |