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.
Three equivalent methods:
-
Set the standard CI environment variable:
CI=true github-code-search "useFeatureFlag" --org fulll -
Use the explicit flag:
github-code-search "useFeatureFlag" --org fulll --no-interactive -
GitHub Actions —
CI=trueis set automatically:- 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.
:::
$ CI=true github-code-search "useFeatureFlag" --org fulll# Results for "useFeatureFlag"
3 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): `useFeatureFlag`
- [ ] [tests/unit/featureFlags.test.ts:1:8](https://github.com/fulll/auth-service/blob/main/tests/unit/featureFlags.test.ts#L1): `useFeatureFlag`
- **fulll/billing-api** (2 matches)
- [ ] [src/flags.ts:3:14](https://github.com/fulll/billing-api/blob/main/src/flags.ts#L3): `useFeatureFlag`
- [ ] [src/routes/invoices.ts:1:1](https://github.com/fulll/billing-api/blob/main/src/routes/invoices.ts#L1): `useFeatureFlag`
- **fulll/frontend-app** (1 match)
- [ ] [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1): `useFeatureFlag`
replay command
github-code-search "useFeatureFlag" --org fulll --no-interactiveAt 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.
- 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 }}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]'- Output formats — choose between Markdown and JSON
- Filtering — pre-exclude repos or extracts before running