sigildocs

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.sgl

Evaluating 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.sgl

Interactive REPL

sigil repl

Starts 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 config

Configurations:

  • dev — Development build (default)
  • debug — Debug build with symbols
  • release — 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 instead

The 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 tests

Other Commands

sigil repl

Start an interactive REPL:

sigil repl

sigil format

Format Sigil source files:

sigil format <file.sgl>
sigil format --check <file.sgl>  # Check without modifying

sigil 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 configuration

sigil 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 changelog

Global Options

OptionDescription
-v, --verboseVerbose output
-q, --quietMinimal output
--versionShow version
--helpShow help

Environment Variables

VariableDescriptionDefault
SIGIL_PATHLibrary search path (colon-separated)Current directory
SIGIL_HOMESigil installation directory~/.sigil
NO_COLORDisable colored outputNot set

Exit Codes

CodeMeaning
0Success
1General error
2Command-line usage error
3Compilation error
4Runtime 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 repl

Building for Distribution

# Build a package
sigil build sigil-cli --config release

# Install the CLI
./build/release/bin/sigil cli install

Running Tests

# Run all tests
sigil test

# Run specific tests
sigil test "test-parser"