Getting Started

Run headless OpenCode agent sessions backed by Berget AI, a sovereign EU cloud with an OpenAI-compatible API, as one-shot jobs in Eyevinn Open Source Cloud. You provide a git repository and a prompt. Berget Code Runner clones the repository, runs the agent against it non-interactively and exits. It is the sibling of Claude Runner and Codex Runner and is used the same way.

This tutorial walks you through the steps to get started.

Prerequisites

  • If you have not already done so, sign up for an Eyevinn OSC account
  • A Berget AI API key
  • A git repository for the agent to work on. Private repositories also need an access token.

Step 1: Store credentials as secrets

Navigate to the Berget Code Runner service and go to the "Service Secrets" tab. Click "New Secret" and create:

  • bergetapikey: your Berget AI API key
  • gittoken (only for private repositories): a personal access token that can read the repository

A {{secrets.NAME}} reference only works when it is the entire field value.

Step 2: Create a job

Go to the "My birme-berget-code-runner" tab and click "Create". Fill in:

  • Name: a name for the job, for example bergetjob
  • BergetApiKey: {{secrets.bergetapikey}}
  • SourceUrl: the repository to clone, for example https://github.com/your-org/your-repo. Append #branch to use a branch.
  • Prompt: the task for the agent, for example Add a health check endpoint to the Express app
  • GitToken (optional): {{secrets.gittoken}} for a private repository
  • Model (optional): leave empty for the default moonshotai/Kimi-K2.6

Click "Create" to start the job.

Step 3: Follow the run

Open the instance and read its logs. The runner prints the settings it uses, clones the repository, starts the agent and streams formatted output: assistant text, tool calls, tool results and step summaries. The job exits with the exit code of the agent.

Project instructions in the repository

The agent follows the standard OpenCode files in the cloned repository:

  • AGENTS.md: project instructions and constraints
  • .opencode/: project-level OpenCode configuration

Configuration

Option Required Description
name Yes Instance name
Prompt Yes The task the agent performs against the cloned repository.
BergetApiKey Yes Berget AI API key. Store it as a secret.
SourceUrl Yes Git repository URL to clone. Append #branch to check out a branch.
Model No moonshotai/Kimi-K2.6 (default), google/gemma-4-31B-it or mistralai/Mistral-Medium-3.5-128B.
GitToken No Access token for private repositories. Store it as a secret.
SubPath No Subdirectory of the repository to use as working directory.
OscAccessToken No OSC access token. If set, the OSC MCP server is available to the agent. Store it as a secret.
OscMcpUrl No OSC MCP endpoint. Default https://mcp.osaas.io/mcp.
ConfigSvc No Name of an Application Config Service instance. Requires OscAccessToken. Its parameters are loaded as environment variables before the agent starts.
ConfigApiKey No API key for the encrypted parameter store. Store it as a secret.
BergetBaseUrl No Berget AI API base URL. Default https://api.berget.ai/v1.
Verbose No Default 1, formatted output. 0 or false gives OpenCode plain text output.
RawJson No 1 or true emits raw JSONL events instead of formatted output.

Limitations

  • The agent runs with permission prompts disabled and can read and change everything in the cloned repository and run commands in the container. Point it only at repositories and prompts you trust.
  • The job clones a shallow, single-branch copy and does not push changes back unless your prompt and token allow it.
  • The runner accepts MAX_TURNS, ALLOWEDTOOLS and DISALLOWEDTOOLS for compatibility with Claude Runner but ignores them, so they are not offered as options.
  • Not tested on OSC: a full run with a live Berget key, private repositories, the OSC MCP integration and the config service.

Resources