slash-core 0.1.0

Orchestration layer for the slash-command language
Documentation

slash

A parser and executor for a compact slash-command 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 Executor types and high-level API
slash-cmd CLI binary (slash)
slash-testing Proptest strategies and harness

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)

Usage

use slash_lib::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.