feat: issue #25 implemented - cli

This commit is contained in:
2026-07-17 14:26:14 +02:00
parent e4fa61ae07
commit 0f3f1efa08
24 changed files with 2899 additions and 873 deletions

23
rel/overlays/cli/bin/bds-cli Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
# bds-cli: workspace CLI for bDS2 (issue #25). Runs commands inside the
# release VM against the same settings and cache database as the app.
set -e
SELF_DIR="$(cd "$(dirname "$0")" && pwd)"
RELEASE_ROOT="$(cd "$SELF_DIR/../.." && pwd)"
export RELEASE_ROOT
# The TUI owns the terminal, so it boots the app instead of the one-shot CLI.
if [ "$1" = "tui" ]; then
BDS_MODE=tui exec "$RELEASE_ROOT/bin/bds" start
fi
# `bin/bds eval` cannot forward arguments, so the argv travels in an
# environment variable, joined with the ASCII unit separator (0x1f).
US="$(printf '\037')"
ARGV=""
for arg in "$@"; do
ARGV="${ARGV}${arg}${US}"
done
BDS_CLI_ARGV="$ARGV" BDS_MODE=cli exec "$RELEASE_ROOT/bin/bds" eval "BDS.CLI.main()"