opencode-container/opencode.aliases
Jeena f479a613a0 Fix problem with arguments
It was impossible to have several arguments while calling
opencode in the container like `opencode auth list`, it would
just break. With this change this also works.
2026-01-14 10:50:42 +09:00

16 lines
449 B
Text

OPENCODE_CONTAINER_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
opencode() {
local uid=$(id -u)
local gid=$(id -g)
local user=$(whoami)
UID="$uid" \
GID="$gid" \
USER="$user" \
docker compose \
-f "$OPENCODE_CONTAINER_DIR/docker-compose.yaml" \
run --rm \
-u "$uid:$gid" \
opencode /home/"$user"/.opencode/bin/opencode "$@" \
2> >(grep -v "No services to build" >&2)
}