CLI Reference
The sigil command-line tool provides all development and runtime functionality.
Running Programs
Evaluating Files
sigil eval -f <file.sgl>Runs the specified Sigil source file.
Example:
sigil eval -f hello.sglEvaluating Expressions
sigil eval '<expression>'Evaluates a Sigil expression and prints the result.
Examples:
sigil eval '(+ 1 2 3)'
# Output: 6
sigil eval '(println "Hello!")'
# Output: Hello!Adding Library Paths
Use -L to add directories to the library search path:
sigil eval -L lib -f main.sglInteractive REPL
sigil replStarts an interactive Read-Eval-Print Loop. Type expressions to evaluate them. Press Ctrl+D or type ,q to exit.
Building Projects
sigil build
Build a package and its dependencies:
sigil build # Build all workspace packages
sigil build sigil-json # Build specific package with deps
sigil build sigil-cli --config release # Build with specific configConfigurations:
dev— Development build (default)debug— Debug build with symbolsrelease— Optimized release build with modules bundled into a self-contained executable
Running Your Application
sigil run
Build and run your application:
sigil run # Build dev config and run entry point
sigil run --config release # Build release config and run
sigil run -t <task-name> # Run a specific task insteadThe sigil run command automatically builds any out-of-date modules before running the application's entry point (defined by entry: in package.sgl).
Use -t or --task to run a specific task defined in package.sgl instead of the entry point.
Testing
sigil test
Run project tests:
sigil test
sigil test <pattern> # Run matching testsOther Commands
sigil repl
Start an interactive REPL:
sigil replsigil format
Format Sigil source files:
sigil format <file.sgl>
sigil format --check <file.sgl> # Check without modifyingsigil docs
Documentation tools:
sigil docs build <source> <output>
sigil docs serve <output>sigil cli
CLI management commands:
sigil cli install # Install sigil to ~/.sigil
sigil cli upgrade # Download latest version
sigil cli use <ver> # Switch to a specific version
sigil cli versions # List installed versions
sigil cli prune # Remove old versions
sigil cli env # Print shell configurationsigil changes
Release management:
sigil changes new # Create a new changeset
sigil changes status # Show pending changes
sigil changes version # Bump version based on changes
sigil changes changelog # Generate changelogGlobal Options
| Option | Description |
|---|---|
-v, --verbose | Verbose output |
-q, --quiet | Minimal output |
--version | Show version |
--help | Show help |
Environment Variables
| Variable | Description | Default |
|---|---|---|
SIGIL_PATH | Library search path (colon-separated) | Current directory |
SIGIL_HOME | Sigil installation directory | ~/.sigil |
NO_COLOR | Disable colored output | Not set |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Command-line usage error |
| 3 | Compilation error |
| 4 | Runtime error |
Examples
Development Workflow
# Create and run a new project
sigil init my-app
cd my-app
sigil run # Build and run the app
# Run a standalone script
sigil eval -f myprogram.sgl
# Run with library path
sigil eval -L lib -f main.sgl
# Start REPL for experimentation
sigil replBuilding for Distribution
# Build a package
sigil build sigil-cli --config release
# Install the CLI
./build/release/bin/sigil cli installRunning Tests
# Run all tests
sigil test
# Run specific tests
sigil test "test-parser"