Skip to content

Commit 89e6268

Browse files
committed
Improve index command help: hide internal url subcommand, show usage examples
1 parent df1b35e commit 89e6268

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/bin/cmd-index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ websiteCommand.action(async (options) => {
209209

210210
// URL-based indexing command (auto-detects source type)
211211
const urlCommand = new Command("url")
212-
.description("Index from a URL (auto-detects source type)")
212+
.description("Index from URL with auto-detection (used internally when URL is passed directly)")
213213
.argument("<url>", "URL of the repository or website to index")
214214
.option("--ref <ref>", "Branch, tag, or commit (overrides URL-detected ref)");
215215
addStoreOptions(urlCommand);
@@ -273,8 +273,9 @@ urlCommand.action(async (url: string, options) => {
273273

274274
// Main index command
275275
export const indexCommand = new Command("index")
276-
.description("Index a data source")
277-
.addCommand(urlCommand)
276+
.usage("<url> [options]\n ctxc index <source> [options]")
277+
.description("Index a data source\n\nExamples:\n ctxc index https://github.com/owner/repo\n ctxc index https://github.com/owner/repo -i myindex\n ctxc index github --owner x --repo y")
278+
.addCommand(urlCommand, { hidden: true })
278279
.addCommand(githubCommand)
279280
.addCommand(gitlabCommand)
280281
.addCommand(bitbucketCommand)

0 commit comments

Comments
 (0)