Skip to content

Self-Hosted

The GitHub Action is the fastest way to get started, but you may want to run Erode yourself if you:

  • Need full control over the runtime environment
  • Use GitHub Enterprise Server, self-hosted GitLab, or Bitbucket Cloud
  • Run a CI platform other than GitHub Actions or GitLab CI

The simplest self-hosted path for GitHub users. Fork the repository and reference your fork as a GitHub Action. The same action.yml inputs and outputs work without changes.

  1. Fork erode-app/erode to your organization
  2. Add repository secrets for your AI key and GitHub token
  3. Reference the fork in your workflow:
- uses: your-org/erode@main
with:
model-repo: your-org/architecture
github-token: ${{ secrets.GITHUB_TOKEN }}
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}

All action inputs and outputs work the same way.

For any CI platform, use the published container image:

Terminal window
docker run --rm \
-e ERODE_GITHUB_TOKEN="$GITHUB_TOKEN" \
-e ERODE_ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" \
ghcr.io/erode-app/erode:0 \
analyze /model --url "$PR_URL" --comment --fail-on-violations

Mount a local model directory if the model is not in a remote repository:

Terminal window
docker run --rm \
-v ./architecture:/model \
-e ERODE_GITHUB_TOKEN="$GITHUB_TOKEN" \
-e ERODE_GEMINI_API_KEY="$GEMINI_API_KEY" \
ghcr.io/erode-app/erode:0 \
analyze /model --url "$PR_URL" --comment
analyze:
image: ghcr.io/erode-app/erode:0
entrypoint: ['']
script:
- >
node /app/packages/core/dist/ci-entry.js analyze /model
--url "$PR_URL"
--comment --fail-on-violations
variables:
ERODE_GITHUB_TOKEN: $MY_GITHUB_TOKEN
ERODE_ANTHROPIC_API_KEY: $MY_ANTHROPIC_KEY

Override the entrypoint to call the CI entry point directly. The image includes Node.js and the built Erode package at /app/packages/core/dist/ci-entry.js.

Clone the repository, build, and run Erode as a regular Node.js CLI:

Terminal window
git clone https://github.com/erode-app/erode.git
cd core
npm install && npm run build

Then run the analysis:

Terminal window
export ERODE_GITHUB_TOKEN="..."
export ERODE_ANTHROPIC_API_KEY="..."
node packages/cli/dist/cli.js analyze ./path/to/model \
--url "https://github.com/org/repo/pull/42" \
--comment \
--fail-on-violations

See CLI Commands for the full command reference and Configuration for all environment variables.