Forge
csharp3407750f
1using AgentForge.Abstractions;
2
3namespace AgentForge.Plugin.Ci;
4
5[ForgeMcpPrimary]
6internal static class ForgeCiCommandRegistration
7{
8 internal static void Register(ForgeCommandRegistry registry)
9 {
10 registry.Add(new ForgeCommandDescriptor
11 {
12 Domain = "forge",
13 Object = "ci",
14 Intent = "open",
15 CommandId = "forge.ci.open",
16 Path = "/ci open",
17 PathAliases = ["/forge ci open"],
18 Help = "Open CI tab or pipeline designer (optional definition name in tail).",
19 Category = "CI",
20 ArgTail = "optional",
21 Surfaces = ["command-bar", "global"],
22 RequiredCapabilities = ["read"],
23 Bindings = new ForgeCommandBindings
24 {
25 View = "/view/repos/{repo}/ci",
26 },
27 });
28
29 registry.Add(new ForgeCommandDescriptor
30 {
31 Domain = "forge",
32 Object = "ci",
33 Intent = "list",
34 CommandId = "forge.ci.list",
35 Path = "/ci list",
36 PathAliases = ["/forge ci list"],
37 Help = "List CI pipeline definitions for the repository.",
38 Category = "CI",
39 ArgTail = "optional",
40 Surfaces = ["command-bar", "global"],
41 RequiredCapabilities = ["read"],
42 Bindings = new ForgeCommandBindings
43 {
44 Mcp = ForgeMcpToolNames.CiDefinitionList,
45 },
46 });
47
48 registry.Add(new ForgeCommandDescriptor
49 {
50 Domain = "forge",
51 Object = "ci",
52 Intent = "create",
53 CommandId = "forge.ci.create",
54 Path = "/ci create",
55 PathAliases = ["/forge ci create"],
56 Help = "Create pipeline definition with default template; name required in tail.",
57 Category = "CI",
58 ArgTail = "required",
59 Surfaces = ["command-bar", "global"],
60 RequiredCapabilities = ["write"],
61 Bindings = new ForgeCommandBindings
62 {
63 Mcp = ForgeMcpToolNames.CiDefinitionCreate,
64 View = "/view/repos/{repo}/ci/definitions/{definition}/designer",
65 },
66 });
67
68 registry.Add(new ForgeCommandDescriptor
69 {
70 Domain = "forge",
71 Object = "ci",
72 Intent = "runs",
73 CommandId = "forge.ci.runs",
74 Path = "/ci runs",
75 PathAliases = ["/forge ci runs"],
76 Help = "List CI pipeline runs for the repository.",
77 Category = "CI",
78 ArgTail = "optional",
79 Surfaces = ["command-bar", "global"],
80 RequiredCapabilities = ["read"],
81 Bindings = new ForgeCommandBindings
82 {
83 Mcp = ForgeMcpToolNames.CiRunList,
84 },
85 });
86
87 registry.Add(new ForgeCommandDescriptor
88 {
89 Domain = "forge",
90 Object = "ci",
91 Intent = "run",
92 CommandId = "forge.ci.run",
93 Path = "/ci run",
94 PathAliases = ["/forge ci run"],
95 Help = "Queue pipeline run (definition name in tail; optional ref after).",
96 Category = "CI",
97 ArgTail = "required",
98 Surfaces = ["command-bar", "global", "mr-comment"],
99 RequiredCapabilities = ["write"],
100 Bindings = new ForgeCommandBindings
101 {
102 Mcp = ForgeMcpToolNames.CiRunQueue,
103 View = "/view/repos/{repo}/ci/runs/{runId}",
104 },
105 });
106
107 registry.Add(new ForgeCommandDescriptor
108 {
109 Domain = "forge",
110 Object = "ci",
111 Intent = "status",
112 CommandId = "forge.ci.status",
113 Path = "/ci status",
114 PathAliases = ["/forge ci status"],
115 Help = "CI status for merge request (MR number in tail or mrNumber in context).",
116 Category = "CI",
117 ArgTail = "optional",
118 Surfaces = ["command-bar", "global", "mr-comment"],
119 RequiredCapabilities = ["read"],
120 Bindings = new ForgeCommandBindings
121 {
122 Mcp = ForgeMcpToolNames.MergeRequestCi,
123 },
124 });
125 }
126}
127
View only · write via MCP/CIDE