coder-agent 2.8.4 → 2.9.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 +32 -0
- package/dist/config.js +2 -2
- package/dist/index.js +4 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -100,5 +100,37 @@ Type these commands directly inside the interactive session:
|
|
|
100
100
|
- `gemini-2.0-flash` (Ultra-fast, lightweight)
|
|
101
101
|
- `gemini-2.0-pro-exp` (Experimental reasoning model)
|
|
102
102
|
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## macOS & Linux Troubleshooting
|
|
106
|
+
|
|
107
|
+
If you encounter permission errors on macOS or Linux (such as `EACCES: permission denied` or `zsh: permission denied`):
|
|
108
|
+
|
|
109
|
+
### 1. Run Directly using Node
|
|
110
|
+
If global linking fails or is blocked by system directory permissions, you can skip `npm link` and run the build file directly using Node.js:
|
|
111
|
+
```bash
|
|
112
|
+
npm run build
|
|
113
|
+
node dist/index.js
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 2. Fix Executable Permissions
|
|
117
|
+
If you get a "permission denied" when executing the bin file directly, ensure it has executable rights:
|
|
118
|
+
```bash
|
|
119
|
+
chmod +x dist/index.js
|
|
120
|
+
```
|
|
121
|
+
*(Note: The `npm run build` task now automatically applies the correct Unix execution permission (`755`) on macOS/Linux environments).*
|
|
122
|
+
|
|
123
|
+
### 3. Avoid npm link EACCES failures
|
|
124
|
+
If `npm link` fails because your standard global folder belongs to `root`:
|
|
125
|
+
- **Use nvm (Recommended)**: Installing Node.js via [nvm](https://github.com/nvm-sh/nvm) places Node and npm in your home directory where you have full ownership.
|
|
126
|
+
- **Adjust npm global prefix**: Change npm's default path to your home folder:
|
|
127
|
+
```bash
|
|
128
|
+
mkdir ~/.npm-global
|
|
129
|
+
npm config set prefix '~/.npm-global'
|
|
130
|
+
```
|
|
131
|
+
Then add `export PATH=~/.npm-global/bin:$PATH` to your shell profile (`~/.zshrc` or `~/.bashrc`).
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
103
135
|
## License
|
|
104
136
|
MIT
|
package/dist/config.js
CHANGED
|
@@ -59,7 +59,7 @@ export async function getStoredApiKey() {
|
|
|
59
59
|
}
|
|
60
60
|
export async function saveApiKey(apiKey) {
|
|
61
61
|
const config = await readConfig();
|
|
62
|
-
config.geminiApiKey = apiKey;
|
|
62
|
+
config.geminiApiKey = apiKey.trim();
|
|
63
63
|
await writeConfig(config);
|
|
64
64
|
}
|
|
65
65
|
export async function getStoredModel() {
|
|
@@ -77,7 +77,7 @@ export async function getStoredGeminiApiKey() {
|
|
|
77
77
|
}
|
|
78
78
|
export async function saveGeminiApiKey(geminiApiKey) {
|
|
79
79
|
const config = await readConfig();
|
|
80
|
-
config.geminiApiKey = geminiApiKey;
|
|
80
|
+
config.geminiApiKey = geminiApiKey.trim();
|
|
81
81
|
await writeConfig(config);
|
|
82
82
|
}
|
|
83
83
|
export async function getLastUsedInfo() {
|
package/dist/index.js
CHANGED
|
@@ -162,7 +162,10 @@ async function main() {
|
|
|
162
162
|
// Load stored settings
|
|
163
163
|
const storedKey = await getStoredApiKey();
|
|
164
164
|
const envKey = process.env.GEMINI_API_KEY || process.env.GROQ_API_KEY;
|
|
165
|
-
let apiKey = envKey || storedKey;
|
|
165
|
+
let apiKey = (envKey || storedKey || "").trim();
|
|
166
|
+
if ((apiKey.startsWith('"') && apiKey.endsWith('"')) || (apiKey.startsWith("'") && apiKey.endsWith("'"))) {
|
|
167
|
+
apiKey = apiKey.slice(1, -1).trim();
|
|
168
|
+
}
|
|
166
169
|
const storedModel = await getStoredModel();
|
|
167
170
|
let defaultModel = "gemini-2.5-flash";
|
|
168
171
|
if (storedModel && VALID_MODELS.includes(storedModel)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "coder-agent",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"description": "CLI coding agent powered by Google Gemini",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"scripts": {
|
|
27
27
|
"start": "tsx src/index.ts",
|
|
28
28
|
"dev": "tsx watch src/index.ts",
|
|
29
|
-
"build": "tsc && node -e \"const fs = require('fs'); const f = 'dist/index.js'; let c = fs.readFileSync(f, 'utf8'); if (!c.startsWith('#!/usr/bin/env node')) c = '#!/usr/bin/env node\\n' + c; fs.writeFileSync(f, c.replace(/\\r\\n/g, '\\n'), 'utf8')\"",
|
|
29
|
+
"build": "tsc && node -e \"const fs = require('fs'); const f = 'dist/index.js'; let c = fs.readFileSync(f, 'utf8'); if (!c.startsWith('#!/usr/bin/env node')) c = '#!/usr/bin/env node\\n' + c; fs.writeFileSync(f, c.replace(/\\r\\n/g, '\\n'), 'utf8'); if (process.platform !== 'win32') fs.chmodSync(f, '755')\"",
|
|
30
30
|
"prepublishOnly": "npm run build",
|
|
31
31
|
"start:build": "node dist/index.js"
|
|
32
32
|
},
|