Embedded CLI
The wabe-disk CLI opens storage directly in its own process. Use HTTP to interact with an already-running server. Avoid opening a second writer against the server’s active storage prefix.
File operations
Section titled “File operations”printf 'Hello wabe Disk\n' | ./target/release/wabe-disk --data ./.data put demo /hello.txt./target/release/wabe-disk --data ./.data get demo /hello.txtSubcommands put DISK PATH and get DISK PATH use local stdin and stdout. They do not accept an HTTP URL.
Execute source
Section titled “Execute source”./target/release/wabe-disk --data ./.data exec demo 'cat /hello.txt'./target/release/wabe-disk --data ./.data exec demo --branch main 'git add /hello.txt; git commit -m greeting'./target/release/wabe-disk --data ./.data exec demo --kind js 'print(await fs.readFile("/hello.txt", "utf8"))'Omitting the script argument reads source from stdin:
./target/release/wabe-disk --data ./.data exec demo <<'WABE'mkdir -p /notesprintf 'hello\n' > /notes/hello.txtcat /notes/hello.txtWABEWhen source is an argument, stdin remains available for data:
printf '{"enabled":true}' | ./target/release/wabe-disk --data ./.data exec demo 'kv put app feature --json; kv get app feature'JavaScript requires Linux. CLI JS execution exposes stdout/stderr and success/failure; a returned JS value is not printed automatically. Use print to produce CLI output.
exec --branch NAME selects the branch for file operations and Git commands together. Bash containing Git requires this option or git --branch NAME on each Git command. Branch selection is local to the execution.
Execute SQL
Section titled “Execute SQL”Run wabesql inside exec to create a named database and query it:
./target/release/wabe-disk --data ./.data exec demo 'wabesql database create app'./target/release/wabe-disk --data ./.data exec demo "wabesql query app 'SELECT 1;'"wabesql query app < /migrations/001.sql reads a file from the virtual disk. To supply a host file instead, pass the shell source as an argument and redirect the host command’s stdin: wabe-disk exec demo 'wabesql query app' < ./001.sql. Query output is NDJSON. CLI queries require an existing database; HTTP SQL connections create missing databases automatically. See SQL commands for transactions, errors and value encoding.
Maintenance
Section titled “Maintenance”./target/release/wabe-disk --data ./.data chunk-size demo 65536./target/release/wabe-disk --data ./.data gc demoEach CLI run closes its managed disks and confirms pending writes before exiting, including after a script error when closing succeeds. There are no top-level CLI volume, flush or evict subcommands in this version. The HTTP server exposes separate flush and eviction routes.