mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
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.
15 lines
669 B
Bash
Executable file
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"
|