coder-agent 2.0.0 → 2.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 +7 -7
- package/dist/agent.js +2 -2
- package/dist/index.js +14 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ A powerful, zero-dependency, cross-platform CLI coding agent powered by **Google
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **Apple-Inspired Design**: A clean, high-contrast, minimalist terminal UI styled in elegant monochrome greys and whites.
|
|
8
|
-
- **Global CLI Execution**: Install once and run anywhere via `coder` (or the `gemini-agent` / `groq-agent` compatibility aliases).
|
|
8
|
+
- **Global CLI Execution**: Install once and run anywhere via `coder-agent` (or the `coder` / `gemini-agent` / `groq-agent` compatibility aliases).
|
|
9
9
|
- **System Automation Tools**:
|
|
10
10
|
- `read_file` / `write_file` / `patch_file` — Segmented reading and patch-based editing.
|
|
11
11
|
- `list_directory` / `find_files` — Recursive structure traversal.
|
|
@@ -13,8 +13,8 @@ A powerful, zero-dependency, cross-platform CLI coding agent powered by **Google
|
|
|
13
13
|
- `web_search` — DuckDuckGo instant answers for documentation retrieval.
|
|
14
14
|
- **Context Persistence**: Local JSON-based persistent configuration stored in `~/.coder-config.json` for key management and default model settings.
|
|
15
15
|
- **Interactive REPL & Single-Shot Modes**:
|
|
16
|
-
- Start the interactive shell with `coder`.
|
|
17
|
-
- Execute a direct command: `coder "build a quicksort function in python"` (exits upon completion).
|
|
16
|
+
- Start the interactive shell with `coder-agent`.
|
|
17
|
+
- Execute a direct command: `coder-agent "build a quicksort function in python"` (exits upon completion).
|
|
18
18
|
|
|
19
19
|
---
|
|
20
20
|
|
|
@@ -39,13 +39,13 @@ npx coder-agent
|
|
|
39
39
|
The agent requires a **Gemini API Key**.
|
|
40
40
|
|
|
41
41
|
### 1. Interactive Bootstrapping
|
|
42
|
-
Simply run `coder`. If no key is configured, the CLI will interactively prompt you for the key and offer to save it globally.
|
|
42
|
+
Simply run `coder-agent`. If no key is configured, the CLI will interactively prompt you for the key and offer to save it globally.
|
|
43
43
|
|
|
44
44
|
### 2. Command Line Flags
|
|
45
45
|
You can save your key globally at any time using flags:
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
coder --set-key YOUR_GEMINI_API_KEY
|
|
48
|
+
coder-agent --set-key YOUR_GEMINI_API_KEY
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
### 3. Environment Variables
|
|
@@ -62,13 +62,13 @@ export GEMINI_API_KEY=AIzaSy...
|
|
|
62
62
|
### REPL Mode
|
|
63
63
|
Start an interactive pair programming session:
|
|
64
64
|
```bash
|
|
65
|
-
coder
|
|
65
|
+
coder-agent
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
### Single-Shot Prompt Mode
|
|
69
69
|
Run a prompt directly from the shell:
|
|
70
70
|
```bash
|
|
71
|
-
coder "write a binary search script in Python"
|
|
71
|
+
coder-agent "write a binary search script in Python"
|
|
72
72
|
```
|
|
73
73
|
|
|
74
74
|
### CLI Command Options
|
package/dist/agent.js
CHANGED
|
@@ -163,13 +163,13 @@ export class Agent {
|
|
|
163
163
|
// ── No tool calls → final answer ─────────────────────────────────────
|
|
164
164
|
if (toolCalls.length === 0) {
|
|
165
165
|
if (cleanContent) {
|
|
166
|
-
console.log("\n" + chalk.bold.white("coder ❯ ") + cleanContent);
|
|
166
|
+
console.log("\n" + chalk.bold.white("coder-agent ❯ ") + cleanContent);
|
|
167
167
|
}
|
|
168
168
|
break;
|
|
169
169
|
}
|
|
170
170
|
// If the model returned conversational text along with tool calls, print it cleanly
|
|
171
171
|
if (cleanContent) {
|
|
172
|
-
console.log("\n" + chalk.bold.white("coder ❯ ") + cleanContent);
|
|
172
|
+
console.log("\n" + chalk.bold.white("coder-agent ❯ ") + cleanContent);
|
|
173
173
|
}
|
|
174
174
|
// ── Execute tool calls ────────────────────────────────────────────────
|
|
175
175
|
for (const toolCall of toolCalls) {
|
package/dist/index.js
CHANGED
|
@@ -24,9 +24,9 @@ function printBanner(modelName) {
|
|
|
24
24
|
function printHelp() {
|
|
25
25
|
console.log(chalk.bold.white("\n Coder CLI v1.1\n"));
|
|
26
26
|
console.log(chalk.gray(" Usage:"));
|
|
27
|
-
console.log(chalk.white(" coder — Start the interactive REPL"));
|
|
28
|
-
console.log(chalk.white(" coder [options] — Run with config options"));
|
|
29
|
-
console.log(chalk.white(" coder \"your query here\" — Run in single-shot mode (exits after completion)"));
|
|
27
|
+
console.log(chalk.white(" coder-agent — Start the interactive REPL"));
|
|
28
|
+
console.log(chalk.white(" coder-agent [options] — Run with config options"));
|
|
29
|
+
console.log(chalk.white(" coder-agent \"your query here\" — Run in single-shot mode (exits after completion)"));
|
|
30
30
|
console.log("");
|
|
31
31
|
console.log(chalk.gray(" Options:"));
|
|
32
32
|
console.log(chalk.white(" -h, --help — Show this help screen"));
|
|
@@ -110,7 +110,7 @@ async function main() {
|
|
|
110
110
|
process.exit(0);
|
|
111
111
|
}
|
|
112
112
|
else if (args[i] === "-v" || args[i] === "--version") {
|
|
113
|
-
console.log("coder v1.1.0");
|
|
113
|
+
console.log("coder-agent v1.1.0");
|
|
114
114
|
process.exit(0);
|
|
115
115
|
}
|
|
116
116
|
else {
|
|
@@ -122,7 +122,14 @@ async function main() {
|
|
|
122
122
|
const envKey = process.env.GEMINI_API_KEY || process.env.GROQ_API_KEY;
|
|
123
123
|
let apiKey = envKey || storedKey;
|
|
124
124
|
const storedModel = await getStoredModel();
|
|
125
|
-
|
|
125
|
+
let defaultModel = "gemini-2.5-flash";
|
|
126
|
+
if (storedModel && VALID_MODELS.includes(storedModel)) {
|
|
127
|
+
defaultModel = storedModel;
|
|
128
|
+
}
|
|
129
|
+
if (tempModel && !VALID_MODELS.includes(tempModel)) {
|
|
130
|
+
console.log(chalk.red(`✗ Invalid model: ${tempModel}. Choose one of: ${VALID_MODELS.join(", ")}`));
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
126
133
|
const modelToUse = tempModel || defaultModel;
|
|
127
134
|
// Save model if specified without query
|
|
128
135
|
if (tempModel && queryArgs.length === 0) {
|
|
@@ -165,7 +172,7 @@ async function main() {
|
|
|
165
172
|
terminal: true,
|
|
166
173
|
});
|
|
167
174
|
const prompt = () => {
|
|
168
|
-
rl.question(chalk.gray("\ncoder ❯ "), async (input) => {
|
|
175
|
+
rl.question(chalk.gray("\ncoder-agent ❯ "), async (input) => {
|
|
169
176
|
const trimmed = input.trim();
|
|
170
177
|
if (!trimmed) {
|
|
171
178
|
prompt();
|
|
@@ -211,7 +218,7 @@ async function main() {
|
|
|
211
218
|
/exit — Exit Coder`));
|
|
212
219
|
console.log(chalk.bold.white("\n API Keys & Configuration:"));
|
|
213
220
|
console.log(chalk.gray(` • Stored at: ~/.coder-config.json
|
|
214
|
-
• To change key: Exit and run 'coder --set-key <key>'
|
|
221
|
+
• To change key: Exit and run 'coder-agent --set-key <key>'
|
|
215
222
|
• Env variable option: GEMINI_API_KEY`));
|
|
216
223
|
prompt();
|
|
217
224
|
return;
|