Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 19 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The script automatically detects your OS (Linux, macOS) and architecture (x64, a
To install a specific version or to a custom directory:

```bash
INSTALL_DIR=~/.local/bin VERSION=v1.2.0 \
INSTALL_DIR=~/.local/bin VERSION=v1.0.6 \
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version example changed from v1.2.0 to v1.0.6, but package.json is being bumped from 1.0.5 to 1.1.0. The version v1.0.6 in this example doesn't match either the old version (1.0.5) or the new version being released (1.1.0). Consider updating this to v1.0.5 (to reference a past stable release) or v1.1.0 (to reference the version being released in this PR).

Suggested change
INSTALL_DIR=~/.local/bin VERSION=v1.0.6 \
INSTALL_DIR=~/.local/bin VERSION=v1.1.0 \

Copilot uses AI. Check for mistakes.
curl -fsSL https://raw.githubusercontent.com/fulll/github-code-search/main/install.sh | bash
```

Expand Down Expand Up @@ -150,7 +150,6 @@ GitHub Code Search: useFeatureFlag in fulll

After pressing **Enter**:

```
3 repos · 6 files · 7 matches selected

- **fulll/auth-service** (2 matches)
Expand All @@ -164,11 +163,16 @@ After pressing **Enter**:
- [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1)
- [src/components/Dashboard.tsx:4:3](https://github.com/fulll/frontend-app/blob/main/src/components/Dashboard.tsx#L4)

# Replay:
<details>
<summary>replay command</summary>

```bash
github-code-search "useFeatureFlag" --org fulll --no-interactive \
--exclude-repositories legacy-monolith
```

</details>

## Non-interactive mode (CI)

### Why use it?
Expand Down Expand Up @@ -202,7 +206,6 @@ github-code-search "useFeatureFlag" --org fulll --no-interactive
$ CI=true github-code-search "useFeatureFlag" --org fulll
```

```
3 repos · 5 matches selected

- **fulll/auth-service**
Expand All @@ -214,10 +217,15 @@ $ CI=true github-code-search "useFeatureFlag" --org fulll
- **fulll/frontend-app**
- [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1)

# Replay:
<details>
<summary>replay command</summary>

```bash
github-code-search "useFeatureFlag" --org fulll --no-interactive
```

</details>

## Exclusion options

### `--exclude-repositories`
Expand Down Expand Up @@ -265,7 +273,6 @@ github-code-search "useFeatureFlag" --org fulll

**2. Output + replay command:**

```
2 repos · 3 matches selected

- **fulll/auth-service**
Expand All @@ -276,12 +283,17 @@ github-code-search "useFeatureFlag" --org fulll
- **fulll/frontend-app**
- [src/hooks/useFeatureFlag.ts:1:1](https://github.com/fulll/frontend-app/blob/main/src/hooks/useFeatureFlag.ts#L1)

# Replay:
<details>
<summary>replay command</summary>

```bash
github-code-search "useFeatureFlag" --org fulll --no-interactive \
--exclude-repositories legacy-monolith \
--exclude-extracts auth-service:tests/unit/featureFlags.test.ts:0
```

</details>

**3. Replay without UI (CI, scripting, documentation):**

```bash
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "github-code-search",
"version": "1.0.5",
"version": "1.1.0",
"description": "Interactive GitHub code search with per-repo aggregation",
"license": "MIT",
"author": "fulll",
Expand Down
14 changes: 14 additions & 0 deletions src/render.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,20 @@ describe("renderGroups filter opts", () => {
expect(stripped).toContain("Enter confirm");
});

it("live-filters rows by filterInput when filterMode=true", () => {
// The caller (tui.ts) builds rows with filterInput as the active filter
// while in filterMode so the view updates as the user types.
const groups = [makeGroup("org/repo", ["src/a.ts", "lib/b.ts"], false)];
const rows = buildRows(groups, "src"); // rows already filtered by filterInput
const out = renderGroups(groups, 0, rows, 40, 0, "q", "org", {
filterMode: true,
filterInput: "src",
});
const stripped = out.replace(/\x1b\[[0-9;]*m/g, "");
expect(stripped).toContain("src/a.ts");
expect(stripped).not.toContain("lib/b.ts");
});

it("shows confirmed filter path with stats when filterPath is set", () => {
const groups = [makeGroup("org/repo", ["src/a.ts", "lib/b.ts"], false)];
const rows = buildRows(groups, "src");
Expand Down
11 changes: 8 additions & 3 deletions src/tui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ export async function runInteractive(
let showHelp = false;

const redraw = () => {
const rows = buildRows(groups, filterPath);
const activeFilter = filterMode ? filterInput : filterPath;
const rows = buildRows(groups, activeFilter);
const rendered = renderGroups(groups, cursor, rows, termHeight, scrollOffset, query, org, {
filterPath,
filterMode,
Expand Down Expand Up @@ -88,11 +89,15 @@ export async function runInteractive(
cursor = Math.min(cursor, Math.max(0, newRows.length - 1));
scrollOffset = Math.min(scrollOffset, cursor);
} else if (key === "\x7f" || key === "\b") {
// Backspace
// Backspace — trim and clamp cursor to new live-filtered row list
filterInput = filterInput.slice(0, -1);
const newRows = buildRows(groups, filterInput);
cursor = Math.min(cursor, Math.max(0, newRows.length - 1));
} else if (key.length === 1 && key >= " ") {
// Printable character
// Printable character — clamp cursor to new live-filtered row list
filterInput += key;
const newRows = buildRows(groups, filterInput);
cursor = Math.min(cursor, Math.max(0, newRows.length - 1));
}
redraw();
continue;
Expand Down