Initial commit

This commit is contained in:
Jeena 2026-01-13 13:48:49 +09:00
commit c3e9e2b40b
4 changed files with 129 additions and 0 deletions

23
opencode.aliases Normal file
View file

@ -0,0 +1,23 @@
OPENCODE_CONTAINER_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
opencode() {
# Set defaults if not already defined
: "${XDG_DATA_HOME:=$HOME/.local/share}"
: "${XDG_CONFIG_HOME:=$HOME/.config}"
: "${XDG_STATE_HOME:=$HOME/.local/state}"
: "${XDG_CACHE_HOME:=$HOME/.cache}"
UID=$(id -u) \
GID=$(id -g) \
USER=$(whoami) \
XDG_DATA_HOME="$XDG_DATA_HOME" \
XDG_CONFIG_HOME="$XDG_CONFIG_HOME" \
XDG_STATE_HOME="$XDG_STATE_HOME" \
XDG_CACHE_HOME="$XDG_CACHE_HOME" \
docker compose \
-f "$OPENCODE_CONTAINER_DIR/docker-compose.yaml" \
run --rm \
-u "$UID:$GID" \
opencode bash -c "/home/$USER/.opencode/bin/opencode \"$@\"" \
2> >(grep -v "No services to build" >&2)
}