@getforgeai/cli 0.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (221) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +80 -0
  3. package/dist/bin/forgeai.d.ts +3 -0
  4. package/dist/bin/forgeai.js +8 -0
  5. package/dist/cli.d.ts +4 -0
  6. package/dist/cli.js +180 -0
  7. package/dist/commands/auth-login.d.ts +4 -0
  8. package/dist/commands/auth-login.js +202 -0
  9. package/dist/commands/auth-logout.d.ts +2 -0
  10. package/dist/commands/auth-logout.js +41 -0
  11. package/dist/commands/auth-status.d.ts +4 -0
  12. package/dist/commands/auth-status.js +81 -0
  13. package/dist/commands/cli-list.d.ts +4 -0
  14. package/dist/commands/cli-list.js +40 -0
  15. package/dist/commands/cli-unlink.d.ts +4 -0
  16. package/dist/commands/cli-unlink.js +45 -0
  17. package/dist/commands/config-set.d.ts +5 -0
  18. package/dist/commands/config-set.js +63 -0
  19. package/dist/commands/connect.d.ts +9 -0
  20. package/dist/commands/connect.js +165 -0
  21. package/dist/commands/disconnect.d.ts +5 -0
  22. package/dist/commands/disconnect.js +126 -0
  23. package/dist/commands/journal-clear.d.ts +2 -0
  24. package/dist/commands/journal-clear.js +16 -0
  25. package/dist/commands/journal-list.d.ts +2 -0
  26. package/dist/commands/journal-list.js +20 -0
  27. package/dist/commands/journal-status.d.ts +2 -0
  28. package/dist/commands/journal-status.js +18 -0
  29. package/dist/commands/mcp-serve.d.ts +13 -0
  30. package/dist/commands/mcp-serve.js +74 -0
  31. package/dist/commands/org-list.d.ts +4 -0
  32. package/dist/commands/org-list.js +56 -0
  33. package/dist/commands/org-unlink.d.ts +4 -0
  34. package/dist/commands/org-unlink.js +63 -0
  35. package/dist/commands/reconnect.d.ts +4 -0
  36. package/dist/commands/reconnect.js +46 -0
  37. package/dist/commands/release-open.d.ts +2 -0
  38. package/dist/commands/release-open.js +43 -0
  39. package/dist/commands/session-respond.d.ts +2 -0
  40. package/dist/commands/session-respond.js +29 -0
  41. package/dist/commands/task-open.d.ts +2 -0
  42. package/dist/commands/task-open.js +42 -0
  43. package/dist/commands/vm.d.ts +21 -0
  44. package/dist/commands/vm.js +122 -0
  45. package/dist/commands/workflow-open.d.ts +2 -0
  46. package/dist/commands/workflow-open.js +43 -0
  47. package/dist/config/config-manager.d.ts +31 -0
  48. package/dist/config/config-manager.js +70 -0
  49. package/dist/config/token-manager.d.ts +11 -0
  50. package/dist/config/token-manager.js +87 -0
  51. package/dist/index.d.ts +11 -0
  52. package/dist/index.js +22 -0
  53. package/dist/lib/auth-client.d.ts +1670 -0
  54. package/dist/lib/auth-client.js +10 -0
  55. package/dist/lib/branch-manager.d.ts +79 -0
  56. package/dist/lib/branch-manager.js +620 -0
  57. package/dist/lib/clone-and-checkout.d.ts +6 -0
  58. package/dist/lib/clone-and-checkout.js +41 -0
  59. package/dist/lib/connection-manager.d.ts +58 -0
  60. package/dist/lib/connection-manager.js +436 -0
  61. package/dist/lib/daemon-entry.d.ts +2 -0
  62. package/dist/lib/daemon-entry.js +210 -0
  63. package/dist/lib/daemon.d.ts +38 -0
  64. package/dist/lib/daemon.js +148 -0
  65. package/dist/lib/event-journal.d.ts +24 -0
  66. package/dist/lib/event-journal.js +76 -0
  67. package/dist/lib/ipc-client.d.ts +10 -0
  68. package/dist/lib/ipc-client.js +70 -0
  69. package/dist/lib/ipc-server.d.ts +36 -0
  70. package/dist/lib/ipc-server.js +70 -0
  71. package/dist/lib/node-version-guard.d.ts +8 -0
  72. package/dist/lib/node-version-guard.js +60 -0
  73. package/dist/lib/open-directory.d.ts +7 -0
  74. package/dist/lib/open-directory.js +41 -0
  75. package/dist/lib/repo-manager.d.ts +29 -0
  76. package/dist/lib/repo-manager.js +103 -0
  77. package/dist/lib/resilient-emitter.d.ts +53 -0
  78. package/dist/lib/resilient-emitter.js +160 -0
  79. package/dist/lib/rest-client.d.ts +164 -0
  80. package/dist/lib/rest-client.js +139 -0
  81. package/dist/lib/skill-manager.d.ts +23 -0
  82. package/dist/lib/skill-manager.js +167 -0
  83. package/dist/lib/socket-client.d.ts +68 -0
  84. package/dist/lib/socket-client.js +160 -0
  85. package/dist/mcp/mcp-probe.d.ts +11 -0
  86. package/dist/mcp/mcp-probe.js +106 -0
  87. package/dist/mcp/mcp-response.d.ts +29 -0
  88. package/dist/mcp/mcp-response.js +67 -0
  89. package/dist/mcp/mcp-server.d.ts +19 -0
  90. package/dist/mcp/mcp-server.js +76 -0
  91. package/dist/mcp/resources/project-conventions.d.ts +4 -0
  92. package/dist/mcp/resources/project-conventions.js +50 -0
  93. package/dist/mcp/resources/task-current.d.ts +4 -0
  94. package/dist/mcp/resources/task-current.js +51 -0
  95. package/dist/mcp/tools/forge-add-group-dependency.d.ts +4 -0
  96. package/dist/mcp/tools/forge-add-group-dependency.js +20 -0
  97. package/dist/mcp/tools/forge-add-task-dependency.d.ts +4 -0
  98. package/dist/mcp/tools/forge-add-task-dependency.js +20 -0
  99. package/dist/mcp/tools/forge-ask-human.d.ts +4 -0
  100. package/dist/mcp/tools/forge-ask-human.js +80 -0
  101. package/dist/mcp/tools/forge-column-done.d.ts +4 -0
  102. package/dist/mcp/tools/forge-column-done.js +46 -0
  103. package/dist/mcp/tools/forge-complete-step.d.ts +4 -0
  104. package/dist/mcp/tools/forge-complete-step.js +139 -0
  105. package/dist/mcp/tools/forge-create-task-group.d.ts +4 -0
  106. package/dist/mcp/tools/forge-create-task-group.js +22 -0
  107. package/dist/mcp/tools/forge-create-task.d.ts +4 -0
  108. package/dist/mcp/tools/forge-create-task.js +28 -0
  109. package/dist/mcp/tools/forge-delete-task-group.d.ts +4 -0
  110. package/dist/mcp/tools/forge-delete-task-group.js +17 -0
  111. package/dist/mcp/tools/forge-delete-task.d.ts +4 -0
  112. package/dist/mcp/tools/forge-delete-task.js +17 -0
  113. package/dist/mcp/tools/forge-get-task.d.ts +4 -0
  114. package/dist/mcp/tools/forge-get-task.js +17 -0
  115. package/dist/mcp/tools/forge-merge-back.d.ts +4 -0
  116. package/dist/mcp/tools/forge-merge-back.js +179 -0
  117. package/dist/mcp/tools/forge-release-merge.d.ts +4 -0
  118. package/dist/mcp/tools/forge-release-merge.js +159 -0
  119. package/dist/mcp/tools/forge-release-notes.d.ts +4 -0
  120. package/dist/mcp/tools/forge-release-notes.js +51 -0
  121. package/dist/mcp/tools/forge-release-tag.d.ts +4 -0
  122. package/dist/mcp/tools/forge-release-tag.js +125 -0
  123. package/dist/mcp/tools/forge-remove-group-dependency.d.ts +4 -0
  124. package/dist/mcp/tools/forge-remove-group-dependency.js +19 -0
  125. package/dist/mcp/tools/forge-remove-task-dependency.d.ts +4 -0
  126. package/dist/mcp/tools/forge-remove-task-dependency.js +19 -0
  127. package/dist/mcp/tools/forge-requeue.d.ts +4 -0
  128. package/dist/mcp/tools/forge-requeue.js +39 -0
  129. package/dist/mcp/tools/forge-submit-pr.d.ts +4 -0
  130. package/dist/mcp/tools/forge-submit-pr.js +68 -0
  131. package/dist/mcp/tools/forge-update-status.d.ts +4 -0
  132. package/dist/mcp/tools/forge-update-status.js +77 -0
  133. package/dist/mcp/tools/forge-update-task-group.d.ts +4 -0
  134. package/dist/mcp/tools/forge-update-task-group.js +21 -0
  135. package/dist/mcp/tools/forge-update-task.d.ts +4 -0
  136. package/dist/mcp/tools/forge-update-task.js +25 -0
  137. package/dist/mcp/tools/forge-validate-merge.d.ts +4 -0
  138. package/dist/mcp/tools/forge-validate-merge.js +194 -0
  139. package/dist/mcp/types.d.ts +39 -0
  140. package/dist/mcp/types.js +8 -0
  141. package/dist/methodology/artifact-manager.d.ts +14 -0
  142. package/dist/methodology/artifact-manager.js +55 -0
  143. package/dist/orchestrator/agent-registry.d.ts +53 -0
  144. package/dist/orchestrator/agent-registry.js +96 -0
  145. package/dist/orchestrator/agent-spawner.d.ts +112 -0
  146. package/dist/orchestrator/agent-spawner.js +1518 -0
  147. package/dist/orchestrator/connectors/claude-code-connector.d.ts +3 -0
  148. package/dist/orchestrator/connectors/claude-code-connector.js +60 -0
  149. package/dist/orchestrator/connectors/connector.d.ts +95 -0
  150. package/dist/orchestrator/connectors/connector.js +25 -0
  151. package/dist/orchestrator/connectors/docker-connector.d.ts +14 -0
  152. package/dist/orchestrator/connectors/docker-connector.js +337 -0
  153. package/dist/orchestrator/connectors/native-vm-connector.d.ts +11 -0
  154. package/dist/orchestrator/connectors/native-vm-connector.js +162 -0
  155. package/dist/orchestrator/connectors/opencode-connector.d.ts +3 -0
  156. package/dist/orchestrator/connectors/opencode-connector.js +39 -0
  157. package/dist/orchestrator/connectors/vm-connector.d.ts +3 -0
  158. package/dist/orchestrator/connectors/vm-connector.js +139 -0
  159. package/dist/orchestrator/dispatch-queue.d.ts +43 -0
  160. package/dist/orchestrator/dispatch-queue.js +93 -0
  161. package/dist/orchestrator/resume-handler.d.ts +34 -0
  162. package/dist/orchestrator/resume-handler.js +159 -0
  163. package/dist/orchestrator/stream-batcher.d.ts +16 -0
  164. package/dist/orchestrator/stream-batcher.js +50 -0
  165. package/dist/orchestrator/stream-json-extractor.d.ts +97 -0
  166. package/dist/orchestrator/stream-json-extractor.js +579 -0
  167. package/dist/vm/claude-token-manager.d.ts +36 -0
  168. package/dist/vm/claude-token-manager.js +223 -0
  169. package/dist/vm/docker-executor.d.ts +131 -0
  170. package/dist/vm/docker-executor.js +360 -0
  171. package/dist/vm/docker-process-proxy.d.ts +31 -0
  172. package/dist/vm/docker-process-proxy.js +105 -0
  173. package/dist/vm/forge-vm-agent.d.ts +11 -0
  174. package/dist/vm/forge-vm-agent.js +159 -0
  175. package/dist/vm/git-credentials.d.ts +43 -0
  176. package/dist/vm/git-credentials.js +53 -0
  177. package/dist/vm/image-manager.d.ts +7 -0
  178. package/dist/vm/image-manager.js +61 -0
  179. package/dist/vm/log.d.ts +9 -0
  180. package/dist/vm/log.js +18 -0
  181. package/dist/vm/mcp-bridge.d.ts +63 -0
  182. package/dist/vm/mcp-bridge.js +243 -0
  183. package/dist/vm/mcp-stub.d.ts +15 -0
  184. package/dist/vm/mcp-stub.js +67 -0
  185. package/dist/vm/native-addon.d.ts +69 -0
  186. package/dist/vm/native-addon.js +68 -0
  187. package/dist/vm/provider-resolver.d.ts +7 -0
  188. package/dist/vm/provider-resolver.js +27 -0
  189. package/dist/vm/providers/lima.d.ts +17 -0
  190. package/dist/vm/providers/lima.js +191 -0
  191. package/dist/vm/providers/qemu.d.ts +28 -0
  192. package/dist/vm/providers/qemu.js +260 -0
  193. package/dist/vm/providers/vfkit.d.ts +40 -0
  194. package/dist/vm/providers/vfkit.js +371 -0
  195. package/dist/vm/providers/wsl2.d.ts +27 -0
  196. package/dist/vm/providers/wsl2.js +226 -0
  197. package/dist/vm/session-manager.d.ts +130 -0
  198. package/dist/vm/session-manager.js +494 -0
  199. package/dist/vm/session-snapshot.d.ts +31 -0
  200. package/dist/vm/session-snapshot.js +180 -0
  201. package/dist/vm/types.d.ts +73 -0
  202. package/dist/vm/types.js +2 -0
  203. package/dist/vm/vm-helper-client.d.ts +81 -0
  204. package/dist/vm/vm-helper-client.js +335 -0
  205. package/dist/vm/vm-helper.d.ts +11 -0
  206. package/dist/vm/vm-helper.js +156 -0
  207. package/dist/vm/vm-ipc-protocol.d.ts +84 -0
  208. package/dist/vm/vm-ipc-protocol.js +9 -0
  209. package/dist/vm/vm-manager-facade.d.ts +23 -0
  210. package/dist/vm/vm-manager-facade.js +43 -0
  211. package/dist/vm/vm-manager.d.ts +74 -0
  212. package/dist/vm/vm-manager.js +515 -0
  213. package/dist/vm/vm-process-proxy.d.ts +34 -0
  214. package/dist/vm/vm-process-proxy.js +64 -0
  215. package/dist/vm/vsock-bridge.d.ts +44 -0
  216. package/dist/vm/vsock-bridge.js +140 -0
  217. package/dist/vm/vsock-protocol.d.ts +98 -0
  218. package/dist/vm/vsock-protocol.js +57 -0
  219. package/package.json +65 -0
  220. package/rootfs/Dockerfile +50 -0
  221. package/rootfs/forge-mcp-relay.mjs +158 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # @getforgeai/cli
2
+
3
+ The ForgeAI CLI (`forge`) is the execution engine that runs on your machine. It connects to the ForgeAI cockpit, receives dispatched work, and runs AI coding agents in local Docker containers using **your own AI tokens**.
4
+
5
+ Your repository is cloned inside a container on your machine and your AI credentials never leave it — the cockpit stores coordination data (tasks, workflow state, artifacts), not your working tree.
6
+
7
+ > **Beta software.** This is a `0.1.0-beta` release. Expect rough edges, and pin the version if you need stability. See [Known limitations](#known-limitations).
8
+
9
+ ## Requirements
10
+
11
+ | Requirement | Details |
12
+ |---|---|
13
+ | Node.js | 20.11 or newer (`forge connect` and the agent image build rely on `import.meta.dirname`) |
14
+ | Docker | Required for agent execution. Not needed just to install the CLI. |
15
+ | git | The CLI shells out to the `git` binary for clone, fetch and checkout. |
16
+ | A ForgeAI account | Sign up in the cockpit, then authenticate the CLI (below). |
17
+ | An AI agent subscription | Claude Code is the only supported runner today. |
18
+
19
+ ## Install
20
+
21
+ ```bash
22
+ npm install -g @getforgeai/cli@beta
23
+ ```
24
+
25
+ Verify it works:
26
+
27
+ ```bash
28
+ forge --version
29
+ ```
30
+
31
+ The package installs two identical binaries, `forge` and `forgeai`.
32
+
33
+ ## Quickstart
34
+
35
+ Authenticate against your cockpit with the OAuth device flow. The `--server` flag is **required** for anything other than `http://localhost:3000`, and is persisted for the background daemon:
36
+
37
+ ```bash
38
+ forge auth login --server https://your-cockpit-url
39
+ ```
40
+
41
+ The CLI prints an 8-character code and opens the approval page — approve it there, and the CLI links your organizations.
42
+
43
+ Then connect your machine so it can receive work:
44
+
45
+ ```bash
46
+ forge connect
47
+ ```
48
+
49
+ Check state at any time:
50
+
51
+ ```bash
52
+ forge auth status
53
+ forge cli list
54
+ ```
55
+
56
+ All CLI state lives under `~/.forgeai/` (config, encrypted credentials, the background daemon, the local NDJSON event journal, and per-session agent directories).
57
+
58
+ ## Documentation
59
+
60
+ Full documentation — prerequisites, the complete command reference, BMAD workflows, the task board, releases, security model and troubleshooting — lives in the cockpit under `/docs`.
61
+
62
+ ## Known limitations
63
+
64
+ This beta ships with a few honest caveats:
65
+
66
+ - **Claude Code only** — the agent-type setting mentions OpenCode, but only Claude Code is implemented.
67
+ - **Apple Silicon first** — the agent Docker image is built for `linux/arm64`; other hosts need emulation.
68
+ - **Pending end-to-end validation** — two recent security fixes (the authenticated MCP bridge, and keeping git credentials out of the clone) have unit coverage and were validated on macOS, but the full Linux and private-repo clone/push flows are still being exercised. Please report anything that breaks.
69
+
70
+ ## Security
71
+
72
+ - CLI tokens are Bearer tokens stored in the OS keychain (or an encrypted file) — never logged and never placed in URLs.
73
+ - The per-session MCP bridge requires a per-session shared secret and binds to the loopback / Docker bridge interface, never `0.0.0.0`.
74
+ - Agent containers receive secrets by environment variable name only, so credentials do not appear in the host process table.
75
+
76
+ To report a security issue, please use the [contact form](https://forgeai-production-382c.up.railway.app/contact) rather than a public channel, so it can be fixed before it is disclosed.
77
+
78
+ ## License
79
+
80
+ [Apache-2.0](./LICENSE)
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=forgeai.d.ts.map
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ // Runs before anything else: on Node < engines.node several commands fail with
3
+ // an opaque "path argument must be of type string" instead of saying so.
4
+ import { assertSupportedNodeVersion } from "../lib/node-version-guard.js";
5
+ assertSupportedNodeVersion();
6
+ const { program } = await import("../cli.js");
7
+ await program.parseAsync(process.argv);
8
+ //# sourceMappingURL=forgeai.js.map
package/dist/cli.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { Command } from "commander";
2
+ declare const program: Command;
3
+ export { program };
4
+ //# sourceMappingURL=cli.d.ts.map
package/dist/cli.js ADDED
@@ -0,0 +1,180 @@
1
+ import { Command } from "commander";
2
+ import { VERSION } from "./index.js";
3
+ import { loginAction } from "./commands/auth-login.js";
4
+ import { statusAction } from "./commands/auth-status.js";
5
+ import { logoutAction } from "./commands/auth-logout.js";
6
+ import { cliListAction } from "./commands/cli-list.js";
7
+ import { cliUnlinkAction } from "./commands/cli-unlink.js";
8
+ import { connectAction } from "./commands/connect.js";
9
+ import { disconnectAction } from "./commands/disconnect.js";
10
+ import { reconnectAction } from "./commands/reconnect.js";
11
+ import { orgListAction } from "./commands/org-list.js";
12
+ import { orgUnlinkAction } from "./commands/org-unlink.js";
13
+ import { journalListAction } from "./commands/journal-list.js";
14
+ import { journalClearAction } from "./commands/journal-clear.js";
15
+ import { journalStatusAction } from "./commands/journal-status.js";
16
+ import { configSetAgentTypeAction, configSetAgentSlotsAction, configSetOpenerAction, configGetAction, } from "./commands/config-set.js";
17
+ import { mcpServeAction } from "./commands/mcp-serve.js";
18
+ import { releaseOpenAction } from "./commands/release-open.js";
19
+ import { sessionRespondAction } from "./commands/session-respond.js";
20
+ import { taskOpenAction } from "./commands/task-open.js";
21
+ import { workflowOpenAction } from "./commands/workflow-open.js";
22
+ import { vmInitAction, vmStatusAction, vmCleanupAction, vmStopAllAction, setupClaudeTokenAction, } from "./commands/vm.js";
23
+ const program = new Command();
24
+ program
25
+ .name("forge")
26
+ .description("ForgeAI CLI - AI-assisted development cockpit")
27
+ .version(VERSION);
28
+ const authCmd = program
29
+ .command("auth")
30
+ .description("Authentication management");
31
+ authCmd
32
+ .command("login")
33
+ .description("Authenticate with ForgeAI Cloud via Device Flow")
34
+ .option("--server <url>", "Cloud server URL")
35
+ .action((options) => loginAction(options));
36
+ authCmd
37
+ .command("status")
38
+ .description("Check authentication status")
39
+ .option("--server <url>", "Cloud server URL")
40
+ .action((options) => statusAction(options));
41
+ authCmd
42
+ .command("logout")
43
+ .description("Remove stored credentials")
44
+ .action(() => logoutAction());
45
+ authCmd
46
+ .command("setup-claude")
47
+ .description("Obtain a long-lived Claude Code OAuth token")
48
+ .action(() => setupClaudeTokenAction());
49
+ program
50
+ .command("connect")
51
+ .description("Connect to ForgeAI Cloud (spawns background daemon by default)")
52
+ .option("--server <url>", "Cloud server URL")
53
+ .option("--org <slug>", "Organization slug to connect to")
54
+ .option("--attach", "Run in foreground mode (blocks terminal)")
55
+ .option("--stop", "Shutdown the background daemon")
56
+ .action((options) => connectAction(options));
57
+ program
58
+ .command("reconnect")
59
+ .description("Reconnect disconnected WebSocket connections via daemon")
60
+ .option("--org <slug>", "Reconnect specific organization only")
61
+ .action((options) => reconnectAction(options));
62
+ program
63
+ .command("disconnect")
64
+ .description("Close WebSocket connections (CLI remains registered)")
65
+ .option("--server <url>", "Cloud server URL")
66
+ .option("--org <slug>", "Disconnect from specific organization only")
67
+ .action((options) => disconnectAction(options));
68
+ const orgCmd = program
69
+ .command("org")
70
+ .description("Manage organization connections");
71
+ orgCmd
72
+ .command("list")
73
+ .description("List all linked organizations with connection status")
74
+ .option("--server <url>", "Cloud server URL")
75
+ .action((options) => orgListAction(options));
76
+ orgCmd
77
+ .command("unlink <slug>")
78
+ .description("Unlink this CLI from an organization")
79
+ .option("--server <url>", "Cloud server URL")
80
+ .action((slug, options) => orgUnlinkAction(slug, options));
81
+ const cliCmd = program
82
+ .command("cli")
83
+ .description("Manage CLI device registrations");
84
+ cliCmd
85
+ .command("list")
86
+ .description("List all registered CLI devices for your organization")
87
+ .option("--server <url>", "Cloud server URL")
88
+ .action((options) => cliListAction(options));
89
+ cliCmd
90
+ .command("unlink <cliId>")
91
+ .description("Unregister a CLI device by its ID")
92
+ .option("--server <url>", "Cloud server URL")
93
+ .action((cliId, options) => cliUnlinkAction(cliId, options));
94
+ const journalCmd = program
95
+ .command("journal")
96
+ .description("Manage the local event journal (debugging)");
97
+ journalCmd
98
+ .command("list [projectId]")
99
+ .description("Show pending events count and last event timestamp")
100
+ .action((projectId) => journalListAction(projectId));
101
+ journalCmd
102
+ .command("clear [projectId]")
103
+ .description("Clear synced events from the journal")
104
+ .action((projectId) => journalClearAction(projectId));
105
+ journalCmd
106
+ .command("status")
107
+ .description("Show sync status: last sync time, pending events, cursor")
108
+ .action(() => journalStatusAction());
109
+ const configCmd = program
110
+ .command("config")
111
+ .description("Manage CLI configuration");
112
+ const configSetCmd = configCmd
113
+ .command("set")
114
+ .description("Set a configuration value");
115
+ configSetCmd
116
+ .command("agent-type <value>")
117
+ .description("Set agent type (CLAUDE_CODE or OPENCODE)")
118
+ .action((value) => configSetAgentTypeAction(value));
119
+ configSetCmd
120
+ .command("agent-slots <value>")
121
+ .description("Set agent slots (1-20)")
122
+ .action((value) => configSetAgentSlotsAction(value));
123
+ configSetCmd
124
+ .command("opener <value>")
125
+ .description("Set how 'forge open' opens directories (terminal, vscode, finder)")
126
+ .action((value) => configSetOpenerAction(value));
127
+ configCmd
128
+ .command("get")
129
+ .description("Display current configuration values")
130
+ .action(() => configGetAction());
131
+ const sessionCmd = program
132
+ .command("session")
133
+ .description("Manage agent sessions");
134
+ sessionCmd
135
+ .command("respond <taskId> <response>")
136
+ .description("Respond to an agent question for a task")
137
+ .action((taskId, response) => sessionRespondAction(taskId, response));
138
+ program
139
+ .command("mcp")
140
+ .description("Start MCP server bridge for agent subprocess (stdio transport)")
141
+ .requiredOption("--task-id <id>", "Task ID for this agent session")
142
+ .requiredOption("--project-id <id>", "Project ID")
143
+ .requiredOption("--org-id <id>", "Organization ID")
144
+ .option("--workflow-id <id>", "Workflow ID (for workflow step context)")
145
+ .option("--step-id <id>", "Workflow step ID (for workflow step context)")
146
+ .action((options) => mcpServeAction(options));
147
+ const taskCmd = program.command("task").description("Manage tasks");
148
+ taskCmd
149
+ .command("open <taskId>")
150
+ .description("Clone task branch and open in terminal/IDE")
151
+ .action((taskId) => taskOpenAction(taskId));
152
+ const workflowCmd = program.command("workflow").description("Manage workflows");
153
+ workflowCmd
154
+ .command("open <workflowId>")
155
+ .description("Clone workflow branch and open in terminal/IDE")
156
+ .action((workflowId) => workflowOpenAction(workflowId));
157
+ const releaseCmd = program.command("release").description("Manage releases");
158
+ releaseCmd
159
+ .command("open <releaseId>")
160
+ .description("Clone release branch and open in terminal/IDE")
161
+ .action((releaseId) => releaseOpenAction(releaseId));
162
+ const vmCmd = program.command("vm").description("VM management");
163
+ vmCmd
164
+ .command("init")
165
+ .description("Download rootfs and verify provider is installed")
166
+ .action(() => vmInitAction());
167
+ vmCmd
168
+ .command("status")
169
+ .description("List running VMs")
170
+ .action(() => vmStatusAction());
171
+ vmCmd
172
+ .command("cleanup")
173
+ .description("Destroy orphaned VMs")
174
+ .action(() => vmCleanupAction());
175
+ vmCmd
176
+ .command("stop-all")
177
+ .description("Force stop all VMs")
178
+ .action(() => vmStopAllAction());
179
+ export { program };
180
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1,4 @@
1
+ export declare function loginAction(options: {
2
+ server?: string;
3
+ }): Promise<void>;
4
+ //# sourceMappingURL=auth-login.d.ts.map