CLI reference¶
The spb command validates projects, renders prompts, links artifacts, and
runs evaluations and benchmarks.
Global command¶
$ spb --help
The command has no global configuration options. Commands that read a prompt
project accept --project-root where listed.
spb init¶
Initialize a minimal prompt project in the selected directory. The directory is created when needed. Initialization refuses to overwrite its configuration, prompt, layout, or instruction fragment.
$ spb init [OPTIONS] [DIRECTORY]
Value |
Default |
Usage |
|---|---|---|
|
|
Repository or directory that will contain the prompt project. |
|
|
Initial harness name written to the project configuration. |
The command creates .spb/config.yaml,
.spb/prompts/project-assistant.md,
.spb/layouts/project-assistant.md,
.spb/fragments/project_instructions/FRAGMENT.md, and
.spb/skills/local/, and an empty .spb/evals/ directory. See
Initialize a project for the generated
contents and workflow.
spb validate¶
Validate .spb/config.yaml and every Markdown prompt below .spb/prompts/.
Validation checks prompt metadata, semantic versions, variable declarations,
selected fragment bundles and layout slots, skill references, provider
configuration, and at least one harness mapping.
Required runtime variable values are not needed during validation.
$ spb validate [--project-root DIRECTORY]
Option |
Default |
Usage |
|---|---|---|
|
|
Directory containing |
spb render¶
Render one prompt from .spb/prompts/ into a harness-specific artifact
and manifest. When the prompt selects fragments, the manifest records each
fragment alias, source path, and digest.
$ spb render PROMPT --harness HARNESS [OPTIONS]
$ spb render [OPTIONS]
Without a prompt or harness, render each target in the configuration’s
renders list. Options such as --var and --compress apply to every
configured target. Targets are processed in order; a failure stops the batch,
and earlier artifacts remain written.
Option |
Default |
Usage |
|---|---|---|
|
Required |
Select a configured harness. |
|
None |
Supply one declared template variable. Repeat for multiple values. |
|
Disabled |
Permit replacement when an existing artifact has changed bytes. |
|
Disabled |
Write a compressed prompt artifact in addition to the full prompt.
Fragment-based prompts compress only |
|
|
Select the compressor used with |
|
|
Target fraction of original tokens to keep with |
|
|
Directory containing |
none returns the original content and is useful for testing compression
plumbing. llmlingua requires the optional llmlingua dependency and
loads the LLMLingua-2 bert-base model on CPU by default. Set
SPB_LLMLINGUA_MODEL or SPB_LLMLINGUA_DEVICE to use another model or
device.
spb link¶
Create an absolute symbolic link from a consumer path to a rendered artifact. Parent directories are created when needed.
$ spb link SOURCE DESTINATION [--replace]
$ spb link [--project-root DIRECTORY] [--replace]
With no positional arguments, apply every link declared in .spb/config.yaml.
Both paths are relative to the project root. All sources and destinations are
checked before creating links. Existing destinations require --replace.
Option |
Default |
Usage |
|---|---|---|
|
Disabled |
Remove an existing file or symbolic link at the destination first. |
spb eval validate¶
Validate an evaluation suite without loading a model.
$ spb eval validate SUITE
This command has no options. Store project suite files in
.spb/evals/; the command also accepts any existing suite path.
spb eval run¶
Render a prompt, generate direct model responses, score them with DeepEval, and write an evaluation result.
$ spb eval run PROMPT --suite SUITE --harness HARNESS [OPTIONS]
Option |
Default |
Usage |
|---|---|---|
|
Required |
Evaluation suite YAML file. |
|
Required |
Harness used to render the prompt. |
|
None |
Supply a declared prompt variable. Repeat as needed. |
|
Disabled |
Validate prompt, suite, and mock-tool wiring without a model call or result file. |
|
Generated path |
Write the result to an exact file. |
|
None |
Fail when the overall mean score is below a value from 0 to 1. |
|
|
Directory containing |
The default output is
.spb/build/evals/<prompt-name>/<version>/result.yaml. The command also fails when
any metric reports that its required threshold was not met or an expected
mock-tool call trace does not match.
spb eval compare¶
Compare the full prompt with a compressed variant using the same suite.
$ spb eval compare PROMPT --suite SUITE --harness HARNESS [OPTIONS]
Option |
Default |
Usage |
|---|---|---|
|
Required |
Evaluation suite YAML file. |
|
Required |
Harness used to render the prompt. |
|
None |
Supply a declared prompt variable. Repeat as needed. |
|
|
Compressor used for the candidate prompt. |
|
|
Maximum accepted baseline minus candidate mean score. |
|
Generated path |
Write the comparison to an exact file. |
|
|
Directory containing |
The default output is
.spb/build/evals/<prompt-name>/<version>/comparison.yaml.
spb benchmark run¶
Evaluate one prompt release and gate its overall and per-group scores.
$ spb benchmark run PROMPT --suite SUITE --harness HARNESS [OPTIONS]
Option |
Default |
Usage |
|---|---|---|
|
Required |
Evaluation suite YAML file. |
|
Required |
Harness used to render the prompt. |
|
None |
Supply a declared prompt variable. Repeat as needed. |
|
Generated path |
Write the benchmark result to an exact file. |
|
None |
Fail when the overall mean score is below a value from 0 to 1. |
|
None |
Require a minimum mean score for a named test group. Repeat as needed. |
|
|
Directory containing |
The default output is
.spb/build/benchmarks/<prompt-name>/<version>/result.yaml.
spb benchmark compare¶
Evaluate two prompt source files with the same harness, variables, and suite, then gate overall and per-group score regressions.
$ spb benchmark compare BASELINE CANDIDATE \
--suite SUITE --harness HARNESS [OPTIONS]
Option |
Default |
Usage |
|---|---|---|
|
Required |
Evaluation suite YAML file. |
|
Required |
Harness used to render both prompts. |
|
None |
Supply a declared prompt variable to both prompts. Repeat as needed. |
|
|
Maximum accepted baseline minus candidate mean score. |
|
None |
Maximum accepted score drop for a named group. Repeat as needed. |
|
Generated path |
Write the comparison to an exact file. |
|
|
Directory containing |
The default output is
.spb/build/benchmarks/<candidate-name>/<candidate-version>/comparison.yaml.