codelantern-agent-cli 1.0.0 → 1.0.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.
- package/README.md +167 -216
- package/dist/{chunk-Y3PEOLTZ.js → chunk-PELESOCI.js} +2365 -571
- package/dist/chunk-PELESOCI.js.map +1 -0
- package/dist/cli.js +678 -82
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +285 -23
- package/dist/index.js +46 -7
- package/package.json +2 -2
- package/dist/chunk-Y3PEOLTZ.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
# 🏮 Code Lantern CLI (`codelantern-agent-cli`)
|
|
2
2
|
|
|
3
|
-
> **Personal AI coding assistant for the terminal
|
|
4
|
-
>
|
|
5
|
-
>
|
|
3
|
+
> **Personal AI coding assistant for the terminal with multi-provider intelligence, portable skills, and ironclad safety.**
|
|
4
|
+
> Terminal command: **`lantern`**
|
|
5
|
+
> Published version: **`1.0.1`**
|
|
6
|
+
> Default model: **`gemini-3.8-flash`** (Google Gemini)
|
|
6
7
|
|
|
7
|
-
Code Lantern CLI is
|
|
8
|
+
Code Lantern CLI is a resilient, autonomous terminal coding assistant designed to help you inspect, build, edit, and troubleshoot codebases directly from your shell. It connects directly to your chosen AI providers—Google Gemini, OpenAI, Anthropic Claude, OpenRouter, or custom OpenAI-compatible endpoints—with zero third-party agent dependencies.
|
|
8
9
|
|
|
9
10
|
---
|
|
10
11
|
|
|
11
|
-
## ⚡
|
|
12
|
-
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
- **
|
|
18
|
-
- **
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
23
|
-
- **
|
|
24
|
-
- **
|
|
12
|
+
## ⚡ What's New in v1.0.1
|
|
13
|
+
|
|
14
|
+
- 🚀 **Fix "Step 1: thinking" Hang & Slowness**:
|
|
15
|
+
- **Bounded Request & First-Token Timeouts (`TTFT`)**: Strict timeouts prevent indefinite network hangs with configurable `--timeout` (default: 60s) and `--first-token-timeout` (default: 30s).
|
|
16
|
+
- **Immediate Unbuffered Streaming**: Response tokens stream directly to stdout as they arrive.
|
|
17
|
+
- **Real-Time Spinner Stages**: Spinner transitions transparently across `Connecting...`, `Waiting for first token...`, `Receiving response...`, and `Executing tool [name]...`. Stale thinking states are completely eliminated.
|
|
18
|
+
- **Instant Cancellation (Ctrl+C)**: Pressing Ctrl+C aborts in-flight fetch and streaming requests instantly via linked `AbortController`, safely returning control to the prompt.
|
|
19
|
+
- **Safe Backoff Retries**: Transient HTTP failures (429/503) retry with small, capped backoff. Non-idempotent mutating tools (file edits, bash execution) are never duplicated.
|
|
20
|
+
- **Context Efficiency & Pruning**: Tool outputs exceeding 15KB are capped in session context, preventing memory bloat and preserving fast response times.
|
|
21
|
+
- **Timing Diagnostics**: Pass `--timing` or use `/timing` to display live latency benchmarks for connection, first-token arrival, tool steps, and total turn duration.
|
|
22
|
+
- 🌐 **Multi-Provider & Dynamic Model Architecture**:
|
|
23
|
+
- **Google Gemini**: Native official `@google/genai` SDK with `gemini-3.8-flash` as default.
|
|
24
|
+
- **OpenAI**: Native SSE streaming adapter supporting `gpt-4o`, `gpt-4o-mini`, `o1`, `o3-mini`, with function/tool calling.
|
|
25
|
+
- **Anthropic Claude**: Native SSE streaming adapter supporting `claude-3-7-sonnet`, `claude-3-5-sonnet`, and `claude-3-5-haiku`.
|
|
26
|
+
- **OpenRouter**: Access over 400 models dynamically via `https://openrouter.ai/api/v1` with dynamic catalog discovery.
|
|
27
|
+
- **Custom OpenAI-Compatible Providers**: Configure custom endpoints (Ollama, vLLM, DeepSeek, LocalAI) via base URL, API key, and model ID.
|
|
28
|
+
- **Secure AES-256-GCM Credential Vault**: Store provider API keys locally encrypted in `~/.codelantern/credentials.json` with machine-derived keys, or supply via standard environment variables (`GEMINI_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `OPENROUTER_API_KEY`).
|
|
29
|
+
- **Management Commands**: `lantern providers`, `lantern models`, `lantern keys`, and `/provider`, `/model` slash commands.
|
|
30
|
+
- 🧩 **Portable Skills System (`SKILL.md`)**:
|
|
31
|
+
- Import, enable, and use skills defined in portable `SKILL.md` format (YAML frontmatter + markdown instructions + references).
|
|
32
|
+
- Discovered automatically from user directory (`~/.codelantern/skills/`) and project workspaces (`.codelantern/skills/`).
|
|
33
|
+
- Install skills easily via local path or Git: `lantern skills add <path-or-git-url>`.
|
|
34
|
+
- Transparent, non-intrusive keyword/intent matching automatically injects relevant domain instructions into system prompts without arbitrary script execution.
|
|
25
35
|
|
|
26
36
|
---
|
|
27
37
|
|
|
@@ -32,7 +42,7 @@ Code Lantern CLI is an autonomous terminal coding assistant designed to help you
|
|
|
32
42
|
| **Node.js** | `>= 18.0.0` (Node 20 or Node 22 LTS recommended) |
|
|
33
43
|
| **npm** | `>= 9.0.0` |
|
|
34
44
|
| **Operating Systems** | macOS 12+ (Apple Silicon `arm64` & Intel `x64`), Windows 10/11 (PowerShell & CMD), Linux |
|
|
35
|
-
| **API
|
|
45
|
+
| **API Keys** | Any of: `GEMINI_API_KEY`, `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `OPENROUTER_API_KEY`, or custom endpoint |
|
|
36
46
|
|
|
37
47
|
---
|
|
38
48
|
|
|
@@ -40,93 +50,144 @@ Code Lantern CLI is an autonomous terminal coding assistant designed to help you
|
|
|
40
50
|
|
|
41
51
|
### Option A: Local Development Installation
|
|
42
52
|
|
|
43
|
-
Clone or open the project folder in your terminal:
|
|
44
|
-
|
|
45
53
|
```bash
|
|
46
54
|
cd "my own cli"
|
|
47
55
|
|
|
48
56
|
# 1. Install dependencies
|
|
49
57
|
npm install
|
|
50
58
|
|
|
51
|
-
# 2. Build the
|
|
59
|
+
# 2. Build the distribution bundle
|
|
52
60
|
npm run build
|
|
53
61
|
|
|
54
|
-
# 3. Link
|
|
62
|
+
# 3. Link globally for immediate use
|
|
55
63
|
npm link
|
|
56
64
|
```
|
|
57
65
|
|
|
58
66
|
Verify your installation:
|
|
59
|
-
|
|
60
67
|
```bash
|
|
61
68
|
lantern --version
|
|
62
|
-
# Output: 1.0.
|
|
69
|
+
# Output: 1.0.1
|
|
63
70
|
```
|
|
64
71
|
|
|
65
|
-
### Option B: Global Installation
|
|
72
|
+
### Option B: Global Installation from npm
|
|
66
73
|
|
|
67
|
-
Once published
|
|
74
|
+
Once published under `codelantern-agent-cli`:
|
|
68
75
|
|
|
69
|
-
####
|
|
76
|
+
#### macOS & Linux:
|
|
70
77
|
```bash
|
|
71
78
|
npm install -g codelantern-agent-cli
|
|
72
79
|
lantern --version
|
|
73
80
|
```
|
|
74
81
|
|
|
75
|
-
####
|
|
82
|
+
#### Windows (PowerShell or Command Prompt):
|
|
76
83
|
```powershell
|
|
77
84
|
npm install -g codelantern-agent-cli
|
|
78
85
|
lantern --version
|
|
79
86
|
```
|
|
80
|
-
*npm automatically generates `lantern.cmd` and `lantern.ps1`
|
|
87
|
+
*npm automatically generates `lantern.cmd` and `lantern.ps1` executables on Windows.*
|
|
81
88
|
|
|
82
89
|
---
|
|
83
90
|
|
|
84
|
-
## 🔑
|
|
91
|
+
## 🔑 Credential & Key Management
|
|
85
92
|
|
|
86
|
-
Code Lantern
|
|
93
|
+
Code Lantern supports two secure methods for supplying API keys:
|
|
87
94
|
|
|
88
|
-
###
|
|
95
|
+
### 1. Secure Local Vault (AES-256-GCM)
|
|
96
|
+
Store encrypted keys on your local machine using `lantern keys set`:
|
|
97
|
+
```bash
|
|
98
|
+
lantern keys set gemini
|
|
99
|
+
lantern keys set openai
|
|
100
|
+
lantern keys set anthropic
|
|
101
|
+
lantern keys set openrouter
|
|
102
|
+
```
|
|
103
|
+
Keys are encrypted using AES-256-GCM with a machine-unique key derived from your host identity. Keys are never logged, committed, or transmitted except directly to the provider endpoint.
|
|
89
104
|
|
|
90
|
-
|
|
105
|
+
### 2. Environment Variables
|
|
106
|
+
Standard environment variables take precedence when present:
|
|
91
107
|
```bash
|
|
92
|
-
export GEMINI_API_KEY="
|
|
108
|
+
export GEMINI_API_KEY="AIzaSy..."
|
|
109
|
+
export OPENAI_API_KEY="sk-proj-..."
|
|
110
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
111
|
+
export OPENROUTER_API_KEY="sk-or-v1-..."
|
|
93
112
|
```
|
|
94
|
-
|
|
113
|
+
|
|
114
|
+
Inspect configured keys safely (masked):
|
|
95
115
|
```bash
|
|
96
|
-
|
|
116
|
+
lantern keys list
|
|
97
117
|
```
|
|
98
118
|
|
|
99
|
-
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 🌐 Multi-Provider Management
|
|
100
122
|
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
|
|
123
|
+
### Switch Active Provider and Models
|
|
124
|
+
```bash
|
|
125
|
+
# List all configured providers
|
|
126
|
+
lantern providers list
|
|
105
127
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
[System.Environment]::SetEnvironmentVariable('GEMINI_API_KEY', 'AIzaSyYourActualGeminiApiKeyHere', 'User')
|
|
109
|
-
```
|
|
128
|
+
# Set default provider
|
|
129
|
+
lantern providers set-default openrouter
|
|
110
130
|
|
|
111
|
-
|
|
131
|
+
# Test provider connectivity and latency
|
|
132
|
+
lantern providers test openrouter
|
|
133
|
+
lantern providers test gemini
|
|
112
134
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
135
|
+
# Add a custom local Ollama or vLLM provider
|
|
136
|
+
lantern providers add ollama --base-url http://localhost:11434/v1 --model llama3.2:latest
|
|
137
|
+
|
|
138
|
+
# List available models for active provider
|
|
139
|
+
lantern models list
|
|
140
|
+
|
|
141
|
+
# Query models for a specific provider
|
|
142
|
+
lantern models list -p anthropic
|
|
143
|
+
lantern models list -p openrouter
|
|
144
|
+
|
|
145
|
+
# Set active default model
|
|
146
|
+
lantern models set gemini-3.8-flash
|
|
116
147
|
```
|
|
117
148
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## 🧩 Portable Skills System (`SKILL.md`)
|
|
152
|
+
|
|
153
|
+
Code Lantern supports domain-specific skills using the standard `SKILL.md` format:
|
|
154
|
+
|
|
155
|
+
```markdown
|
|
156
|
+
---
|
|
157
|
+
name: build-your-own-x
|
|
158
|
+
description: Step-by-step architectural patterns for recreating technologies from scratch
|
|
159
|
+
---
|
|
160
|
+
# Build Your Own X Instructions
|
|
161
|
+
When designing and implementing systems from scratch, follow these patterns...
|
|
121
162
|
```
|
|
122
163
|
|
|
123
|
-
|
|
164
|
+
### Managing Skills
|
|
165
|
+
```bash
|
|
166
|
+
# List installed skills
|
|
167
|
+
lantern skills list
|
|
168
|
+
|
|
169
|
+
# Add a skill from a local folder or markdown file
|
|
170
|
+
lantern skills add ./my-skill
|
|
171
|
+
|
|
172
|
+
# Add a skill directly from a Git repository
|
|
173
|
+
lantern skills add https://github.com/example/coding-skills.git
|
|
174
|
+
|
|
175
|
+
# Inspect skill instructions and reference documents
|
|
176
|
+
lantern skills show build-your-own-x
|
|
177
|
+
|
|
178
|
+
# Enable or disable skills
|
|
179
|
+
lantern skills enable build-your-own-x
|
|
180
|
+
lantern skills disable build-your-own-x
|
|
181
|
+
|
|
182
|
+
# Remove a skill
|
|
183
|
+
lantern skills remove build-your-own-x
|
|
184
|
+
```
|
|
124
185
|
|
|
125
186
|
---
|
|
126
187
|
|
|
127
188
|
## 🩺 Diagnostics (`lantern doctor`)
|
|
128
189
|
|
|
129
|
-
Run `lantern doctor` at any time to verify
|
|
190
|
+
Run `lantern doctor` at any time to verify system health, network connectivity, latency, and keys:
|
|
130
191
|
|
|
131
192
|
```bash
|
|
132
193
|
lantern doctor
|
|
@@ -138,12 +199,16 @@ Example output:
|
|
|
138
199
|
──────────────────────────────────────────────────────────────────────────────
|
|
139
200
|
✓ Platform / OS: macOS (Apple Silicon)
|
|
140
201
|
✓ Node.js Runtime: v26.12.1 (compatible)
|
|
141
|
-
✓
|
|
142
|
-
✓
|
|
202
|
+
✓ Active Provider: Google Gemini (gemini)
|
|
203
|
+
✓ Active Model: gemini-3.8-flash
|
|
204
|
+
✓ API Key (gemini): Configured [env] (AIza...W9q0)
|
|
205
|
+
✓ Gemini API Auth: Verified (latency: 340ms)
|
|
206
|
+
✓ Additional Providers: Configured (openrouter, openai)
|
|
143
207
|
✓ Git CLI: Available (git version 2.54.0)
|
|
144
|
-
✓ Config File: ~/.codelantern/config.json (
|
|
145
|
-
✓ Session Storage: ~/.codelantern/sessions (
|
|
146
|
-
|
|
208
|
+
✓ Config File: ~/.codelantern/config.json (Timeout: 60000ms, TTFT: 30000ms)
|
|
209
|
+
✓ Session Storage: ~/.codelantern/sessions (1 stored session(s))
|
|
210
|
+
✓ Skills: 1 installed (build-your-own-x)
|
|
211
|
+
ℹ MCP Servers: No external MCP servers configured (optional)
|
|
147
212
|
✓ Project Instructions: Found (LANTERN.md) in /workspace
|
|
148
213
|
──────────────────────────────────────────────────────────────────────────────
|
|
149
214
|
✨ All systems healthy! Code Lantern CLI is ready to assist.
|
|
@@ -156,206 +221,92 @@ Example output:
|
|
|
156
221
|
| Command | Action |
|
|
157
222
|
| :--- | :--- |
|
|
158
223
|
| **`lantern`** | Launch the interactive conversational REPL |
|
|
159
|
-
| **`lantern ask "<question>"`** | One-shot prompt execution with streaming
|
|
160
|
-
| **`lantern plan "<task>"`** | Read-only inspection
|
|
224
|
+
| **`lantern ask "<question>"`** | One-shot prompt execution with streaming response |
|
|
225
|
+
| **`lantern plan "<task>"`** | Read-only inspection and implementation plan |
|
|
161
226
|
| **`lantern resume [sessionId]`** | Resume the most recent or specified session |
|
|
162
|
-
| **`lantern sessions`** | List saved local sessions |
|
|
163
|
-
| **`lantern
|
|
164
|
-
| **`lantern
|
|
165
|
-
| **`lantern
|
|
166
|
-
| **`lantern
|
|
167
|
-
| **`lantern
|
|
168
|
-
| **`lantern
|
|
227
|
+
| **`lantern sessions`** | List saved local sessions (`--export <id>`, `--delete <id>`) |
|
|
228
|
+
| **`lantern providers`** | Manage AI providers (`list`, `set-default`, `test`, `add`, `remove`) |
|
|
229
|
+
| **`lantern models`** | List and select models (`list`, `set`, `-p <provider>`, `-r`, `--json`) |
|
|
230
|
+
| **`lantern keys`** | Manage encrypted API keys (`list`, `set`, `remove`) |
|
|
231
|
+
| **`lantern skills`** | Manage portable skills (`list`, `show`, `add`, `enable`, `disable`, `remove`) |
|
|
232
|
+
| **`lantern config`** | View or update configuration (`list`, `get`, `set`) |
|
|
233
|
+
| **`lantern doctor`** | Diagnose environment, credentials, latency, and MCP health |
|
|
234
|
+
| **`lantern mcp`** | Manage MCP servers (`list`, `add`, `remove`, `test`, `enable`, `disable`) |
|
|
169
235
|
| **`lantern --help`** | View all CLI flags and options |
|
|
170
|
-
| **`lantern --version`** | Output version string |
|
|
236
|
+
| **`lantern --version`** | Output version string (`1.0.1`) |
|
|
171
237
|
|
|
172
|
-
### Global
|
|
238
|
+
### Global Flags
|
|
173
239
|
|
|
240
|
+
- **`-p, --provider <provider>`**: Select provider (`gemini`, `openai`, `anthropic`, `openrouter`, or custom).
|
|
174
241
|
- **`-m, --model <id>`**: Override model ID (default: `gemini-3.8-flash`).
|
|
175
242
|
- **`-C, --cwd <path>`**: Set workspace directory for agent operations.
|
|
176
243
|
- **`-s, --session <id>`**: Use or resume a specific session ID.
|
|
177
244
|
- **`-a, --attach <files...>`**: Attach text files, images (`.png`, `.jpg`, `.webp`), or PDFs.
|
|
178
245
|
- **`--yolo`**: Skip interactive confirmation prompts for file edits and shell commands.
|
|
179
246
|
- **`--json`**: Output results formatted as JSON.
|
|
247
|
+
- **`--timeout <ms>`**: Maximum total request duration (default: `60000`).
|
|
248
|
+
- **`--first-token-timeout <ms>`**: Maximum wait time for initial response token (default: `30000`).
|
|
249
|
+
- **`--timing`**: Display detailed execution and latency timing diagnostics.
|
|
250
|
+
- **`--fast`**: Enable low-latency mode where supported.
|
|
251
|
+
- **`--skill <skills...>`**: Explicitly activate one or more skills for the run.
|
|
180
252
|
|
|
181
253
|
---
|
|
182
254
|
|
|
183
|
-
##
|
|
255
|
+
## 🛡️ Safe Mode & Invariants
|
|
184
256
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
Inside the interactive REPL:
|
|
192
|
-
- Type your question or task naturally.
|
|
193
|
-
- Use `\` at the end of a line for multiline continuation.
|
|
194
|
-
- Enclose multiline code blocks inside `""" ... """`.
|
|
195
|
-
- Press `Up`/`Down` arrows to navigate previous prompt history.
|
|
196
|
-
- Available slash commands:
|
|
197
|
-
- `/help` — List available commands and tools.
|
|
198
|
-
- `/clear` — Clear terminal screen.
|
|
199
|
-
- `/status` — View workspace, model, token count, and active session ID.
|
|
200
|
-
- `/model [id]` — Switch model on the fly (e.g. `/model gemini-3.8-flash`).
|
|
201
|
-
- `/plan [on|off]` — Toggle read-only plan mode.
|
|
202
|
-
- `/yolo [on|off]` — Toggle YOLO mode for the session.
|
|
203
|
-
- `/sessions` — List saved sessions.
|
|
204
|
-
- `/history` — Print recent conversation turns.
|
|
205
|
-
- `/export [md|json]` — Export current session transcript.
|
|
206
|
-
- `/exit` or `/quit` — Save session and exit.
|
|
207
|
-
|
|
208
|
-
### 2. One-Shot Question with File Attachment
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
lantern ask "Refactor this component to use React hooks" --attach src/components/UserProfile.tsx
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
### 3. Read-Only Planning Mode
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
lantern plan "Design an authentication system using JWT tokens with refresh cookies"
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### 4. Piped Standard Input
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
# macOS / Linux
|
|
224
|
-
cat build.log | lantern "Summarize the root cause of these compiler errors"
|
|
225
|
-
|
|
226
|
-
# Windows PowerShell
|
|
227
|
-
Get-Content build.log | lantern "Summarize the root cause of these compiler errors"
|
|
228
|
-
```
|
|
257
|
+
Code Lantern runs in **Safe Mode** by default:
|
|
258
|
+
1. **Interactive Unified Diffs**: Displays colored unified diffs showing exact deletions in red and additions in green before touching any file.
|
|
259
|
+
2. **Command Approvals**: Shows command line and working directory before running shell commands.
|
|
260
|
+
3. **Workspace Boundary**: Strict containment prevents path traversal (`../../`) or symlink escapes outside the workspace.
|
|
261
|
+
4. **Secret Firewall**: Blocks reading `.env`, `.env.*`, `*.pem`, `*.key`, `id_rsa`, or credential stores.
|
|
262
|
+
5. **Destructive Command Guard**: Rejects destructive system commands (e.g., `rm -rf /`, Windows `format c:`, `del /s /q c:\*`).
|
|
229
263
|
|
|
230
264
|
---
|
|
231
265
|
|
|
232
|
-
##
|
|
233
|
-
|
|
234
|
-
Code Lantern defaults to **Safe Mode**.
|
|
266
|
+
## 🧪 Automated Testing
|
|
235
267
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
1. **Before Editing Files**: Displays an ANSI color-coded patch diff showing exact removals in red and additions in green:
|
|
239
|
-
```text
|
|
240
|
-
Approve this action? [y/N / (a)ll-yolo]:
|
|
241
|
-
```
|
|
242
|
-
2. **Before Creating Files**: Displays a line-numbered preview of the file.
|
|
243
|
-
3. **Before Executing Shell Commands**: Displays the exact command and working directory.
|
|
244
|
-
|
|
245
|
-
### YOLO Mode (`--yolo`)
|
|
246
|
-
|
|
247
|
-
Run Lantern with `--yolo` or enter `yolo` / `a` at an approval prompt to auto-approve safe modifications for that execution:
|
|
248
|
-
```bash
|
|
249
|
-
lantern --yolo ask "Run npm test and fix failing assertions"
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
### Unconditional Safety Invariants
|
|
253
|
-
|
|
254
|
-
- **Strict Workspace Containment**: Lantern cannot read, edit, or execute outside your workspace directory. Path traversal attempts (`../../`) and symlink escapes are rejected.
|
|
255
|
-
- **Secret Shielding**: `.env`, `.env.*`, `*.pem`, `*.key`, `id_rsa`, and credential JSON files are blocked from reading or being sent to Gemini.
|
|
256
|
-
- **Destructive Command Firewall**: Destructive system commands (e.g. `rm -rf /`, `mkfs`, Windows `format c:`, `del /s /q c:\*`) are strictly blocked across all platforms.
|
|
257
|
-
- **Token Redaction**: Any API keys detected in text are automatically masked before saving or displaying.
|
|
258
|
-
|
|
259
|
-
---
|
|
260
|
-
|
|
261
|
-
## 🔌 Model Context Protocol (MCP)
|
|
262
|
-
|
|
263
|
-
Connect external tool servers using the official Model Context Protocol stdio transport:
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
# Add SQLite database MCP server
|
|
267
|
-
lantern mcp add sqlite npx -y @modelcontextprotocol/server-sqlite ./data.db
|
|
268
|
-
|
|
269
|
-
# Test server connection and inspect exposed tools
|
|
270
|
-
lantern mcp test sqlite
|
|
271
|
-
|
|
272
|
-
# List configured MCP servers
|
|
273
|
-
lantern mcp list
|
|
274
|
-
|
|
275
|
-
# Disable or enable a server
|
|
276
|
-
lantern mcp disable sqlite
|
|
277
|
-
lantern mcp enable sqlite
|
|
278
|
-
|
|
279
|
-
# Remove a server
|
|
280
|
-
lantern mcp remove sqlite
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
## ⚙️ Configuration & Project Instructions
|
|
286
|
-
|
|
287
|
-
Configurations are persisted in `~/.codelantern/config.json` (or `%USERPROFILE%\.codelantern\config.json` on Windows):
|
|
268
|
+
Code Lantern includes a comprehensive test suite covering security sandboxing, CRLF line endings, tool execution, session persistence, timeout handling, first-token limits, cancellation, AES-256 encryption, skills parsing, and provider registries:
|
|
288
269
|
|
|
289
270
|
```bash
|
|
290
|
-
#
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
# Update settings
|
|
294
|
-
lantern config set defaultModel gemini-3.8-flash
|
|
295
|
-
lantern config set maxSteps 30
|
|
296
|
-
lantern config set temperature 0.2
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
### Project Instructions (`LANTERN.md`)
|
|
271
|
+
# Run test suite (32 automated checks)
|
|
272
|
+
npm test
|
|
300
273
|
|
|
301
|
-
|
|
274
|
+
# Run TypeScript typecheck
|
|
275
|
+
npm run lint
|
|
302
276
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
- Codebase language: TypeScript (NodeNext modules)
|
|
306
|
-
- Run `npm test` before concluding file edits
|
|
307
|
-
- Keep imports organized alphabetically
|
|
277
|
+
# Build production bundle
|
|
278
|
+
npm run build
|
|
308
279
|
```
|
|
309
280
|
|
|
310
281
|
---
|
|
311
282
|
|
|
312
|
-
## 🚀 npm
|
|
283
|
+
## 🚀 npm Publishing Guide (v1.0.1)
|
|
313
284
|
|
|
314
|
-
To publish `codelantern-agent-cli` to npm:
|
|
285
|
+
To publish `codelantern-agent-cli@1.0.1` to npm:
|
|
315
286
|
|
|
316
|
-
1. **
|
|
287
|
+
1. **Verify All Checks Pass**:
|
|
317
288
|
```bash
|
|
318
289
|
npm test
|
|
319
290
|
npm run lint
|
|
320
291
|
npm run build
|
|
321
292
|
```
|
|
322
|
-
2. **
|
|
293
|
+
2. **Inspect Tarball Contents**:
|
|
323
294
|
```bash
|
|
324
295
|
npm pack --dry-run
|
|
325
296
|
```
|
|
326
|
-
*Verify that only `dist/`, `README.md`, and `LICENSE` are included
|
|
327
|
-
3. **
|
|
297
|
+
*Verify that only `dist/`, `README.md`, and `LICENSE` are included.*
|
|
298
|
+
3. **Authenticate & Publish**:
|
|
328
299
|
```bash
|
|
329
300
|
npm login
|
|
330
|
-
```
|
|
331
|
-
4. **Publish**:
|
|
332
|
-
```bash
|
|
333
301
|
npm publish --access public
|
|
334
302
|
```
|
|
335
303
|
|
|
336
304
|
---
|
|
337
305
|
|
|
338
|
-
##
|
|
339
|
-
|
|
340
|
-
Run the automated cross-platform test suite:
|
|
341
|
-
|
|
342
|
-
```bash
|
|
343
|
-
npm test
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
Run TypeScript compilation check:
|
|
347
|
-
|
|
348
|
-
```bash
|
|
349
|
-
npm run lint
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
---
|
|
353
|
-
|
|
354
|
-
## ⚠️ Known Limitations & Platform Notes
|
|
306
|
+
## ⚠️ Platform Verification Notes
|
|
355
307
|
|
|
356
|
-
- **Directly
|
|
357
|
-
- **Windows
|
|
358
|
-
- **Terminal Colors**: A modern terminal emulator with ANSI color support (macOS Terminal, iTerm2, Windows Terminal, VS Code Integrated Terminal) is recommended.
|
|
308
|
+
- **macOS (Directly Verified)**: Developed, built, and verified on macOS (Apple Silicon arm64, Node v26) with all 32 automated tests passing and live provider connectivity verified.
|
|
309
|
+
- **Windows (Architecturally Supported)**: Built with portable Node.js APIs (`path.normalize`, `path.sep`, `windowsHide: true`, CRLF handling, and Windows command guards). Direct testing on native Windows hardware or Windows CI is recommended upon deployment.
|
|
359
310
|
|
|
360
311
|
---
|
|
361
312
|
|