Skip to main content

Overview

The Soul CLI provides a comprehensive set of commands for developing, building, and managing Soul applications. This guide covers all available commands and their usage.

Global Flags

These flags can be used with any Soul command:

Core Commands

soul run - Execute Soul Programs

Run Soul source code directly without compilation:
Features:
  • Executes Soul programs immediately without creating binaries
  • Auto-installs missing packages by scanning imports
  • Validates that exactly one genesis() function exists
  • Creates temporary executable for execution
  • Supports path aliases defined in soul.json
Requirements:
  • Must have exactly one genesis() function with no parameters
  • All dependencies must be available or auto-installable

soul build - Compile Soul Programs

Compile Soul source code into standalone executables:
Features:
  • Creates self-contained executable binaries
  • Embeds source code in the executable
  • Auto-installs missing packages before compilation
  • Validates package dependencies
  • Output binary has same name as source file (without extension)
Output:
  • Standalone executable that doesn’t require Soul runtime
  • Can be distributed and run on systems without Soul installed

Version Management

soul version - Check Version

Display the current Soul version:

soul update - Update Soul

Update Soul to the latest version:
How it works:
  1. Fetches latest version from GitHub releases
  2. Downloads platform-specific archive (macOS, Linux, Windows)
  3. Extracts and replaces current Soul binary
  4. Automatically handles ARM64 and AMD64 architectures
  5. Creates backup and rolls back on failure

Package Management

Soul includes a comprehensive package management system accessed through the pkg subcommands.

soul pkg init - Initialize Package

Create a new Soul package with soul.json manifest:
This creates a soul.json file with:

soul pkg install - Install Dependencies

Install all dependencies from soul.json:

soul pkg list - List Available Packages

View all packages in the Soul package registry:
Output includes:
  • Package names with latest versions
  • Package descriptions and categories
  • All available versions
  • Total package count

soul pkg search - Search Packages

Search for packages by name, description, or keywords:
Search covers:
  • Package names
  • Descriptions
  • Keywords
  • Categories

soul pkg validate - Validate Dependencies

Check package dependencies and version constraints:
Validates:
  • Soul version compatibility
  • All dependency version constraints
  • Package compatibility across the project
  • Displays dependency summary with installed versions

soul pkg tidy - Tidy Dependencies

Automatically manage dependencies based on imports:
Features:
  • Creates soul.json if it doesn’t exist
  • Scans all .soul files for import statements
  • Extracts and adds package dependencies
  • Updates existing soul.json with new dependencies
  • Ignores relative imports and file paths

soul pkg clear-cache - Clear Cache

Clear package cache to force fresh downloads:
Clears:
  • Package download cache
  • Temporary installation files
  • Shows freed disk space in human-readable format

Program Structure

Genesis Function

Every Soul program must have exactly one genesis() function as the entry point:

Configuration

Project Configuration (soul.json)

Complete example of a soul.json file:

Error Handling

Soul CLI provides detailed error messages and validation:
  • Missing genesis function
  • Multiple genesis functions
  • Genesis function with parameters
  • Genesis function validation across multiple files
  • Missing packages
  • Version constraint conflicts
  • Soul version compatibility issues
  • Invalid package specifications
  • Source file not found
  • Compilation failures
  • Permission issues
  • Disk space issues

Examples

Basic Workflow

Package Development

Development Tips

This comprehensive CLI toolkit makes Soul development efficient and manageable, with powerful package management and build tools.