Skip to main content

Crate runnables

Crate runnables 

Source
Expand description

What a folder can run: its apps, tests, watchers, simulators, databases and deploys, found from the files it already has, with the command for each.

let report = runnables::report(std::path::Path::new("."));
for group in &report.groups {
    for task in &group.tasks {
        println!("{} · {}: {}", group.title, task.name, task.command);
    }
}

detect returns the groups; report adds the one to run by default. The runnables binary prints the same as JSON (runnables detect <folder>) and serves it to coding agents over MCP (runnables mcp).

Made for Edit, whose Run bar, iPhone app and IDE extension all use it.

Modules§

deploy
The shell scripts in a folder’s .deploy, read to say what each one does: a title from the file name, a group and a destination from the commands it runs, and its steps in order, for the Deploy menu.

Structs§

Group
A section of the menu: a project and the ways to run it.
Report
The JSON runnables detect prints.
RunTask
One command that Play can run.

Enums§

ProjectKind
What kind of project a group is, for its icon.
TaskIcon
What a task looks like in the menu.

Constants§

POWERSHELL
Whether commands are written for PowerShell, the terminal’s shell on Windows, rather than a POSIX shell.

Functions§

cd_then
Goes to dir, then runs command; the shell stays there.
default_task
The task Play runs when the folder has no pick yet.
detect
Everything in root that can be run, the most likely pick first.
find_executable
Looks on PATH first, then in extra_dirs. An app opened from Finder does not get the shell’s PATH.
find_task
git_bash
Git for Windows’ bash, beside its git.exe. Never System32\bash.exe, which starts WSL.
mcp
quote
Quotes a path for the shell when it needs it. PowerShell doubles a quote inside single quotes; a POSIX shell closes, escapes and reopens.
report
then
second when first succeeds. Windows PowerShell 5.1 has no &&.