Skip to content

Shell syntax

Send shell source to exec with kind=bash, or run it through the embedded CLI. All paths belong to the selected disk; the current directory is always /.

Syntax Behavior
a; b or separate lines Run commands in sequence.
a && b, `a
`a b`
! a Negate a pipeline status.
< /input.txt Read a virtual file as stdin.
> /output.txt, `> /output.txt`
<<'TEXT' Supply a literal multiline heredoc.
Single/double quotes and escapes Pass literal argument content.
Source inside wabe Disk
mkdir -p /notes
printf 'beta\nalpha\nalpha\n' | sort -u > /notes/sorted.txt
cat /notes/sorted.txt | head -n 1
Terminal window
rg -n -g '*.md' 'TODO|FIXME' /notes
find /notes -type f -name '*.txt'

The command interprets these patterns. Unquoted path globs and brace expansion are rejected by the shell.

Git commands operate on a branch selected explicitly through branch=NAME on the request or git --branch NAME. This selects independent editable files and staging without a global checkout. See Git commands.

wabesql selects a database by name. SQL state is shared across filesystem branches. wabesql database list reads stored database names without opening SQLite connections.

The outer local shell passes a script to HTTP. The quoted delimiter preserves it:

Terminal window
curl --fail-with-body --no-buffer \
"https://api.wabe.sh/v1/disks/demo/exec?kind=bash" \
-H "Authorization: Bearer YOUR_PROJECT_API_KEY" \
--data-binary @- <<'WABE'
mkdir -p /notes
put /notes/message.txt <<'TEXT'
Hello from a multiline request.
TEXT
cat /notes/message.txt
WABE

The outer heredoc is interpreted locally; the inner one is interpreted by wabe Disk. Sending source in the request body leaves no separate body for command stdin. Use the query-source form to stream separate input.

The last command determines the normal pipeline status. Early downstream termination can close upstream pipes. Errors use wabe Disk diagnostics and status 1; exec-level failures can produce status 2. Check the final HTTP exit record.

AST validation runs before the script starts. Command options are validated when each command runs, so a later error can follow earlier successful writes. Shell sequences do not provide a transaction across commands. Within one wabesql query invocation, BEGIN and COMMIT can group SQL statements; an explicit transaction left open rolls back when that invocation closes.

Variables and assignments, parameter/command/arithmetic/tilde expansion, loops, functions, subshell groups, background jobs, file-descriptor redirects are unavailable. cd, host binaries and arbitrary process execution are unavailable. See the command reference for command-specific flags.

COMMAND >> /file appends the completed output stream at current EOF. Concurrent appends are serialized at publication. mv [--] SOURCE DESTINATION preserves file identity/history; a directory destination receives the source basename.

Cancelling execution drops its streaming work. A file publication accepted after its input completed can still finish; a missing acknowledgement has an uncertain outcome.