MCPcopy Create free account
hub / github.com/cli/cli / NewCmdRepo

Function NewCmdRepo

pkg/cmd/repo/repo.go:29–75  ·  view source on GitHub ↗
(f *cmdutil.Factory)

Source from the content-addressed store, hash-verified

27)
28
29func NewCmdRepo(f *cmdutil.Factory) *cobra.Command {
30 cmd := &cobra.Command{
31 Use: "repo <command>",
32 Short: "Manage repositories",
33 Long: `Work with GitHub repositories.`,
34 Example: heredoc.Doc(`
35 $ gh repo create
36 $ gh repo clone cli/cli
37 $ gh repo view --web
38 `),
39 Annotations: map[string]string{
40 "help:arguments": heredoc.Doc(`
41 A repository can be supplied as an argument in any of the following formats:
42 - "OWNER/REPO"
43 - by URL, e.g. "https://github.com/OWNER/REPO"
44 `),
45 },
46 GroupID: "core",
47 }
48
49 cmdutil.AddGroup(cmd, "General commands",
50 repoListCmd.NewCmdList(f, nil),
51 repoCreateCmd.NewCmdCreate(f, nil),
52 )
53
54 cmdutil.AddGroup(cmd, "Targeted commands",
55 repoViewCmd.NewCmdView(f, nil),
56 repoCloneCmd.NewCmdClone(f, nil),
57 repoForkCmd.NewCmdFork(f, nil),
58 repoDefaultCmd.NewCmdSetDefault(f, nil),
59 repoSyncCmd.NewCmdSync(f, nil),
60 repoEditCmd.NewCmdEdit(f, nil),
61 readDirCmd.NewCmdReadDir(f, nil),
62 readFileCmd.NewCmdReadFile(f, nil),
63 deployKeyCmd.NewCmdDeployKey(f),
64 licenseCmd.NewCmdLicense(f),
65 gitIgnoreCmd.NewCmdGitIgnore(f),
66 repoRenameCmd.NewCmdRename(f, nil),
67 repoArchiveCmd.NewCmdArchive(f, nil),
68 repoUnarchiveCmd.NewCmdUnarchive(f, nil),
69 repoDeleteCmd.NewCmdDelete(f, nil),
70 creditsCmd.NewCmdRepoCredits(f, nil),
71 repoAutolinkCmd.NewCmdAutolink(f),
72 )
73
74 return cmd
75}

Callers

nothing calls this directly

Calls 1

AddGroupFunction · 0.92

Tested by

no test coverage detected