Skip to main content
The Rust Ironclad Framework includes a powerful CLI tool inspired by Laravel Artisan for common development and maintenance tasks.

Installation

The CLI binary is included in the project and can be run with:
cargo run --bin ironclad -- [command]

Create an Alias

For faster development, create an alias for the CLI: Bash/Zsh (Linux/macOS):
# Add to ~/.bashrc or ~/.zshrc
alias ironclad='cargo run --bin ironclad --'

# Usage
ironclad version
ironclad db-check
ironclad down --message "Updating..."
PowerShell (Windows):
# Add to your PowerShell profile
function ironclad { cargo run --bin ironclad -- $args }

# Usage
ironclad version
ironclad db-check
ironclad down --message "Updating..."

Install Globally

For production use, install the CLI globally:
cargo install --path . --bin ironclad

# Now use directly
ironclad version
ironclad up
ironclad down

Available Commands

The CLI tool provides the following commands:
CommandDescription
versionShow framework version and info
db-checkCheck database connection and health
downPut the application into maintenance mode
upBring the application out of maintenance mode
storageStorage management commands (check, link, info, init)
testRun CLI diagnostics

Project Root Detection

The CLI automatically detects and changes to the project root directory by searching for Cargo.toml. You can run CLI commands from anywhere within your project directory tree. Output example:
📁 Changed working directory to: "/home/user/my-project"

Getting Help

View all available commands:
cargo run --bin ironclad -- --help
View help for a specific command:
cargo run --bin ironclad -- down --help

Running the Application

The project has two binaries:
BinaryCommandPurpose
maincargo run --bin mainAPI Server (default)
ironcladcargo run --bin ironcladCLI Tool

Common Workflows

Development Workflow

# 1. Start the server
cargo run --bin main

# 2. In another terminal, check database
cargo run --bin ironclad -- db-check

# 3. Put in maintenance mode for updates
cargo run --bin ironclad -- down --message "Deploying new features"

# 4. Run migrations, updates, etc.
sqlx migrate run

# 5. Bring back online
cargo run --bin ironclad -- up

Initial Setup Workflow

# 1. Check CLI is working
cargo run --bin ironclad -- test

# 2. Initialize storage directories
cargo run --bin ironclad -- storage init

# 3. Create storage symlink
cargo run --bin ironclad -- storage link

# 4. Verify database connection
cargo run --bin ironclad -- db-check

# 5. Check storage setup
cargo run --bin ironclad -- storage check

Next Steps

Version Command

Display framework version and information

Database Command

Check database connectivity and health

Maintenance Mode

Manage application maintenance mode

Storage Management

Initialize and manage storage directories

Build docs developers (and LLMs) love