@jslee124/forge 0.3.0 → 0.3.2

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 (35) hide show
  1. package/dist/index.js +1189 -90
  2. package/package.json +2 -1
  3. package/resources/docs/en/ARCHITECTURE.md +519 -0
  4. package/resources/docs/en/AUTHENTICATION.md +224 -0
  5. package/resources/docs/en/CLI_UI.md +266 -0
  6. package/resources/docs/en/CONFIGURATION.md +263 -0
  7. package/resources/docs/en/CONTEXT_MANAGEMENT.md +692 -0
  8. package/resources/docs/en/GETTING_STARTED.md +241 -0
  9. package/resources/docs/en/PLUGINS.md +622 -0
  10. package/resources/docs/en/PRODUCT.md +157 -0
  11. package/resources/docs/en/PROJECT_CONTEXT.md +225 -0
  12. package/resources/docs/en/RELEASING.md +94 -0
  13. package/resources/docs/en/SECURITY.md +272 -0
  14. package/resources/docs/en/SESSIONS.md +134 -0
  15. package/resources/docs/en/TROUBLESHOOTING.md +256 -0
  16. package/resources/docs/index.json +24334 -0
  17. package/resources/docs/zh-CN/ARCHITECTURE.md +174 -0
  18. package/resources/docs/zh-CN/AUTHENTICATION.md +96 -0
  19. package/resources/docs/zh-CN/CLI_UI.md +112 -0
  20. package/resources/docs/zh-CN/CONFIGURATION.md +221 -0
  21. package/resources/docs/zh-CN/CONTEXT_MANAGEMENT.md +200 -0
  22. package/resources/docs/zh-CN/GETTING_STARTED.md +193 -0
  23. package/resources/docs/zh-CN/PLUGINS.md +286 -0
  24. package/resources/docs/zh-CN/PRODUCT.md +86 -0
  25. package/resources/docs/zh-CN/PROJECT_CONTEXT.md +130 -0
  26. package/resources/docs/zh-CN/RELEASING.md +86 -0
  27. package/resources/docs/zh-CN/SECURITY.md +92 -0
  28. package/resources/docs/zh-CN/SESSIONS.md +69 -0
  29. package/resources/docs/zh-CN/TROUBLESHOOTING.md +185 -0
  30. package/resources/skills/forge-plugin-creator/SKILL.md +70 -0
  31. package/resources/skills/forge-plugin-creator/references/plugin-api.md +36 -0
  32. package/resources/skills/forge-plugin-creator/templates/index.mjs +30 -0
  33. package/resources/skills/forge-plugin-creator/templates/plugin.json +8 -0
  34. package/resources/skills/forge-plugin-creator/templates/plugin.test-template.ts +14 -0
  35. package/resources/skills/forge-product-help/SKILL.md +16 -0
@@ -0,0 +1,241 @@
1
+ # Getting Started
2
+
3
+ 简体中文 · Documentation index
4
+
5
+ This guide takes a new contributor from a clean checkout to a verified Forge
6
+ session. It uses only local validation until you deliberately send a prompt to
7
+ a provider.
8
+
9
+ ## What you will do
10
+
11
+ 1. Install and build the development checkout.
12
+ 2. Choose one model-access route.
13
+ 3. Validate the effective configuration without a paid request.
14
+ 4. Run a read-only prompt, then a coding task with explicit approvals.
15
+ 5. Find the saved session and run trace.
16
+
17
+ ## Prerequisites
18
+
19
+ - Node.js 24 or newer
20
+ - pnpm 11.18.0, as pinned by the root `packageManager` field
21
+ - Git
22
+ - One model-access route:
23
+ - a DeepSeek API key;
24
+ - an OpenAI API key;
25
+ - a configured OpenAI-compatible endpoint; or
26
+ - Codex CLI with an eligible ChatGPT account for the separate Codex Engine.
27
+
28
+ Forge's development workspace remains private. Release automation produces one
29
+ public CLI package, `@jslee124/forge`, while internal packages and the plugin
30
+ SDK remain private. Until the first npm release is visible, run from source or
31
+ link the current checkout globally.
32
+
33
+ For a published build:
34
+
35
+ ```bash
36
+ npm install --global @jslee124/forge
37
+ forge --version
38
+ ```
39
+
40
+ ## 1. Install the checkout
41
+
42
+ ```bash
43
+ git clone https://github.com/jslee124/forge.git
44
+ cd forge
45
+ pnpm install --frozen-lockfile
46
+ pnpm build
47
+ pnpm forge --version
48
+ ```
49
+
50
+ The final command builds the workspace and should print `0.3.2` for the current
51
+ source release. It does not contact a model provider.
52
+
53
+ During development you can keep using `pnpm forge`. To expose the same checkout
54
+ as a global `forge` command:
55
+
56
+ ```bash
57
+ pnpm link:global
58
+ forge --version
59
+ ```
60
+
61
+ The link points to `apps/cli/dist`, so run `pnpm build` after source changes.
62
+ Remove it later with `pnpm unlink:global`.
63
+
64
+ ## 2. Choose an access route
65
+
66
+ Forge exposes two execution engines. Pick the route that matches how you want
67
+ to authenticate and which runtime should own tools and approvals.
68
+
69
+ | Route | Engine | Credential owner | Start here |
70
+ | --- | --- | --- | --- |
71
+ | DeepSeek API | Forge Engine | Forge stored key or `DEEPSEEK_API_KEY` | Run `pnpm forge`, then `/login` |
72
+ | OpenAI API | Forge Engine | Forge stored key or `OPENAI_API_KEY` | Run `pnpm forge`, then `/login` |
73
+ | OpenAI-compatible endpoint | Forge Engine | Configured environment variable or Forge stored route key | Add the route through `/login` or user configuration |
74
+ | ChatGPT subscription | Codex Engine | Codex App Server | `pnpm forge auth login openai` |
75
+
76
+ OpenAI API usage and ChatGPT subscription access are separate. A ChatGPT
77
+ subscription does not supply `OPENAI_API_KEY`, and an API key does not make a
78
+ Codex subscription session.
79
+
80
+ ### Option A: interactive API-key setup
81
+
82
+ Start the terminal UI:
83
+
84
+ ```bash
85
+ pnpm forge
86
+ ```
87
+
88
+ Enter `/login`, choose DeepSeek, OpenAI API, or a configured route, and paste
89
+ the key into the masked field. Forge saves it to `$FORGE_HOME/auth.json`
90
+ (`~/.forge/auth.json` by default), protected by owner-only filesystem
91
+ permissions. Environment variables take precedence over a saved key.
92
+
93
+ Use `/model` to choose the engine, provider, and model. Use `/effort` or
94
+ Shift+Tab to choose a reasoning level advertised by that model.
95
+
96
+ ### Option B: environment variables
97
+
98
+ Environment variables are convenient for automation and temporary shells:
99
+
100
+ ```bash
101
+ export DEEPSEEK_API_KEY="your-api-key"
102
+ # or
103
+ export OPENAI_API_KEY="your-api-key"
104
+ ```
105
+
106
+ Do not put keys in `.forge/config.json`, prompts, committed shell files, issue
107
+ reports, or run-trace examples. Forge's user and project configuration schemas
108
+ reject secret fields.
109
+
110
+ ### Option C: ChatGPT subscription through Codex
111
+
112
+ Install Codex CLI first, then let the official App Server own browser or device
113
+ code sign-in:
114
+
115
+ ```bash
116
+ pnpm forge auth login openai
117
+ pnpm forge auth status openai
118
+ pnpm forge models list --provider openai
119
+ ```
120
+
121
+ For a headless machine, use:
122
+
123
+ ```bash
124
+ pnpm forge auth login openai --method device-code
125
+ ```
126
+
127
+ The Codex Engine owns its own agent runtime, sandbox, tools, approvals, and
128
+ conversation state. Native Forge plugins and JSONL run traces do not wrap that
129
+ engine. See Authentication for the complete boundary.
130
+
131
+ ## 3. Validate configuration locally
132
+
133
+ These commands parse and merge configuration without making a model request:
134
+
135
+ ```bash
136
+ pnpm forge config validate
137
+ pnpm forge config show
138
+ pnpm forge plugins list
139
+ ```
140
+
141
+ `config show` prints the effective value and source for each public setting. A
142
+ fresh configuration begins with the `safe` permission profile, 12 model steps,
143
+ 40 tool calls, a 60-second command timeout, trace persistence enabled, and
144
+ context mode `warn`.
145
+
146
+ If the output is surprising, read Configuration before
147
+ starting a run. In particular, project `.forge/config.json` may only tighten
148
+ limits and context behavior; it cannot select a model, enable plugins, or widen
149
+ permissions.
150
+
151
+ ## 4. Run a first task
152
+
153
+ ### Start read-only
154
+
155
+ From a small repository you understand, start the interactive UI:
156
+
157
+ ```bash
158
+ pnpm forge
159
+ ```
160
+
161
+ Ask a bounded question first:
162
+
163
+ ```text
164
+ Inspect this repository. Summarize the package structure and name the commands
165
+ that verify a change. Do not modify files.
166
+ ```
167
+
168
+ Workspace listing, reading, and search are allowed automatically under the
169
+ default `safe` profile. A native Forge Engine run streams model output and
170
+ provider-exposed reasoning separately and records structured runtime events.
171
+
172
+ ### Try a coding task
173
+
174
+ ```text
175
+ Fix one failing test. Show the proposed diff and run the narrowest relevant
176
+ verification command before reporting success.
177
+ ```
178
+
179
+ Under `safe`, Forge asks before the first workspace write in that run and before
180
+ every process command. Read the full diff, command arguments, working directory,
181
+ and timeout before approving. Approval is not process isolation: an approved
182
+ program runs with your user privileges.
183
+
184
+ If you reject an action, Forge records the denial. It does not silently widen
185
+ the policy or treat missing input as consent.
186
+
187
+ ### One-shot commands
188
+
189
+ Use the native Forge Engine without entering the interactive UI:
190
+
191
+ ```bash
192
+ pnpm forge run "Inspect the repository and summarize its architecture"
193
+ ```
194
+
195
+ Use the separate Codex Engine:
196
+
197
+ ```bash
198
+ pnpm forge codex "Inspect the repository and summarize its architecture"
199
+ # equivalent engine selection:
200
+ pnpm forge run --engine codex "Inspect the repository"
201
+ ```
202
+
203
+ A one-shot native run started from a TTY presents approval prompts in plain
204
+ terminal UI. If stdin or stderr is redirected, there is no approval channel and
205
+ any confirmation-required action is denied, so automated invocations should
206
+ start with read-only prompts unless they provide an explicit narrow channel.
207
+
208
+ ## 5. Continue and inspect
209
+
210
+ Inside the terminal UI:
211
+
212
+ ```text
213
+ /context show the current context budget and checkpoint status
214
+ /compact create an explicit conversation checkpoint
215
+ /resume choose a saved session for this workspace
216
+ /help show every interactive command
217
+ ```
218
+
219
+ From the shell:
220
+
221
+ ```bash
222
+ pnpm forge resume --last
223
+ pnpm forge inspect <run-id>
224
+ ```
225
+
226
+ A session stores completed user/assistant turns. A run is one bounded agent-loop
227
+ execution with its own ID and JSONL event trace. Resume restores completed
228
+ conversation text, not old approvals, pending tool calls, child processes, or
229
+ provider continuation state. See Sessions and traces.
230
+
231
+ ## Next steps
232
+
233
+ - Learn every terminal control in CLI UI.
234
+ - Customize models and limits with Configuration.
235
+ - Read Security before opening an untrusted repository or
236
+ trusting a plugin.
237
+ - Add repository instructions or a Skill with Project context.
238
+ - Build an extension with Plugin authoring.
239
+ - Reproduce the paid-call-free evidence with `pnpm eval:deterministic` and the
240
+ Evaluation guide.
241
+ - If setup does not behave as described, use Troubleshooting.