Logo
Getting started

Configuration

Ninja uses Tera templates with user-defined options to generate service configurations.

Configuration Files

Each shuriken contains:

  • .ninja/manifest.toml - Shuriken metadata and management settings
  • .ninja/options.toml - User-editable configuration values
  • .ninja/config.tmpl - Template file for generating configuration

Configuration Workflow

  1. Edit options
# Manually edit options
nano ~/.ninja/shurikens/{name}/.ninja/options.toml
  1. Generate configuration
# Render template with options
shurikenctl configure {name}
  1. Output - The rendered configuration is written to the path specified in manifest.toml under [config].config-path.

Template Example

.ninja/config.tmpl:

[server]
host = {{ host }}
port = {{ port }}

[paths]
data = {{ root }}/data
logs = {{ root }}/logs

.ninja/options.toml:

host = "localhost"
port = 8080

Injected Variables

Ninja automatically provides:

  • {{ root }} - Absolute path to shuriken directory
  • {{ platform }} - Current OS (linux, windows, macos)

Best Practices

  • Set sensible defaults in options.toml
  • Use {{ root }} for portable path references
  • Keep templates simple and well-documented

On this page