CLI reference
Complete reference for SuperDeck CLI commands and options
CLI reference
The SuperDeck CLI provides tools for setting up, building, and publishing presentations. This reference covers all commands and options.
Global options
These options work with all commands:
| Option | Short | Description |
|---|---|---|
--verbose | -v | Enable verbose logging |
--version | Print the current version | |
--quiet | -q | Suppress output except errors |
--help | -h | Show help information |
superdeck setup
Initialize SuperDeck in a Flutter project. Creates a sample slides.md file, updates pubspec.yaml with asset configuration, sets up macOS entitlements for network access, and configures a custom index.html for web.
superdeck setup
Options:
| Option | Short | Description |
|---|---|---|
--force | -f | Skip confirmation prompts |
--[no-]setup-web | Set up a custom web/index.html (default: true) |
superdeck build
Build presentations from markdown files. Parses slides.md, generates presentation data in .superdeck/superdeck.json, and creates optimized assets.
superdeck build [options]
Options:
| Option | Short | Description |
|---|---|---|
--watch | -w | Watch for file changes and rebuild automatically |
--skip-pubspec | Skip updating pubspec.yaml | |
--force-rebuild | -f | Force rebuild all assets |
Examples:
# Build once
superdeck build
# Build and watch for changes (recommended for development)
superdeck build -w
# Force rebuild everything
superdeck build -f
superdeck publish
Publish presentation to GitHub Pages. Builds the web version with proper base-href, commits to the target branch using git worktree, and optionally pushes to remote.
superdeck publish [options]
Options:
| Option | Short | Description |
|---|---|---|
--branch <name> | -b | Target branch (default: gh-pages) |
--message <msg> | -m | Commit message |
--push | Push changes to remote (default: true, use --no-push to skip) | |
--build | Build web app before publishing (default: true, use --no-build to skip) | |
--build-dir <path> | Build output directory (default: build/web) | |
--example-dir <path> | Project directory (default: .) | |
--dry-run | Show what would be done without making changes |
Examples:
# Publish to gh-pages branch
superdeck publish
# Publish with custom message
superdeck publish -m "Update presentation"
# Skip build step (if already built)
superdeck publish --no-build
# Preview without making changes
superdeck publish --dry-run
File structure
After running CLI commands, your project will have:
project/
├── slides.md # Your presentation content
├── pubspec.yaml # Updated with asset configuration
├── .superdeck/
│ ├── superdeck.json # Generated presentation data
│ ├── superdeck_full.json # Includes markdown AST JSON (for debugging)
│ ├── generated_assets.json # Asset manifest
│ ├── build_status.json # Last build status
│ └── assets/ # Generated assets (for example, Mermaid PNGs)
│ ├── mermaid_<hash>.png
│ └── thumbnail_<slideKey>.png # Generated at runtime
└── web/
└── index.html # Custom index with loading indicator
pubspec.yaml updates
The CLI automatically adds this to your pubspec.yaml:
flutter:
assets:
- .superdeck/
- .superdeck/assets/
macOS entitlements
For macOS projects, superdeck setup updates macos/Runner/Release.entitlements and macos/Runner/DebugProfile.entitlements to allow network access (required for remote images and DartPad):
<key>com.apple.security.app-sandbox</key>
<false/>
<key>com.apple.security.network.client</key>
<true/>
In debug builds, it also enables com.apple.security.network.server and com.apple.security.cs.allow-jit.
Development workflow
# Terminal 1: Start CLI in watch mode
superdeck build --watch
# Terminal 2: Run Flutter app
flutter run
Publishing workflow
# Build and test locally
superdeck build
flutter run -d web
# Publish to GitHub Pages
superdeck publish
Troubleshooting workflow
# Verbose output for debugging
superdeck build --verbose
# Force rebuild if assets are corrupted
superdeck build --force-rebuild
# Check what publish would do
superdeck publish --dry-run
Exit codes
| Code | Description |
|---|---|
| 0 | Success |
| 64 | Invalid arguments |
| 65 | Invalid data (config/YAML) |
| 69 | Required file missing (for example, slides.md) |
| 70 | Command failed |
| 74 | File system error |
Build fails
Problem: Error: slides.md not found
Solution: Ensure slides.md exists in project root or run superdeck setup
Problem: Error: Invalid markdown syntax
Solution: Check your markdown syntax, especially block definitions and frontmatter
Publish fails
Problem: Error: Not a git repository
Solution: Initialize git repository: git init && git add . && git commit -m "Initial commit"
Problem: Error: No changes to commit
Solution: This is informational. Make a change (or run superdeck build --force-rebuild) and publish again.
Watch mode issues
Problem: Changes not detected
Solution: Ensure you're editing slides.md in the project root
Problem: Build errors in watch mode Solution: Fix the error and save again; watch mode will retry automatically
Performance tips
- Use watch mode -
superdeck build --watchis optimized for development - Cache remote images - Remote images are cached at runtime by
cached_network_image - Skip pubspec updates - Use
--skip-pubspecif you manage assets manually - Incremental builds - Only changed assets are rebuilt by default