claudenv 1.2.3 → 1.2.4
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/bin/cli.js +16 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -151,6 +151,22 @@ program
|
|
|
151
151
|
console.log(`\n claudenv loop v${pkgJson.version}`);
|
|
152
152
|
console.log(` Claude CLI: ${cli.version}`);
|
|
153
153
|
|
|
154
|
+
const cwd = opts.dir ? resolve(opts.dir) : process.cwd();
|
|
155
|
+
|
|
156
|
+
// --- Auto-detect project autonomy config ---
|
|
157
|
+
if (!opts.profile && !opts.trust) {
|
|
158
|
+
try {
|
|
159
|
+
const settingsPath = join(cwd, '.claude', 'settings.json');
|
|
160
|
+
const settings = JSON.parse(await readFile(settingsPath, 'utf-8'));
|
|
161
|
+
if (!settings.permissions || (!settings.permissions.allow && !settings.permissions.deny)) {
|
|
162
|
+
opts.trust = true;
|
|
163
|
+
console.log(' Auto-detected: full autonomy config (.claude/settings.json)');
|
|
164
|
+
}
|
|
165
|
+
} catch {
|
|
166
|
+
// No settings.json or invalid — proceed normally
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
154
170
|
// --- Load profile if specified ---
|
|
155
171
|
let profileDefaults = {};
|
|
156
172
|
if (opts.profile) {
|
|
@@ -165,7 +181,6 @@ program
|
|
|
165
181
|
}
|
|
166
182
|
|
|
167
183
|
// --- Config summary ---
|
|
168
|
-
const cwd = opts.dir ? resolve(opts.dir) : process.cwd();
|
|
169
184
|
const trust = opts.trust || profileDefaults.trust || false;
|
|
170
185
|
const pause = opts.pause !== undefined ? opts.pause : !trust;
|
|
171
186
|
|
package/package.json
CHANGED