#341·openwiki

code mode is hardcoded to GitHub (workflow file + AGENTS.md wording) on non-GitHub repos

Author: victor-micoCreated Jul 15, 2026Updated Sep 8, 2026

Summary

openwiki code is hardcoded to GitHub in two places, even when the repository uses a different git host (GitLab, Bitbucket, etc.). This makes it awkward to use OpenWiki in non-GitHub repos, because every run reintroduces GitHub-specific artifacts/wording that then have to be scrubbed in CI.

There are two related problems.

1. A GitHub Actions workflow is written on every run, unconditionally

ensureCodeModeRepoSetup() calls writeCodeModeWorkflow(), which always creates/overwrites .github/workflows/openwiki-update.yml — regardless of the repo's git provider. It runs on both the interactive and the --print (CI) paths (src/code-mode.ts, called from src/cli.tsx).

For a Bitbucket- or GitLab-only repo this means:

  • A .github/workflows/openwiki-update.yml reappears on every openwiki code --update run.
  • CI pipelines have to rm -rf .github (or otherwise exclude it) before committing, so the unused workflow doesn't leak into the docs PR.

2. The AGENTS.md / CLAUDE.md OPENWIKI block hardcodes "GitHub Actions workflow"

writeCodeModeAgentSnippets() rewrites the <!-- OPENWIKI:START -->…<!-- OPENWIKI:END --> block in AGENTS.md and CLAUDE.md on every run, and the template contains:

The scheduled OpenWiki GitHub Actions workflow refreshes the repository wiki.

On a Bitbucket/GitLab repo this sentence is factually wrong, and because the block is regenerated each run, any manual correction is reverted the next time OpenWiki runs — producing a recurring, misleading diff. In our Bitbucket setup we currently patch it back with a sed step after every run, which is a workaround, not a fix.

Steps to reproduce

  1. In a repo that is not hosted on GitHub (e.g. Bitbucket), run openwiki code --update --print with a provider configured.
  2. Observe:
    • .github/workflows/openwiki-update.yml is (re)created.
    • The OPENWIKI block in AGENTS.md/CLAUDE.md says "GitHub Actions workflow".

Expected

OpenWiki should be provider-aware, or at least not emit GitHub-specific content when it isn't wanted. Some options:

  • Detect the git remote host and skip writeCodeModeWorkflow() / emit the matching CI file (there are already GitLab and Bitbucket examples under examples/).
  • Add a flag / config (e.g. --ci-provider none|github|gitlab|bitbucket, or a field in the OpenWiki config) to control which CI workflow is written, defaulting to none in --print/CI mode.
  • Make the OPENWIKI block wording provider-neutral (e.g. "the scheduled OpenWiki update job refreshes the repository wiki") so it's accurate everywhere, or template it from the detected/configured provider.

Environment

  • OpenWiki installed via npm install --global openwiki
  • Used in CI on Bitbucket Pipelines (openwiki code --update --print)

Happy to send a PR if a preferred direction is decided (provider detection vs. an explicit flag).