CI Integration
NestWeaver runs in CI pipelines for automated dead code detection, PR impact analysis, and test selection. The key difference from local usage is that CI runners don’t persist daemon processes, so you need --no-daemon mode for all commands.
CI mode
Section titled “CI mode”Pass --no-daemon to any command, or set the environment variable. This makes NestWeaver operate directly on the database file without starting a background daemon:
# Flagnestweaver index . --no-daemon --db ./nestweaver.lbug
# Or environment variable (applies to all commands)export NESTWEAVER_NO_DAEMON=1nestweaver index . --db ./nestweaver.lbugPre-built binaries
Section titled “Pre-built binaries”Download a pre-built binary from GitHub Releases. Binaries are available for Linux and macOS on both x86_64 and aarch64.
In GitHub Actions, add a setup step:
- name: Install NestWeaver run: | curl -fsSL https://github.com/Kehl-io/nestweaver/releases/latest/download/nestweaver-linux-x86_64.tar.gz \ | tar xz -C /usr/local/bin nestweaver --versionYou can also install via npm if you prefer:
- name: Install NestWeaver run: npm install -g @kehl-io/nestweaverIndex in CI
Section titled “Index in CI”Index the repository into a database file. For monorepos or multi-repo setups, index each repo into the same database:
nestweaver index . --no-daemon --db ./nestweaver.lbugFor multi-repo projects:
nestweaver index --repo ./frontend --no-daemon --db ./nestweaver.lbugnestweaver index --repo ./backend --no-daemon --db ./nestweaver.lbugUseful CI checks
Section titled “Useful CI checks”Dead code detection
Section titled “Dead code detection”Fail the build when unreachable symbols are detected. NestWeaver traces reachability from entry points (exports, main functions, route handlers) and reports symbols that nothing calls:
nestweaver dead-code --no-daemon --db ./nestweaver.lbugUse this as a quality gate — if dead code is found, the command exits with a non-zero status.
PR impact analysis
Section titled “PR impact analysis”Annotate pull requests with a blast radius showing which symbols, files, and tests are affected by the changes. Impact scores decay multiplicatively through edges so low-confidence paths are pruned:
nestweaver pr-impact --no-daemon --db ./nestweaver.lbugThis outputs a risk-scored summary (Low/Medium/High/Critical) that can be posted as a PR comment.
Affected test selection
Section titled “Affected test selection”Run only the tests affected by changed files instead of the full suite. NestWeaver traces the dependency graph from changed symbols to their test files:
nestweaver affected-tests --no-daemon --db ./nestweaver.lbugPipe the output into your test runner to skip unaffected tests and speed up CI:
nestweaver affected-tests --no-daemon --db ./nestweaver.lbug --json \ | jq -r '.affected_tests[]' \ | xargs pytestSnapshots for speed
Section titled “Snapshots for speed”Re-indexing a large codebase on every CI run is slow. Snapshots let you build the graph once, push it to storage, and pull it in CI — skipping the index step entirely.
Build and push a snapshot (run after indexing, e.g., on main branch merges):
nestweaver snapshot build --no-daemon --db ./nestweaver.lbugnestweaver snapshot push --no-daemon --db ./nestweaver.lbugPull the snapshot in CI (replaces the index step):
nestweaver pull --no-daemon --db ./nestweaver.lbugConfigure the snapshot storage backend in your instance config:
[snapshot_storage]backend = "s3"bucket = "my-nestweaver-snapshots"prefix = "ci/"Example GitHub Actions workflow
Section titled “Example GitHub Actions workflow”A complete workflow that installs NestWeaver, indexes the repo, checks for dead code, and posts PR impact analysis:
name: NestWeaver Analysison: pull_request: branches: [main]
env: NESTWEAVER_NO_DAEMON: '1'
jobs: analyze: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # Full history needed for pr-impact
- name: Install NestWeaver run: | curl -fsSL https://github.com/Kehl-io/nestweaver/releases/latest/download/nestweaver-linux-x86_64.tar.gz \ | tar xz -C /usr/local/bin
- name: Index repository run: nestweaver index . --db ./nestweaver.lbug
- name: Dead code check run: nestweaver dead-code --db ./nestweaver.lbug
- name: PR impact analysis run: nestweaver pr-impact --db ./nestweaver.lbugFor projects using snapshots, replace the index step with a pull:
- name: Pull snapshot run: nestweaver pull --db ./nestweaver.lbug
- name: Incremental re-index (changed files only) run: nestweaver index . --db ./nestweaver.lbugThis keeps CI fast — the snapshot provides the baseline graph and the incremental index picks up changes from the PR.