nemonix-cli 1.0.1 → 1.0.2
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 +32 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -6626,6 +6626,37 @@ async function installConfig() {
|
|
|
6626
6626
|
}
|
|
6627
6627
|
v2.success(import_picocolors4.default.green(`Installed ${installed} files to ${targetDir}`));
|
|
6628
6628
|
}
|
|
6629
|
+
async function installShellAliases() {
|
|
6630
|
+
const aliases = [
|
|
6631
|
+
'alias cc="claude --dangerously-skip-permissions"',
|
|
6632
|
+
'alias ccc="claude --continue --dangerously-skip-permissions"'
|
|
6633
|
+
];
|
|
6634
|
+
const marker = "# nemonix-cli aliases";
|
|
6635
|
+
const block = `${marker}
|
|
6636
|
+
${aliases.join(`
|
|
6637
|
+
`)}
|
|
6638
|
+
${marker} end`;
|
|
6639
|
+
const home = os.homedir();
|
|
6640
|
+
const shell = process.env.SHELL || "/bin/bash";
|
|
6641
|
+
const rcFile = shell.includes("zsh") ? path.join(home, ".zshrc") : path.join(home, ".bashrc");
|
|
6642
|
+
const spinner = L2();
|
|
6643
|
+
spinner.start(`Adding shell aliases to ${path.basename(rcFile)}`);
|
|
6644
|
+
let content = "";
|
|
6645
|
+
if (import_fs_extra.default.existsSync(rcFile)) {
|
|
6646
|
+
content = await import_fs_extra.default.readFile(rcFile, "utf-8");
|
|
6647
|
+
}
|
|
6648
|
+
if (content.includes(marker)) {
|
|
6649
|
+
content = content.replace(new RegExp(`${marker}\\n[\\s\\S]*?${marker} end`), block);
|
|
6650
|
+
} else {
|
|
6651
|
+
content = content.trimEnd() + `
|
|
6652
|
+
|
|
6653
|
+
` + block + `
|
|
6654
|
+
`;
|
|
6655
|
+
}
|
|
6656
|
+
await import_fs_extra.default.writeFile(rcFile, content);
|
|
6657
|
+
spinner.stop(`${import_picocolors4.default.green("✓")} Aliases added to ${path.basename(rcFile)} — ${import_picocolors4.default.dim("cc")} and ${import_picocolors4.default.dim("ccc")}`);
|
|
6658
|
+
v2.info(` Run ${import_picocolors4.default.cyan(`source ${rcFile}`)} or open a new terminal to use them.`);
|
|
6659
|
+
}
|
|
6629
6660
|
async function installDeps() {
|
|
6630
6661
|
const scriptsDir = path.join(getClaudeDir(), "scripts");
|
|
6631
6662
|
if (!import_fs_extra.default.existsSync(path.join(scriptsDir, "package.json"))) {
|
|
@@ -6820,6 +6851,7 @@ async function setup() {
|
|
|
6820
6851
|
await installConfig();
|
|
6821
6852
|
await mergeSettings();
|
|
6822
6853
|
await installDeps();
|
|
6854
|
+
await installShellAliases();
|
|
6823
6855
|
fe(import_picocolors6.default.green("Claude Code config installed! Restart Claude Code to apply changes."));
|
|
6824
6856
|
}
|
|
6825
6857
|
async function update() {
|