opencode/packages/cli-rs/script/live.sh
Simon Klee 271fc7c26d
feat(cli-rs): scaffold the Rust client workspace
Add packages/cli-rs: a Cargo workspace with the 14 crates of the plan,
module stubs for api, local, service, store, and ui, and the expected
third-party crates in [workspace.dependencies]. opentui is a path
dependency on the local opentui-rust checkout, linked statically.

script/opentui-lib.sh copies native artifacts whose header matches the
bindings into ~/.cache/opencode-rs/opentui, where .cargo/config.toml
points OPENTUI_LIB_DIR. opencode-rs --version runs; script/live.sh
runs it against the elected background service.
2026-11-04 17:52:34 +01:00

15 lines
669 B
Bash
Executable file

#!/bin/sh
# Runs opencode-rs against the elected opencode background service, as the root `dev:live` does for the
# TypeScript TUI: the dev storage channel, the service's URL, and its private password.
#
# Usage: script/live.sh [opencode-rs arguments...]
set -eu
rs=$(cd "$(dirname "$0")/.." && pwd)
server=$(opencode service status)
OPENCODE_PASSWORD=$(opencode service get password)
OPENCODE_TUI_CHANNEL=dev
export OPENCODE_PASSWORD OPENCODE_TUI_CHANNEL
# Builds from the workspace so cargo reads .cargo/config.toml, then runs in the caller's directory.
(cd "$rs" && cargo build --quiet --bin opencode-rs)
exec "$rs/target/debug/opencode-rs" "$@" --server "$server"