Open
Description
I will work on this.
Using username/repo
is a common shorthand for GitHub repos, used at minimum by:
- degit
- gh
- brew tap
And I frequently find myself using this pattern for personal CLIs (eg. vim package manager, git clone for my own directory structure, etc)
What would be necessary:
- Sort by stars
- Map user suggestion
(user: Fig.Suggestion) => Fig.Suggestion
- Map repo suggestion
(repo: Fig.Suggestion) => Fig.Suggestion
- Disable user suggestions
- Disable repo suggestions
- Conditionally disable, default would be
lastToken.slice(lastToken.indexOf("/")).match(githubUsernameRegex)
import { github } from "@fig/generators";
// ...
{
args: {
debounce: true,
generators: github({
// Could be `suggestUsers?: boolean | ((user: Fig.Suggestion) => Fig.Suggestion)
suggestUsers: false,
suggestRepos: (repo) => ({ ...repo, icon: "📦" }),
includeForks: false,
includeTemplates: false,
}),
}
}