Non-interactive mode
Non-interactive mode bypasses the TUI and prints results directly to stdout. Use it in CI pipelines, shell scripts, or whenever you want to process results programmatically.
Enabling non-interactive mode
Three equivalent methods:
Set the standard CI environment variable:
bashCI=true github-code-search "useFeatureFlag" --org fulllUse the explicit flag:
bashgithub-code-search "useFeatureFlag" --org fulll --no-interactiveGitHub Actions —
CI=trueis set automatically:yaml- run: github-code-search "useFeatureFlag" --org fulll env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TIP
In any environment where CI=true is set (GitHub Actions, GitLab CI, CircleCI, etc.), non-interactive mode is activated automatically — you don't need --no-interactive.
Example output
$ CI=true github-code-search "useFeatureFlag" --org fulll3 repos · 5 files selected
- **fulll/auth-service** (2 matches)
- [ ] [src/middlewares/featureFlags.ts:2:19](https://github.com/fulll/auth-service/blob/main/src/middlewares/featureFlags.ts#L2)
- [ ] [tests/unit/featureFlags.test.ts:1:8](https://github.com/fulll/auth-service/blob/main/tests/unit/featureFlags.test.ts#L1)
- **fulll/billing-api** (2 matches)
- [ ] [src/flags.ts:3:14](https://github.com/fulll/billing-api/blob/main/src/flags.ts#L3)
- [ ] [src/routes/invoices.ts:1:1](https://github.com/fulll/billing-api/blob/main/src/routes/invoices.ts#L1)
- **fulll/frontend-app** (1 match)
- [ ] [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1)replay command
github-code-search "useFeatureFlag" --org fulll --no-interactiveReplay command
At the end of every interactive session, github-code-search prints a replay command that encodes your exact selections as --exclude-repositories and --exclude-extracts arguments. Copy it to rerun the same filtered search in non-interactive mode:
github-code-search "useFeatureFlag" --org fulll --no-interactive \
--exclude-repositories legacy-monolith \
--exclude-extracts auth-service:tests/unit/featureFlags.test.ts:0This is the recommended bridge between an interactive exploration session and a reproducible CI step.
GitHub Actions example
- name: Search for feature flag usages
run: |
github-code-search "useFeatureFlag" --org fulll \
--format json \
--output-type repo-only \
> results.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}Combining with shell tools
The Markdown output can be piped directly into other tools:
# Count how many repos contain the pattern (JSON is cleaner for scripting)
CI=true github-code-search "TODO" --org fulll \
--format json --output-type repo-only \
| jq '.selection.repos'# Process JSON output with jq
CI=true github-code-search "useFeatureFlag" --org fulll --format json \
| jq '[.results[].repo]'What's next?
- Output formats — choose between Markdown and JSON
- Filtering — pre-exclude repos or extracts before running