CLI Reference
Complete reference for the shurikenctl command-line interface.
Installation
See Installation Guide for setup instructions.
Global Options
shurikenctl [OPTIONS] [COMMAND]
Options:
--version Show version information
--help Display help messageCommands
list
List installed shurikens and their states.
shurikenctl list [OPTIONS]
# Show all shurikens
shurikenctl list
# Show with detailed state
shurikenctl list --stateOutput:
example-service (Running)
webserver (Idle)
database (Running)install
Install a .shuriken package.
shurikenctl install <PATH>
# Examples
shurikenctl install ./service.shuriken
shurikenctl install ~/Downloads/com.example.app-linux-x86_64.shurikenProcess:
- Validates magic bytes and metadata
- Verifies SHA-256 signature
- Extracts to
~/.ninja/shurikens/{name}/ - Runs post-install script if specified
remove
Uninstall a shuriken.
shurikenctl remove <NAME>
# Example
shurikenctl remove example-serviceWarning: This deletes all shuriken files. Backup data first if needed.
start
Start a shuriken service.
shurikenctl start <NAME>
# Example
shurikenctl start webserverBehavior:
- Native: Spawns process and creates lock file
- Script: Executes
start()function in management script
stop
Stop a running shuriken.
shurikenctl stop <NAME>
# Example
shurikenctl stop webserverBehavior:
- Native: Terminates process using PID verification
- Script: Executes
stop()function in management script
restart
Restart a shuriken (stop then start).
shurikenctl restart <NAME>
# Example
shurikenctl restart databaseconfigure
Generate configuration from template and options.
shurikenctl configure <NAME>
# Example
shurikenctl configure webserverProcess:
- Loads
.ninja/options.toml - Injects
{{ platform }}and{{ root }} - Renders
.ninja/config.tmpl - Writes to configured path
forge
Build a .shuriken package from a directory.
shurikenctl forge [PATH]
# Interactive mode
shurikenctl forge
# Specify source directory
shurikenctl forge ./my-serviceCreates: ~/.ninja/blacksmith/{id}-{platform}.shuriken
Interactive prompts:
- Name and ID
- Version
- Platform
- Synopsis and description
- Authors and license
new
Create a new shuriken manifest interactively.
shurikenctl new
# Creates .ninja/manifest.toml with guided promptsrun
Execute a Ninja script.
shurikenctl run <FILE>
# Examples
shurikenctl run setup.ns
shurikenctl run scripts/deploy.luaExecutes Lua script with full Ninja API access.
api
Start the HTTP API server.
shurikenctl api [OPTIONS]
Options:
--port <PORT> Server port (default: 8080)
# Examples
shurikenctl api --port 3000
shurikenctl apiSee API Reference for endpoints.
lockpick
Remove a stale lock file.
shurikenctl lockpick <NAME>
# Example
shurikenctl lockpick webserver⚠️ Warning: Only use if you've verified the process is not running. Misuse can cause race conditions.
Safe usage:
# 1. Verify process is stopped
ps aux | grep service-name
# 2. Stop if needed
shurikenctl stop service-name
# 3. Remove stale lock
shurikenctl lockpick service-nameExamples
Complete Workflow
# Install package
shurikenctl install ./myapp.shuriken
# Configure
shurikenctl configure myapp
# Start
shurikenctl start myapp
# Check status
shurikenctl list
# View specific state
shurikenctl list --state
# Stop
shurikenctl stop myappPackage Development
# Create new shuriken
shurikenctl new
# Test locally
shurikenctl start myapp
# Build package
shurikenctl forge ./myapp
# Package created at:
# ~/.ninja/blacksmith/com.example.myapp-linux-x86_64.shurikenAPI Server
# Start server
shurikenctl api --port 8080
# In another terminal, use curl
curl http://localhost:8080/shurikens
curl -X POST http://localhost:8080/shurikens/myapp/startEnvironment Variables
# Ninja directory (default: ~/.ninja)
export NINJA_DIR=/custom/path
# Log level
export NINJA_LOG_LEVEL=debugExit Codes
0- Success1- General error2- Invalid arguments3- Service not found4- Service already running5- Service not running
Interactive Mode
Run shurikenctl without arguments for REPL mode:
shurikenctl
ninja> list
example-service (Running)
ninja> configure webserver
Configuration generated successfully
ninja> exitHelp
Get help for any command:
shurikenctl --help
shurikenctl install --help
shurikenctl forge --helpSee also: DSL Syntax, API Reference