slash-core (0.1.0)
Installation
[registry]
default = "gitea"
[registries.gitea]
index = "sparse+ " # Sparse index
# index = " " # Git
[net]
git-fetch-with-cli = truecargo add slash-core@0.1.0About this package
slash
An AI agent tool orchestration language designed to be embedded in
configuration files (e.g., settings.json) and evaluated by a Rust hook
orchestration module.
Crates
| Crate | Description |
|---|---|
slash-lang |
Lexer, parser, and AST |
slash-lib |
SlashCommand trait, CommandRegistry, 6 builtins, executor |
slash-core |
ExecutionPlan compiler, orchestration layer |
slash-cmd |
CLI binary (slash) |
slash-testing |
Proptest strategies and harness |
Shared vocabulary types (ExecutionContext, Priority, Urgency,
StepStatus) live in the slashcrux
crate.
Language Overview
Commands are whitespace-tokenized with no quoting, escaping, or variable expansion. Priority is inferred from the shape of the command token. Urgency is a trailing suffix.
Priority (inferred from casing)
| Token shape | Priority |
|---|---|
ALL_CAPS |
Max |
TitleCase |
High |
camelCase |
Medium |
kebab-case / plain lowercase |
Low |
snake_case |
Lowest |
Urgency (trailing ! suffix)
/build! # Low urgency
/build!! # Medium urgency
/build!!! # High urgency
Builder-chain arguments
/deploy.env(prod).region(us-east-1)
Optional commands and pipe context
/cmd? marks a command optional. When optional commands are piped together, their outputs accumulate into a Context object (key = command name, value = Option<String>) passed as JSON to the first non-optional command.
/fetch? | /validate? | /deploy
Operators
/build && /test # run /test only if /build succeeds
/build || /fallback # run /fallback only if /build fails
/generate | /format # pipe stdout
/build |& /log # pipe stdout + stderr
/build > out.txt # redirect output (overwrite)
/build >> out.txt # redirect output (append)
Builtins
| Command | Feature | Description |
|---|---|---|
/echo |
always | Produce text output |
/read |
always | Read file contents |
/write |
always | Write piped input to file |
/exec |
always | Run shell command |
/find |
always | Glob-based file search |
/obfsck |
obfsck (default) |
Redact secrets/PII |
Build without obfsck: cargo build -p slash-lib --no-default-features
Usage
use slash_lang::parser::parse;
let program = parse("/Build.target(release) && /test!!")?;
println!("{program:#?}");
Building
cargo build --all-targets
cargo nextest run
cargo clippy --all-targets -- -D warnings
License
Licensed under either of MIT or Apache-2.0 at your option.
Dependencies
| ID | Version |
|---|---|
| anyhow | ^1.0 |
| dotenvy | ^0.15 |
| indexmap | ^2.0 |
| serde | ^1.0 |
| serde_json | ^1.0 |
| slash-lang | ^0.1.0 |
| slashcrux | ^0.1.2 |
| slash-testing | ^0.1.0 |