Skip to content
CodeSpider
GitHub

How to Install CodeSpider

Start with one test repository. Choose Gitea for the workflow recorded end to end, or GitHub for the provider tested against local HTTP fixtures. GitHub.com and GitHub Enterprise Server have not been live-validated. Upstream lists compatible Forgejo via the Gitea provider; the recordings here do not validate Forgejo.

  • Docker with the Compose plugin (recommended), or a Go 1.26+ toolchain with Git for a standalone build.
  • A bot or App credential scoped to your test repository, a webhook secret, and an OpenAI-compatible model endpoint that supports tool calling.
  • A webhook URL reachable by your forge. A hosted GitHub instance cannot reach 127.0.0.1; see the reverse-proxy option before registering the webhook.

Clone the published v1.1.0 source. The walkthrough used a local image build from this tag; the instructions do not require registry access.

Terminal window
git clone --branch v1.1.0 --depth 1 https://github.com/Eresus-Security-OSS/CodeSpider.git
cd CodeSpider
cp codespider.example.yaml codespider.yaml

Keep the common settings below in codespider.yaml and use one forge block from the next section. Set the referenced variables in a local .env file for Compose. Keep that file out of commits and restrict access to it.

server:
listen_addr: ":8080"
admin_token: "${CODESPIDER_ADMIN_TOKEN}"
llm:
base_url: "${CODESPIDER_LLM_BASE_URL}"
api_key: "${CODESPIDER_LLM_API_KEY}"
model: "${CODESPIDER_LLM_MODEL}"
agent:
enable_write: false
enable_proof_of_bug: false
sandbox:
mode: disabled
daemon:
data_dir: ./data
workers: 1

The agent will not edit source or run tests with these settings. The bot can still post PR comments and commit statuses. A hosted model endpoint receives repository context; see Ollama and private models if the code must stay on your network.

Use forge.provider: gitea. In Gitea setup, create the bot account, grant access to one repository and create its token. Keep the github block disabled.

forge:
provider: gitea
repos: [your-org/pilot-repo]
gitea:
base_url: https://gitea.example.com
token: "${GITEA_BOT_TOKEN}"
webhook_secret: "${GITEA_WEBHOOK_SECRET}"
bot_username: codespider
allow_unsigned_webhooks: false

After starting the daemon, add the Gitea repository webhook with the same secret. Verify successful delivery before opening a PR. The forge.repos list limits reconciliation; it does not replace limiting token access or where you install webhooks.

Use forge.provider: github. Remove the gitea block. Pick a static token or GitHub App; the example below uses a token. For an App, follow the linked guide for the required fields and read-only PEM mount instead of setting github.token.

forge:
provider: github
repos: [your-org/pilot-repo]
github:
api_url: https://api.github.com
token: "${CODESPIDER_GITHUB_TOKEN}"
webhook_secret: "${CODESPIDER_GITHUB_WEBHOOK_SECRET}"
bot_username: "codespider[bot]"

Set bot_username to the account that posts reviews. After starting the daemon, register the GitHub webhook events on your test repository. Use a signed delivery and review the response. For GitHub Enterprise Server, set api_url to its HTTPS REST endpoint.

Create compose.pilot.yaml in the clone. This builds the pinned source, keeps persistent state in a named volume, and exposes the daemon only on host loopback.

services:
codespider:
build:
context: .
args:
VERSION: v1.1.0
restart: unless-stopped
env_file: .env
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
ports:
- "127.0.0.1:8080:8080"
volumes:
- ./codespider.yaml:/app/codespider.yaml:ro
- codespider_pilot:/app/data
volumes:
codespider_pilot:
Terminal window
docker compose -f compose.pilot.yaml up -d --build
docker compose -f compose.pilot.yaml logs -f codespider

Use a model URL reachable from inside the container. A 127.0.0.1 Ollama endpoint in container config refers to that container, not the host running Ollama.

From the same clone, build the pinned image and reuse codespider.yaml and .env:

Terminal window
podman build --build-arg VERSION=v1.1.0 -t codespider:1.1.0-pilot .
podman volume create codespider_pilot
podman run -d --name codespider --env-file .env \
-p 127.0.0.1:8080:8080 \
-v ./codespider.yaml:/app/codespider.yaml:ro,Z \
-v codespider_pilot:/app/data:U codespider:1.1.0-pilot

On Linux, build with Go 1.26+ and Git in PATH. Load the configuration’s referenced variables before running the binary. If a reverse proxy runs on the same host, set server.listen_addr: "127.0.0.1:8080".

Terminal window
go build -ldflags '-X main.version=v1.1.0' -o codespider ./cmd/codespider
./codespider -f codespider.yaml

For a persistent service, install the binary under /usr/local/bin, copy the config to /etc/codespider/codespider.yaml, and give a dedicated unprivileged codespider user read access to the config and write access to its state directory. Use a systemd EnvironmentFile for the variables and a working directory containing the skills directory from the same tag.

Expose only /webhook to the forge and keep /, /status, and other admin routes on the private listener. Terminate TLS on the proxy. For example, with Caddy on the same host:

codespider.example.com {
handle /webhook {
reverse_proxy 127.0.0.1:8080
}
handle {
respond 404
}
}

In Nginx, use an exact-match location = /webhook that proxies to http://127.0.0.1:8080, and return 404 for other public paths. Keep separate private access to the Operations Console.

  1. Confirm curl -fsS http://127.0.0.1:8080/healthz and curl -fsS http://127.0.0.1:8080/readyz succeed.
  2. Use your forge’s delivery log to verify that the daemon accepted the signed webhook. On Gitea, @codespider /help is an optional model-free check; it does not prove the model works.
  3. Open or update a test PR with a small, known behavior change. Look for the review summary and codespider/review status on the right commit. An inline comment is expected only when CodeSpider reports a line-level finding.
  4. Compare the result with the recorded Gitea example and use the pilot checklist to separate useful findings from duplicates of existing checks. Keep CI and human approval in place.

If no review appears, check signed webhook delivery, the daemon logs, and then model reachability from the daemon environment.