Skip to content

Commit c83cf50

Browse files
committed
feat(opencode): add gemini auth bootstrap
Add opencode configuration and npm dependency so the gemini auth plugin is installed with the feature by default. Require the node feature and run the on-create hook to guarantee npm is present and emit setup status as the container initializes. Signed-off-by: Svetlin Ralchev <[email protected]>
1 parent 9a83693 commit c83cf50

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

src/opencode/files/opencode.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://opencode.ai/config.json",
3+
"plugin": [
4+
"opencode-gemini-auth"
5+
]
6+
}

src/opencode/install.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
set -e
33

44
apt_get_update() {
5-
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
6-
echo "Running apt-get update..."
7-
apt-get update -y
8-
fi
5+
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
6+
echo "Running apt-get update..."
7+
apt-get update -y
8+
fi
99
}
1010

1111
# Checks if packages are installed and installs them if not
1212
apt_get() {
13-
if ! dpkg -s "$@" >/dev/null 2>&1; then
14-
apt-get -y install --no-install-recommends "$@"
15-
fi
13+
if ! dpkg -s "$@" >/dev/null 2>&1; then
14+
apt-get -y install --no-install-recommends "$@"
15+
fi
1616
}
1717

1818
apt_get_update
@@ -26,3 +26,10 @@ curl -fsSL https://opencode.ai/install | bash
2626

2727
# Make opencode available for everybody
2828
mv "$HOME/.opencode/bin/opencode" /usr/local/bin/opencode
29+
30+
OPENCODE_CONFIG_PATH="$_REMOTE_USER_HOME/.config/opencode"
31+
32+
# Create the global config
33+
mkdir -p "$OPENCODE_CONFIG_PATH"
34+
# Copy the configuration
35+
cp -R files/* "$OPENCODE_CONFIG_PATH"

0 commit comments

Comments
 (0)