Skip to content

Commit f88dc44

Browse files
committed
cli: filtering for link
1 parent 01976e6 commit f88dc44

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

bun.lock

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
],
4545
"license": "UNLICENSED",
4646
"dependencies": {
47-
"@clack/prompts": "^0.10.0",
47+
"@clack/prompts": "^1.0.1",
4848
"picocolors": "^1.1.1",
4949
"yargs": "^17.7.2",
5050
"zod": "^4.3.6"
5151
},
5252
"devDependencies": {
5353
"@types/bun": "latest",
54-
"@types/yargs": "^17.0.33"
54+
"@types/yargs": "^17.0.35"
5555
}
5656
}

src/cli/commands/link.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,19 @@ export const command: Command = {
6262
const local = Config.Local.read();
6363
const current = new Set(Object.keys(local.refs));
6464
const repos = [...global.repos].sort((a, b) => a.name.localeCompare(b.name));
65+
const initialValues = repos
66+
.filter((r) => current.has(r.name))
67+
.map((r) => r.name)
68+
.sort((a, b) => b.localeCompare(a));
6569

66-
const selected = await prompts.multiselect({
70+
const selected = await prompts.autocompleteMultiselect({
6771
message: "Select repos to link into .llm/reference/",
6872
options: repos.map((r) => ({
6973
value: r.name,
7074
label: r.name,
7175
hint: r.uri,
7276
})),
73-
initialValues: repos
74-
.filter((r) => current.has(r.name))
75-
.map((r) => r.name),
77+
initialValues,
7678
required: false,
7779
});
7880

0 commit comments

Comments
 (0)