@austinthesing/magic-shell 0.2.5 → 0.2.8
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/dist/cli.js +635 -37
- package/dist/index.js +17 -0
- package/dist/tui.js +635 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1898,6 +1898,7 @@ ${colors.bold}USAGE${colors.reset}
|
|
|
1898
1898
|
msh --theme <name> Set color theme
|
|
1899
1899
|
msh --repo-context Enable project context detection
|
|
1900
1900
|
msh --no-repo-context Disable project context detection
|
|
1901
|
+
msh --safety <level> Set safety level (strict, moderate, relaxed)
|
|
1901
1902
|
msh --version Show version
|
|
1902
1903
|
msh --check-update Check for updates
|
|
1903
1904
|
msh --help Show this help
|
|
@@ -2331,6 +2332,22 @@ ${colors.bold}Available Themes${colors.reset}
|
|
|
2331
2332
|
console.log(`${colors.success}\u2713 Project context disabled${colors.reset}`);
|
|
2332
2333
|
return;
|
|
2333
2334
|
}
|
|
2335
|
+
if (args[0] === "--safety" && args[1]) {
|
|
2336
|
+
const level = args[1].toLowerCase();
|
|
2337
|
+
if (level !== "strict" && level !== "moderate" && level !== "relaxed") {
|
|
2338
|
+
console.error(`${colors.error}Unknown safety level: ${level}${colors.reset}`);
|
|
2339
|
+
console.error(`Valid levels: strict, moderate, relaxed`);
|
|
2340
|
+
console.error(` strict - Confirm all potentially dangerous commands`);
|
|
2341
|
+
console.error(` moderate - Confirm high/critical severity commands (default)`);
|
|
2342
|
+
console.error(` relaxed - Only confirm critical commands`);
|
|
2343
|
+
process.exit(1);
|
|
2344
|
+
}
|
|
2345
|
+
const config = loadConfig();
|
|
2346
|
+
config.safetyLevel = level;
|
|
2347
|
+
saveConfig(config);
|
|
2348
|
+
console.log(`${colors.success}\u2713 Safety level set to ${level}${colors.reset}`);
|
|
2349
|
+
return;
|
|
2350
|
+
}
|
|
2334
2351
|
let execute = false;
|
|
2335
2352
|
let dryRun = false;
|
|
2336
2353
|
let repoContext = undefined;
|