Build CLI Reference

Build the Rust workspace and MCP extensions with the build CLI domain. Compile, test, and package SystemPrompt components.

The build domain compiles SystemPrompt components. It builds the core Rust workspace and MCP extensions.

Why Build Exists

SystemPrompt is built with Rust and needs compilation:

  • Core - The main SystemPrompt workspace (CLI, extensions, libraries)
  • MCP - MCP server extensions

The build domain provides convenient wrappers around cargo and build scripts.

Quick Reference

Subcommand Description
build core Build the Rust workspace
build mcp Build MCP extensions

Build Core

Build the main SystemPrompt Rust workspace.

Basic Build

# Build in debug mode
systemprompt build core

# Build in release mode
systemprompt build core --release

Build Options

Flag Description
--release Build with optimizations (slower build, faster runtime)
--package, -p Build specific package only
--features Enable feature flags
--verbose, -v Show detailed build output

Build Specific Package

# Build only the CLI
systemprompt build core --package systemprompt-cli

# Build only an extension
systemprompt build core --package systemprompt-web

Feature Flags

# Build with specific features
systemprompt build core --features "analytics,scheduler"

# Build with all features
systemprompt build core --features "full"

Verbose Output

# Show cargo output
systemprompt build core -v

# Very verbose (shows all commands)
systemprompt build core -vv

Build MCP

Build MCP (Model Context Protocol) server extensions.

Build All MCP Servers

# Build all MCP servers
systemprompt build mcp

# Build in release mode
systemprompt build mcp --release

Build Specific MCP Server

# Build specific MCP server
systemprompt build mcp --server filesystem

# Build multiple servers
systemprompt build mcp --server filesystem --server github

Build Options

Flag Description
--release Build with optimizations
--server Build specific MCP server(s)
--verbose, -v Show detailed output

Build Process

What Happens During Core Build

  1. Cargo check - Verify code compiles
  2. Build dependencies - Compile dependency crates
  3. Build workspace - Compile all workspace members
  4. Copy assets - Copy static assets to output
  5. Generate bindings - Create any necessary bindings

What Happens During MCP Build

  1. Find MCP crates - Discover MCP server crates
  2. Build each server - Compile as standalone binary
  3. Copy to output - Place binaries in expected location

Output Locations

Component Debug Location Release Location
CLI target/debug/systemprompt target/release/systemprompt
Extensions target/debug/ target/release/
MCP Servers target/debug/ target/release/

Quick Build Commands

For convenience, most builds are done via just:

# Build everything (debug)
just build

# Build everything (release)
just build-release

# Build and run
just run

# Clean build artifacts
just clean

Justfile Targets

Command Description
just build Build debug
just build-release Build release
just clean Remove build artifacts
just test Run tests
just check Run cargo check
just clippy Run linter

Common Workflows

Development Build

# Quick build for development
systemprompt build core

# Or using just
just build

Production Build

# Optimized build
systemprompt build core --release
systemprompt build mcp --release

# Or using just
just build-release

Incremental Development

# Build only changed packages
systemprompt build core

# Watch and rebuild (if using cargo-watch)
cargo watch -x "build --package systemprompt-cli"

Build Single Extension

# Build only the web extension
systemprompt build core --package systemprompt-web

Build Single MCP Server

# Build only filesystem MCP server
systemprompt build mcp --server filesystem

Troubleshooting

Build Errors

# Run check to see errors without building
cargo check

# Use verbose mode to see full error output
systemprompt build core -vv

Dependency Issues

# Update dependencies
cargo update

# Clean and rebuild
just clean
just build

Linking Errors

If you see linking errors:

  1. Check required system libraries are installed
  2. Verify correct Rust toolchain: rustup show
  3. Try clean build: just clean && just build

Missing Features

# List available features for a package
cargo read-manifest --manifest-path Cargo.toml | jq '.features'

# Build with required features
systemprompt build core --features "required-feature"

Environment Requirements

Rust Toolchain

  • Rust version: 1.75+ (check with rustc --version)
  • Cargo: Included with Rust

System Dependencies

Platform Dependencies
Ubuntu/Debian build-essential, libssl-dev, pkg-config
macOS Xcode Command Line Tools
Windows Visual Studio Build Tools

Install Dependencies (Ubuntu)

sudo apt-get update
sudo apt-get install build-essential libssl-dev pkg-config

Playbooks:

  • systemprompt core playbooks show cli_build - Build operations
  • systemprompt core playbooks show build_extension-checklist - Extension development
  • systemprompt core playbooks show build_mcp-checklist - MCP server development
  • systemprompt core playbooks show build_rust-standards - Rust coding standards

Guides:


Previous Next
Plugins CLI API Reference