Skip to content

Commit 679af0c

Browse files
authored
Merge pull request #96 from vkop007/68-TranscriptToolsAdded
feat: add search command to index and query providers, commands, and …
2 parents 0e52592 + 2ec020f commit 679af0c

6 files changed

Lines changed: 536 additions & 2 deletions

File tree

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Typical commands:
100100

101101
```bash
102102
autocli status
103+
autocli search "youtube download"
103104
autocli llm chatgpt text "Write release notes for AutoCLI"
104105
autocli developer github login --browser
105106
autocli developer github me --json
@@ -175,6 +176,19 @@ autocli tools download batch ./urls.txt --mode video --quality 720p
175176
autocli tools download info 'https://www.youtube.com/playlist?list=PLFgquLnL59alCl_2TQvOiD5Vgm1hCaGSI' --playlist --limit 5
176177
```
177178

179+
## Command Search
180+
181+
Use `autocli search` to find providers and exact runnable commands across AutoCLI's built-in command surface.
182+
183+
Examples:
184+
185+
```bash
186+
autocli search github
187+
autocli search "youtube download"
188+
autocli search uptime --category devops
189+
autocli search transcript --json
190+
```
191+
178192
## Cross-Site Transcripts
179193

180194
Use `autocli tools transcript` to pull subtitles or transcripts from media pages supported by `yt-dlp`, with plain text by default and subtitle formats when you need them.

skills/autocli/SKILL.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ Use only one recovery step before retrying unless the user explicitly asks for t
6060
## Global Commands
6161

6262
- `autocli login --browser`
63+
- `autocli search <query>`
6364
- `autocli status --json`
6465
- `autocli doctor --json`
6566
- `autocli sessions --json`

src/__tests__/readme-category-commands.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
22

33
import { getPlatformCategories } from "../platforms/index.js";
44

5-
const ALLOWED_ROOT_COMMANDS = new Set<string>(["login", "status", "doctor", "sessions", "help", "-h", "--help", "-v", "--version", ...getPlatformCategories()]);
5+
const ALLOWED_ROOT_COMMANDS = new Set<string>(["login", "search", "status", "doctor", "sessions", "help", "-h", "--help", "-v", "--version", ...getPlatformCategories()]);
66

77
describe("README command examples", () => {
88
test("use category-based routing for provider commands", async () => {
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { describe, expect, test } from "bun:test";
2+
3+
import { buildSearchIndex, searchCommandIndex } from "../commands/search.js";
4+
import { createProgram } from "../program.js";
5+
6+
describe("search command", () => {
7+
test("registers the root search command", () => {
8+
const commandNames = createProgram().commands.map((command) => command.name());
9+
expect(commandNames).toContain("search");
10+
});
11+
12+
test("indexes providers and nested commands", () => {
13+
const index = buildSearchIndex();
14+
expect(index.some((entry) => entry.command === "autocli tools download")).toBe(true);
15+
expect(index.some((entry) => entry.command === "autocli tools download video")).toBe(true);
16+
expect(index.some((entry) => entry.command === "autocli login")).toBe(true);
17+
});
18+
19+
test("finds provider matches by display name and category words", () => {
20+
const results = searchCommandIndex(buildSearchIndex(), "uptime robot", { limit: 5 });
21+
expect(results[0]?.command).toBe("autocli devops uptimerobot");
22+
});
23+
24+
test("finds command matches from examples and descriptions", () => {
25+
const results = searchCommandIndex(buildSearchIndex(), "youtube download", { limit: 5 });
26+
expect(results.some((entry) => entry.command === "autocli tools download")).toBe(true);
27+
});
28+
29+
test("supports category filtering", () => {
30+
const results = searchCommandIndex(buildSearchIndex(), "uptime", {
31+
category: "devops",
32+
limit: 10,
33+
});
34+
expect(results.every((entry) => entry.category === "devops")).toBe(true);
35+
});
36+
37+
test("finds root commands by option text", () => {
38+
const results = searchCommandIndex(buildSearchIndex(), "browser login", { limit: 5 });
39+
expect(results[0]?.command).toBe("autocli login");
40+
});
41+
});

0 commit comments

Comments
 (0)