From 33ee2af21afd152052830d7b83ea9429f4e9a5f4 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Mon, 16 Nov 2026 13:48:07 +0100 Subject: [PATCH] first try --- .gitignore | 2 ++ Dockerfile | 19 +++++++++++++++++++ opencode/auth.json.template | 7 +++++++ opencode/opencode.json | 24 ++++++++++++++++++++++++ setup.sh | 13 +++++++++++++ vibe.sh | 33 +++++++++++++++++++++++++++++++++ 6 files changed, 98 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 opencode/auth.json.template create mode 100644 opencode/opencode.json create mode 100755 setup.sh create mode 100755 vibe.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bf1a547 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +opencode/auth.json +opencode/data/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1eea9da --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ghcr.io/anomalyco/opencode:latest + +RUN apk add --no-cache \ + bash \ + ca-certificates \ + curl \ + fd \ + fzf \ + git \ + jq \ + less \ + parallel \ + ripgrep \ + sd \ + tree \ + yq + +COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv + diff --git a/opencode/auth.json.template b/opencode/auth.json.template new file mode 100644 index 0000000..495b8c5 --- /dev/null +++ b/opencode/auth.json.template @@ -0,0 +1,7 @@ +{ + "PSI": { + "type": "api", + "key": "INSERT API KEY HERE" + } +} + diff --git a/opencode/opencode.json b/opencode/opencode.json new file mode 100644 index 0000000..8ffc490 --- /dev/null +++ b/opencode/opencode.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://opencode.ai/config.json", + "model": "PSI/Qwen3.8-27B", + "provider": { + "PSI": { + "npm": "@ai-sdk/openai-compatible", + "options": { + "baseURL": "https://ai.psi.ch/api/" + }, + "models": { + "Qwen3.8-27B": { + "name": "Qwen3.8-27B" + }, + "openai/gpt-oss-120b": { + "name": "OpenAI gpt-oss-120b" + }, + "psi_rag_pipeline": { + "name": "PSI RAG Pipeline" + } + } + } + } +} + diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..baf0656 --- /dev/null +++ b/setup.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +docker build --pull -t opencode-sandbox $@ . + +AUTH="opencode/auth.json" +if [ ! -e "$AUTH" ]; then +# cp "$AUTH.template" "$AUTH" + echo "=====================================================" + echo "open $AUTH and insert your ai.psi.ch key" + echo "=====================================================" +fi + + diff --git a/vibe.sh b/vibe.sh new file mode 100755 index 0000000..d2412f3 --- /dev/null +++ b/vibe.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +if [[ $# -lt 1 ]]; then + echo "ERROR: provide a workspace directory as argument to mount it into the container" + exit 1 +fi + +WORKSPACE="$(realpath "$1")" +shift + +mkdir -p "$PWD/opencode/data/config" +mkdir -p "$PWD/opencode/data/local/share" +mkdir -p "$PWD/opencode/data/local/state" + +CONTAINER_HOME="/root" + +docker run -it --rm --net=host \ + --name opencode \ +\ + -v "$WORKSPACE":/workspace \ + -w /workspace \ +\ + -v "$PWD/opencode/data/config":"$CONTAINER_HOME/.config/opencode" \ + -v "$PWD/opencode/opencode.json":"$CONTAINER_HOME/.config/opencode/opencode.json:ro" \ +\ + -v "$PWD/opencode/data/local/share":"$CONTAINER_HOME/.local/share/opencode" \ + -v "$PWD/opencode/auth.json":"$CONTAINER_HOME/.local/share/opencode/auth.json:ro" \ +\ + -v "$PWD/opencode/data/local/state":"$CONTAINER_HOME/.local/state/opencode" \ +\ + opencode-sandbox "$@" + +