fecode-cli 1.1.2 → 1.2.0

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 (85) hide show
  1. package/README.md +101 -10
  2. package/dist/error-D4a-8BXd.js +56 -0
  3. package/dist/index.js +9770 -4513
  4. package/dist/node.browser-2EgZAKSy.js +46 -0
  5. package/dist/node.browser-B5Gur0wd.js +46 -0
  6. package/dist/node.browser-BSlAsiSV.js +46 -0
  7. package/dist/node.browser-BraUi2yf.js +9 -0
  8. package/dist/node.browser-CdVAMgSg.js +46 -0
  9. package/dist/src-CSWdjU4j.js +31870 -0
  10. package/dist/src-DY3OmBmT.js +33646 -0
  11. package/dist/src-DcYf8vsK.js +31880 -0
  12. package/dist/src-DkWmcv2Q.js +33647 -0
  13. package/package.json +5 -2
  14. package/skills/accessibility/SKILL.md +98 -98
  15. package/skills/css/SKILL.md +90 -90
  16. package/skills/frontend-debugging/SKILL.md +201 -201
  17. package/skills/frontend-design/SKILL.md +358 -358
  18. package/skills/frontend-performance/SKILL.md +89 -89
  19. package/skills/frontend-testing/SKILL.md +87 -87
  20. package/skills/nextjs/SKILL.md +75 -75
  21. package/skills/react/SKILL.md +213 -213
  22. package/skills/responsive-design/SKILL.md +190 -190
  23. package/skills/svelte/SKILL.md +86 -86
  24. package/skills/tailwind/SKILL.md +74 -74
  25. package/skills/ui-review/SKILL.md +245 -245
  26. package/skills/vue/SKILL.md +72 -72
  27. package/dist/App.d.ts +0 -33
  28. package/dist/App.js +0 -2224
  29. package/dist/approvalResolver.d.ts +0 -12
  30. package/dist/approvalResolver.js +0 -112
  31. package/dist/commands.d.ts +0 -11
  32. package/dist/commands.js +0 -33
  33. package/dist/index.d.ts +0 -3
  34. package/dist/ui/AppShell.d.ts +0 -14
  35. package/dist/ui/AppShell.js +0 -25
  36. package/dist/ui/ApprovalPrompt.d.ts +0 -31
  37. package/dist/ui/ApprovalPrompt.js +0 -55
  38. package/dist/ui/BlockedView.d.ts +0 -13
  39. package/dist/ui/BlockedView.js +0 -7
  40. package/dist/ui/CommandPalette.d.ts +0 -8
  41. package/dist/ui/CommandPalette.js +0 -18
  42. package/dist/ui/CurrentStepView.d.ts +0 -16
  43. package/dist/ui/CurrentStepView.js +0 -28
  44. package/dist/ui/DiagnosticsView.d.ts +0 -45
  45. package/dist/ui/DiagnosticsView.js +0 -23
  46. package/dist/ui/ExecutionTimeline.d.ts +0 -15
  47. package/dist/ui/ExecutionTimeline.js +0 -51
  48. package/dist/ui/ExecutionView.d.ts +0 -42
  49. package/dist/ui/ExecutionView.js +0 -20
  50. package/dist/ui/Header.d.ts +0 -15
  51. package/dist/ui/Header.js +0 -47
  52. package/dist/ui/HelpView.d.ts +0 -3
  53. package/dist/ui/HelpView.js +0 -35
  54. package/dist/ui/MessageBubble.d.ts +0 -9
  55. package/dist/ui/MessageBubble.js +0 -58
  56. package/dist/ui/PlanStep.d.ts +0 -16
  57. package/dist/ui/PlanStep.js +0 -71
  58. package/dist/ui/PlanView.d.ts +0 -26
  59. package/dist/ui/PlanView.js +0 -24
  60. package/dist/ui/ProgressBar.d.ts +0 -10
  61. package/dist/ui/ProgressBar.js +0 -14
  62. package/dist/ui/RecoveryView.d.ts +0 -20
  63. package/dist/ui/RecoveryView.js +0 -19
  64. package/dist/ui/ReplanView.d.ts +0 -16
  65. package/dist/ui/ReplanView.js +0 -21
  66. package/dist/ui/ResumeView.d.ts +0 -15
  67. package/dist/ui/ResumeView.js +0 -25
  68. package/dist/ui/RiskNotice.d.ts +0 -10
  69. package/dist/ui/RiskNotice.js +0 -21
  70. package/dist/ui/RunHistoryView.d.ts +0 -15
  71. package/dist/ui/RunHistoryView.js +0 -39
  72. package/dist/ui/StatusBar.d.ts +0 -16
  73. package/dist/ui/StatusBar.js +0 -104
  74. package/dist/ui/TaskInput.d.ts +0 -15
  75. package/dist/ui/TaskInput.js +0 -8
  76. package/dist/ui/ThinkingBlock.d.ts +0 -8
  77. package/dist/ui/ThinkingBlock.js +0 -13
  78. package/dist/ui/ThinkingIndicator.d.ts +0 -7
  79. package/dist/ui/ThinkingIndicator.js +0 -20
  80. package/dist/ui/TurnView.d.ts +0 -13
  81. package/dist/ui/TurnView.js +0 -11
  82. package/dist/ui/WorkspaceStatus.d.ts +0 -20
  83. package/dist/ui/WorkspaceStatus.js +0 -23
  84. package/dist/ui/index.d.ts +0 -26
  85. package/dist/ui/index.js +0 -26
package/README.md CHANGED
@@ -11,8 +11,8 @@
11
11
  <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E=20.0.0-brightgreen.svg" alt="Node.js version" /></a>
12
12
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License" /></a>
13
13
  <img src="https://img.shields.io/badge/typescript-strict%205.7+-blue.svg" alt="TypeScript Strict" />
14
- <img src="https://img.shields.io/badge/tests-1346%20passed-success.svg" alt="Tests" />
15
- <img src="https://img.shields.io/badge/version-1.1.2-brightgreen.svg" alt="Version 1.1.2" />
14
+ <img src="https://img.shields.io/badge/tests-1470%20passed-success.svg" alt="Tests" />
15
+ <img src="https://img.shields.io/badge/version-1.2.0-brightgreen.svg" alt="Version 1.2.0" />
16
16
  </p>
17
17
 
18
18
  ---
@@ -166,9 +166,35 @@ npm link --workspace=apps/cli
166
166
 
167
167
  ## Quick Start
168
168
 
169
- ### 1. Configure Provider Credentials
169
+ ### 1. In-App Setup (First-Run Onboarding)
170
170
 
171
- Set your provider and credentials using environment variables or a `.env` file in your workspace:
171
+ When launching FeCode for the first time without environment variables, FeCode displays an interactive first-run setup wizard directly in your terminal:
172
+
173
+ ```text
174
+ ╭──────────────────────────────────────────╮
175
+ │ Welcome to FeCode │
176
+ │ │
177
+ │ Configure your AI provider │
178
+ │ │
179
+ │ Select a provider: │
180
+ │ │
181
+ │ > Google Gemini │
182
+ │ OpenAI │
183
+ │ Ollama │
184
+ │ OpenAI-compatible │
185
+ │ │
186
+ │ Enter to continue │
187
+ ╰──────────────────────────────────────────╯
188
+ ```
189
+
190
+ 1. Select your preferred provider using `↑`/`↓` and press `Enter`.
191
+ 2. Enter your API key (masked with `*`) and model ID.
192
+ 3. FeCode tests authentication and model availability before saving.
193
+ 4. Your API key is encrypted and stored in your **Operating System Credential Vault** (Windows Credential Manager, macOS Keychain, or Linux Secret Service). Plaintext keys are never written to disk.
194
+
195
+ ### 2. Alternative: Environment Variable Configuration
196
+
197
+ Existing deployments, CI/CD pipelines, and terminal setups can continue exporting environment variables or using a workspace `.env` file:
172
198
 
173
199
  ```bash
174
200
  # Option 1: Google Gemini (Recommended Default)
@@ -186,11 +212,16 @@ export FE_PROVIDER="ollama"
186
212
  export FE_MODEL="qwen2.5-coder"
187
213
  export OLLAMA_BASE_URL="http://localhost:11434/v1"
188
214
 
189
- # Option 4: Generic OpenAI-Compatible / NVIDIA (e.g. DeepSeek on NVIDIA NIM)
215
+ # Option 4: NVIDIA NIM / OpenAI-Compatible (e.g. DeepSeek on NVIDIA)
190
216
  export FE_PROVIDER="openai-compatible"
191
217
  export FE_MODEL="deepseek-ai/deepseek-v4.1-flash"
192
218
  export OPENAI_API_KEY="your-nvidia-api-key"
193
219
  export OPENAI_BASE_URL="https://integrate.api.nvidia.com/v1"
220
+
221
+ # Option 5: Anthropic Claude
222
+ export FE_PROVIDER="anthropic"
223
+ export FE_MODEL="claude-sonnet-5-5"
224
+ export ANTHROPIC_API_KEY="your-anthropic-api-key"
194
225
  ```
195
226
 
196
227
  ### 2. Launch FeCode
@@ -221,25 +252,66 @@ FeCode will:
221
252
 
222
253
  ## Configuration
223
254
 
224
- FeCode supports layered configuration with deterministic precedence:
255
+ ### Resolution & Precedence Model
256
+
257
+ FeCode resolves AI provider configuration using a strict 3-tier precedence hierarchy:
225
258
 
226
259
  ```text
227
- CLI Flags ──▶ Environment Variables ──▶ Workspace .env ──▶ Built-in Defaults
228
- (Highest) (Lowest)
260
+ 1. Explicit Environment Variables (.env / export) ──▶ (Highest precedence; preserves existing CI & scripts)
261
+ 2. Active Saved Provider Profile (OS Credential Vault)──▶ (In-app /provider profiles)
262
+ 3. First-Run Interactive Onboarding (TUI) ──▶ (Triggered when no provider is configured)
229
263
  ```
230
264
 
265
+ - **Environment Variable Compatibility**: Environment variables continue to work exactly as before. Existing CI pipelines and deployments will not break.
266
+ - **Fail-Fast Explicit Errors**: An invalid explicit environment configuration produces a clear error immediately, rather than silently switching to a saved profile.
267
+ - **Safe Turn Boundaries**: Profile activation takes effect cleanly at turn boundaries; providers are never mutated mid-generation or during tool execution.
268
+
269
+ ### Secure OS Credential Storage
270
+
271
+ FeCode never persists API keys in plaintext files (`.env`, `config.json`, or history). Credentials are stored exclusively in native operating system vaults:
272
+ - **Windows**: Windows Credential Manager
273
+ - **macOS**: Apple Keychain
274
+ - **Linux**: Secret Service API (`gnome-keyring`, `KWallet`, `KeePassXC`) / Linux Kernel Keyutils
275
+
276
+ Metadata is kept in `~/.fecode/providers.json` with opaque references (`fecode:profile:<id>`). If OS secure storage is unavailable, FeCode raises an explicit error and will **never silently fall back to plaintext**.
277
+
231
278
  ### Environment Variables
232
279
 
233
280
  | Variable | Description | Default |
234
281
  | :--- | :--- | :--- |
235
- | `FE_PROVIDER` | LLM provider backend (`gemini`, `openai`, `ollama`, `openai-compatible`) | `gemini` |
282
+ | `FE_PROVIDER` | LLM provider backend (`gemini`, `openai`, `anthropic`, `ollama`, `openai-compatible`) | `gemini` |
236
283
  | `FE_MODEL` | Model name override | Provider-specific |
237
284
  | `GEMINI_API_KEY` | API key for Google Gemini provider | None (Required for Gemini) |
238
285
  | `OPENAI_API_KEY` | API key for OpenAI or OpenAI-compatible provider | None (Required for OpenAI / Compatible) |
286
+ | `ANTHROPIC_API_KEY` | API key for Anthropic Claude provider | None (Required for Anthropic) |
239
287
  | `OPENAI_BASE_URL` | Base API endpoint for OpenAI or OpenAI-compatible services | Standard OpenAI API (`https://api.openai.com/v1`) |
240
288
  | `OLLAMA_BASE_URL` | Base API endpoint for local Ollama daemon | `http://localhost:11434/v1` |
241
289
 
242
- *Refer to [Configuration Documentation](docs/v1/configuration.md) for full configuration specs.*
290
+ ---
291
+
292
+ ## MCP Servers
293
+
294
+ FeCode can connect to external [Model Context Protocol](https://modelcontextprotocol.io) servers and expose their tools to the model alongside its built-in tools. This is file-based configuration — create a `.fecode/mcp.json` in your project (FeCode walks upward from the working directory to find it):
295
+
296
+ ```json
297
+ {
298
+ "mcpServers": {
299
+ "filesystem": {
300
+ "command": "npx",
301
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allow"]
302
+ },
303
+ "remote-example": {
304
+ "url": "https://example.com/mcp",
305
+ "headers": { "Authorization": "Bearer <token>" }
306
+ }
307
+ }
308
+ }
309
+ ```
310
+
311
+ - `command`/`args`/`env`/`cwd` configure a locally-launched stdio server; `url`/`headers` configure a remote HTTP server.
312
+ - Every MCP tool call requires approval by default, the same as `execute_command` — MCP servers are external processes/services, so FeCode treats their tools as untrusted by default.
313
+ - Run `/mcp` inside the TUI to see which configured servers connected and how many tools each exposed.
314
+ - Browse the [official MCP servers list](https://github.com/modelcontextprotocol/servers) for ready-made servers to try.
243
315
 
244
316
  ---
245
317
 
@@ -251,9 +323,19 @@ FeCode abstracts model providers behind a unified streaming interface in `@fecod
251
323
  | :--- | :--- | :---: | :---: | :---: |
252
324
  | **Google Gemini** | `gemini-2.5-flash`, `gemini-1.5-pro` | Yes | Yes | Cloud |
253
325
  | **OpenAI** | `gpt-4o`, `gpt-4o-mini` | Yes | Yes | Cloud |
326
+ | **Anthropic Claude** | `claude-sonnet-5-5`, `claude-opus-5-5` | Yes | Yes | Cloud |
254
327
  | **Generic OpenAI-Compatible** | `deepseek-ai/deepseek-v4.1-flash`, NVIDIA NIM, vLLM, etc. | Yes | Yes | Cloud / Self-Hosted |
255
328
  | **Ollama** | `qwen2.5-coder`, `deepseek-coder` | Yes | Yes | **Local (100% Offline)** |
256
329
 
330
+ #### NVIDIA NIM Example (via Generic OpenAI-Compatible Provider)
331
+
332
+ To configure NVIDIA NIM:
333
+ - **Provider**: `openai-compatible`
334
+ - **Provider Display Name**: `NVIDIA NIM`
335
+ - **Base URL**: `https://integrate.api.nvidia.com/v1`
336
+ - **API Key**: `nvapi-your-key-here`
337
+ - **Model**: `deepseek-ai/deepseek-v4.1-flash`
338
+
257
339
  ---
258
340
 
259
341
  ## CLI & Slash Commands
@@ -277,6 +359,14 @@ Inside the active FeCode terminal session, type `/` to access built-in commands
277
359
  | Slash Command | Description |
278
360
  | :--- | :--- |
279
361
  | `/help` | Display list of commands and keyboard shortcuts |
362
+ | `/provider` | Open interactive AI provider & credential manager |
363
+ | `/provider list` | List all saved provider profiles |
364
+ | `/provider add` | Add a new provider profile |
365
+ | `/provider edit [id]` | Edit an existing provider profile |
366
+ | `/provider delete <id>` | Delete a provider profile and its OS vault credential |
367
+ | `/provider use <id>` | Activate a provider profile |
368
+ | `/provider test [id]` | Test provider connection and model availability |
369
+ | `/provider show [id]` | Display safe profile configuration (credentials redacted) |
280
370
  | `/status` | View active session, selected model, and project context |
281
371
  | `/plan [runId]` | Display active task plan or inspect the plan of a previous run |
282
372
  | `/replan` | Request plan adaptation or re-evaluation for current task |
@@ -287,6 +377,7 @@ Inside the active FeCode terminal session, type `/` to access built-in commands
287
377
  | `/diagnostics` | Display complete telemetry and diagnostic trace |
288
378
  | `/history` | View completed tasks and outputs in the current session |
289
379
  | `/git` | Inspect Git repository status, active branch, and modified files |
380
+ | `/mcp` | List configured MCP servers and their connection status |
290
381
  | `/checkpoints` | List available rollback checkpoints |
291
382
  | `/checkpoint` | Create a new manual workspace checkpoint |
292
383
  | `/recover` | Inspect or initiate rollback recovery |
@@ -0,0 +1,56 @@
1
+ // ../../node_modules/@anthropic-ai/sdk/internal/errors.mjs
2
+ function e(e) {
3
+ return typeof e == "object" && !!e && ("name" in e && e.name === "AbortError" || "message" in e && String(e.message).includes("FetchRequestCanceledException"));
4
+ }
5
+ var t = (e) => {
6
+ if (e instanceof Error) return e;
7
+ if (typeof e == "object" && e) {
8
+ try {
9
+ let t = Object.prototype.toString.call(e);
10
+ if (t === "[object Error]" || t === "[object DOMException]") {
11
+ let t = Error(e.message, e.cause ? { cause: e.cause } : {});
12
+ return e.stack && (t.stack = e.stack), e.cause && !t.cause && (t.cause = e.cause), e.name && (t.name = e.name), t;
13
+ }
14
+ } catch {}
15
+ try {
16
+ return Error(JSON.stringify(e));
17
+ } catch {}
18
+ }
19
+ return Error(e);
20
+ }, n = /* @__PURE__ */ (() => {
21
+ class e extends Error {}
22
+ return e;
23
+ })(), r = class e extends n {
24
+ constructor(t, n, r, i, a) {
25
+ super(`${e.makeMessage(t, n, r)}`), this.status = t, this.headers = i, this.requestID = i?.get("request-id"), this.workspaceID = i?.get("anthropic-workspace-id"), this.error = n, this.type = a ?? null;
26
+ }
27
+ static makeMessage(e, t, n) {
28
+ let r = t?.message ? typeof t.message == "string" ? t.message : JSON.stringify(t.message) : t ? JSON.stringify(t) : n;
29
+ return e && r ? `${e} ${r}` : e ? `${e} status code (no body)` : r || "(no status code or body)";
30
+ }
31
+ static generate(n, r, i, o) {
32
+ if (!n || !o) return new a({
33
+ message: i,
34
+ cause: t(r)
35
+ });
36
+ let s = r, g = s?.error?.type;
37
+ return n === 400 ? new c(n, s, i, o, g) : n === 401 ? new l(n, s, i, o, g) : n === 403 ? new u(n, s, i, o, g) : n === 404 ? new d(n, s, i, o, g) : n === 409 ? new f(n, s, i, o, g) : n === 422 ? new p(n, s, i, o, g) : n === 429 ? new m(n, s, i, o, g) : n >= 500 ? new h(n, s, i, o, g) : new e(n, s, i, o, g);
38
+ }
39
+ }, i = class extends r {
40
+ constructor({ message: e } = {}) {
41
+ super(void 0, void 0, e || "Request was aborted.", void 0);
42
+ }
43
+ }, a = class extends r {
44
+ constructor({ message: e, cause: t }) {
45
+ super(void 0, void 0, e || "Connection error.", void 0), t && (this.cause = t);
46
+ }
47
+ }, o = class extends a {
48
+ constructor({ message: e } = {}) {
49
+ super({ message: e ?? "Request timed out." });
50
+ }
51
+ }, s = class extends n {
52
+ constructor(e, { cause: t } = {}) {
53
+ super(e ?? "Retryable error."), t !== void 0 && (this.cause = t);
54
+ }
55
+ }, c = class extends r {}, l = class extends r {}, u = class extends r {}, d = class extends r {}, f = class extends r {}, p = class extends r {}, m = class extends r {}, h = class extends r {};
56
+ export { n as a, f as c, u as d, m as f, e as g, t as h, i, h as l, p as m, o as n, l as o, s as p, r, c as s, a as t, d as u };