From b97570d8e7cf35e6f8d0f56d2fbf9c67680e4f31 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Mon, 16 Nov 2026 14:04:50 +0100 Subject: [PATCH] added podman support; reference the docs --- README.md | 6 ++++-- setup.sh | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e909a84..28e7b30 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ # OpenCode example for ai.psi.ch +This is a slightly more fleshed-out version of the OpenCode example [here](https://ai.pages.psi.ch/user-guide/coding-agent/#3-configure-opencode), make sure to read the [documentation](https://ai.pages.psi.ch/user-guide/coding-agent). + ## Requirements - Bash -- Docker +- Docker or Podman ## Setup -Run `setup.sh` once to build the Docker image and create the `auth.json`. It will ask you to manually insert your key into the file. +Run `setup.sh` once to build the Docker image and create the `auth.json`. It will ask you to manually insert [your key](https://ai.pages.psi.ch/user-guide/coding-agent/#2-generate-your-api-key) into the file. ## Usage diff --git a/setup.sh b/setup.sh index baf0656..b9b0f4e 100755 --- a/setup.sh +++ b/setup.sh @@ -1,6 +1,19 @@ #!/bin/bash -docker build --pull -t opencode-sandbox $@ . +set -euo pipefail + +if command -v podman &> /dev/null; then + CONTAINER_ENGINE="podman" +elif command -v docker &> /dev/null; then + CONTAINER_ENGINE="docker" +else + echo "Error: Neither Podman nor Docker is installed." >&2 + exit 1 +fi + +echo "Using $CONTAINER_ENGINE" + +"$CONTAINER_ENGINE" build --pull -t opencode-sandbox $@ . AUTH="opencode/auth.json" if [ ! -e "$AUTH" ]; then