shiva-code 0.6.2 → 0.6.3
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/index.js +512 -270
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -112,7 +112,7 @@ import {
|
|
|
112
112
|
} from "./chunk-3RG5ZIWI.js";
|
|
113
113
|
|
|
114
114
|
// src/index.ts
|
|
115
|
-
import { Command as
|
|
115
|
+
import { Command as Command39 } from "commander";
|
|
116
116
|
import * as readline from "readline";
|
|
117
117
|
|
|
118
118
|
// src/commands/auth/login.ts
|
|
@@ -571,12 +571,12 @@ async function findAvailablePort() {
|
|
|
571
571
|
throw new Error("Kein freier Port f\xFCr Callback-Server gefunden");
|
|
572
572
|
}
|
|
573
573
|
function checkPort(port) {
|
|
574
|
-
return new Promise((
|
|
574
|
+
return new Promise((resolve14) => {
|
|
575
575
|
const server = http.createServer();
|
|
576
|
-
server.once("error", () =>
|
|
576
|
+
server.once("error", () => resolve14(false));
|
|
577
577
|
server.once("listening", () => {
|
|
578
578
|
server.close();
|
|
579
|
-
|
|
579
|
+
resolve14(true);
|
|
580
580
|
});
|
|
581
581
|
server.listen(port, "127.0.0.1");
|
|
582
582
|
});
|
|
@@ -729,7 +729,7 @@ function getCallbackHtml(type2, data) {
|
|
|
729
729
|
</html>`;
|
|
730
730
|
}
|
|
731
731
|
function startCallbackServer(port) {
|
|
732
|
-
return new Promise((
|
|
732
|
+
return new Promise((resolve14, reject) => {
|
|
733
733
|
const server = http.createServer((req, res) => {
|
|
734
734
|
const url = new URL2(req.url || "/", `http://127.0.0.1:${port}`);
|
|
735
735
|
if (url.pathname === "/callback") {
|
|
@@ -755,7 +755,7 @@ function startCallbackServer(port) {
|
|
|
755
755
|
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" });
|
|
756
756
|
res.end(getCallbackHtml("success", { email }));
|
|
757
757
|
server.close();
|
|
758
|
-
|
|
758
|
+
resolve14({
|
|
759
759
|
token,
|
|
760
760
|
user: {
|
|
761
761
|
id: parseInt(userId, 10),
|
|
@@ -992,7 +992,7 @@ var logoutCommand = new Command2("logout").description("Abmelden").action(() =>
|
|
|
992
992
|
|
|
993
993
|
// src/commands/project/init.ts
|
|
994
994
|
import { Command as Command3 } from "commander";
|
|
995
|
-
import { writeFileSync, existsSync as existsSync2 } from "fs";
|
|
995
|
+
import { writeFileSync, existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
996
996
|
import { resolve as resolve2 } from "path";
|
|
997
997
|
import ora from "ora";
|
|
998
998
|
import inquirer3 from "inquirer";
|
|
@@ -1202,6 +1202,65 @@ function parseClaudeMd(content) {
|
|
|
1202
1202
|
}
|
|
1203
1203
|
return { memories };
|
|
1204
1204
|
}
|
|
1205
|
+
function hasShivaInstructions(content) {
|
|
1206
|
+
return content.includes("### SHIVA Instructions") || content.includes("## SHIVA Code");
|
|
1207
|
+
}
|
|
1208
|
+
function generateShivaSection(project) {
|
|
1209
|
+
const lines = [];
|
|
1210
|
+
lines.push("");
|
|
1211
|
+
lines.push("## SHIVA Code");
|
|
1212
|
+
lines.push("");
|
|
1213
|
+
lines.push("This project is managed by [SHIVA Code](https://shiva.li).");
|
|
1214
|
+
lines.push("");
|
|
1215
|
+
if (project) {
|
|
1216
|
+
lines.push(`- **Status**: ${project.synced ? "Synced" : "Pending"}`);
|
|
1217
|
+
if (project.last_synced_at) {
|
|
1218
|
+
lines.push(`- **Last Sync**: ${new Date(project.last_synced_at).toLocaleString()}`);
|
|
1219
|
+
}
|
|
1220
|
+
lines.push(`- **Project ID**: ${project.id}`);
|
|
1221
|
+
} else {
|
|
1222
|
+
lines.push("- **Status**: Not synced");
|
|
1223
|
+
lines.push("- **Last Sync**: Never");
|
|
1224
|
+
}
|
|
1225
|
+
lines.push("");
|
|
1226
|
+
lines.push("### SHIVA Instructions");
|
|
1227
|
+
lines.push("");
|
|
1228
|
+
lines.push("IMPORTANT: Du MUSST diese Befehle nutzen um Informationen \xFCber Sessions hinweg zu speichern!");
|
|
1229
|
+
lines.push("");
|
|
1230
|
+
lines.push("**Memory speichern** - Wenn der User dich bittet etwas zu merken oder wichtige Infos auftauchen:");
|
|
1231
|
+
lines.push("```bash");
|
|
1232
|
+
lines.push('shiva remember "Die wichtige Information die gemerkt werden soll"');
|
|
1233
|
+
lines.push("```");
|
|
1234
|
+
lines.push("");
|
|
1235
|
+
lines.push("**Memories durchsuchen** - Um gespeicherte Informationen zu finden:");
|
|
1236
|
+
lines.push("```bash");
|
|
1237
|
+
lines.push('shiva search "suchbegriff"');
|
|
1238
|
+
lines.push("```");
|
|
1239
|
+
lines.push("");
|
|
1240
|
+
lines.push("**Wann Memories speichern:**");
|
|
1241
|
+
lines.push('- User sagt "merk dir...", "speicher...", "erinner dich..."');
|
|
1242
|
+
lines.push("- Wichtige Projektentscheidungen");
|
|
1243
|
+
lines.push("- API Keys, Secrets, Konfigurationen (nutze `shiva secrets add`)");
|
|
1244
|
+
lines.push("- Wichtige Code-Patterns oder Konventionen");
|
|
1245
|
+
lines.push("- Alles was in zuk\xFCnftigen Sessions relevant sein k\xF6nnte");
|
|
1246
|
+
lines.push("");
|
|
1247
|
+
lines.push("## Memories");
|
|
1248
|
+
lines.push("");
|
|
1249
|
+
if (project?.memories && project.memories.length > 0) {
|
|
1250
|
+
lines.push("The following context is remembered across sessions:");
|
|
1251
|
+
lines.push("");
|
|
1252
|
+
for (const memory of project.memories) {
|
|
1253
|
+
lines.push(`- **${memory.key}** (${memory.category}): ${memory.value}`);
|
|
1254
|
+
}
|
|
1255
|
+
} else {
|
|
1256
|
+
lines.push("No memories stored yet. Use `shiva sync` to sync your project.");
|
|
1257
|
+
}
|
|
1258
|
+
lines.push("");
|
|
1259
|
+
lines.push("---");
|
|
1260
|
+
lines.push("");
|
|
1261
|
+
lines.push("*Generated by SHIVA Code CLI*");
|
|
1262
|
+
return lines.join("\n");
|
|
1263
|
+
}
|
|
1205
1264
|
|
|
1206
1265
|
// src/services/data/templates.ts
|
|
1207
1266
|
var templates = {
|
|
@@ -1452,7 +1511,7 @@ function getTemplateDescriptions() {
|
|
|
1452
1511
|
}
|
|
1453
1512
|
|
|
1454
1513
|
// src/commands/project/init.ts
|
|
1455
|
-
var initCommand = new Command3("init").description("Projekt f\xFCr SHIVA Code initialisieren").option("-d, --dir <directory>", "Projektverzeichnis", ".").option("-t, --template <name>", "Template verwenden (api, frontend, cli, fullstack, library)").option("-f, --force", "CLAUDE.md \xFCberschreiben wenn vorhanden").option("--no-sync", "Nicht mit Cloud synchronisieren").option("--list-templates", "Verf\xFCgbare Templates anzeigen").action(async (options) => {
|
|
1514
|
+
var initCommand = new Command3("init").description("Projekt f\xFCr SHIVA Code initialisieren").option("-d, --dir <directory>", "Projektverzeichnis", ".").option("-t, --template <name>", "Template verwenden (api, frontend, cli, fullstack, library)").option("-f, --force", "CLAUDE.md \xFCberschreiben wenn vorhanden").option("--no-sync", "Nicht mit Cloud synchronisieren").option("--list-templates", "Verf\xFCgbare Templates anzeigen").option("--repair", "Repariert fehlende projectId in Config").action(async (options) => {
|
|
1456
1515
|
log.brand();
|
|
1457
1516
|
if (options.listTemplates) {
|
|
1458
1517
|
console.log(colors.bold("Verf\xFCgbare Templates:"));
|
|
@@ -1486,21 +1545,61 @@ var initCommand = new Command3("init").description("Projekt f\xFCr SHIVA Code in
|
|
|
1486
1545
|
if (scanned.framework) log.keyValue("Framework", scanned.framework, 2);
|
|
1487
1546
|
if (scanned.packageManager) log.keyValue("Package Manager", scanned.packageManager, 2);
|
|
1488
1547
|
log.newline();
|
|
1548
|
+
const existingConfig = getProjectConfig(projectDir);
|
|
1489
1549
|
const claudeMdPath = resolve2(projectDir, "CLAUDE.md");
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1550
|
+
const claudeMdExists = existsSync2(claudeMdPath);
|
|
1551
|
+
let existingClaudeMd = "";
|
|
1552
|
+
let shivaInstructionsExist = false;
|
|
1553
|
+
if (claudeMdExists) {
|
|
1554
|
+
existingClaudeMd = readFileSync2(claudeMdPath, "utf-8");
|
|
1555
|
+
shivaInstructionsExist = hasShivaInstructions(existingClaudeMd);
|
|
1556
|
+
}
|
|
1557
|
+
let claudeMdAction = "replace";
|
|
1558
|
+
if (claudeMdExists && !options.force) {
|
|
1559
|
+
if (shivaInstructionsExist) {
|
|
1560
|
+
if (existingConfig.projectId) {
|
|
1561
|
+
log.success("SHIVA bereits konfiguriert");
|
|
1562
|
+
if (options.repair) {
|
|
1563
|
+
claudeMdAction = "repair-only";
|
|
1564
|
+
} else {
|
|
1565
|
+
const { action } = await inquirer3.prompt([
|
|
1566
|
+
{
|
|
1567
|
+
type: "list",
|
|
1568
|
+
name: "action",
|
|
1569
|
+
message: "CLAUDE.md hat bereits SHIVA-Anweisungen. Was m\xF6chtest du tun?",
|
|
1570
|
+
choices: [
|
|
1571
|
+
{ name: "Config reparieren (projectId pr\xFCfen)", value: "repair-only" },
|
|
1572
|
+
{ name: "CLAUDE.md komplett ersetzen", value: "replace" },
|
|
1573
|
+
{ name: "Abbrechen", value: "skip" }
|
|
1574
|
+
]
|
|
1575
|
+
}
|
|
1576
|
+
]);
|
|
1577
|
+
claudeMdAction = action;
|
|
1578
|
+
}
|
|
1579
|
+
} else {
|
|
1580
|
+
log.warn("SHIVA-Anweisungen vorhanden, aber projectId fehlt");
|
|
1581
|
+
claudeMdAction = "repair-only";
|
|
1497
1582
|
}
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1583
|
+
} else {
|
|
1584
|
+
const { action } = await inquirer3.prompt([
|
|
1585
|
+
{
|
|
1586
|
+
type: "list",
|
|
1587
|
+
name: "action",
|
|
1588
|
+
message: "CLAUDE.md existiert, aber SHIVA-Anweisungen fehlen. Was m\xF6chtest du tun?",
|
|
1589
|
+
choices: [
|
|
1590
|
+
{ name: "SHIVA-Sektion anf\xFCgen (empfohlen)", value: "append" },
|
|
1591
|
+
{ name: "CLAUDE.md komplett ersetzen", value: "replace" },
|
|
1592
|
+
{ name: "Abbrechen", value: "skip" }
|
|
1593
|
+
]
|
|
1594
|
+
}
|
|
1595
|
+
]);
|
|
1596
|
+
claudeMdAction = action;
|
|
1502
1597
|
}
|
|
1503
1598
|
}
|
|
1599
|
+
if (claudeMdAction === "skip") {
|
|
1600
|
+
log.info("CLAUDE.md wurde nicht ver\xE4ndert");
|
|
1601
|
+
return;
|
|
1602
|
+
}
|
|
1504
1603
|
let project = null;
|
|
1505
1604
|
if (options.sync && isAuthenticated()) {
|
|
1506
1605
|
const syncSpinner = ora("Synchronisiere mit Cloud...").start();
|
|
@@ -1524,44 +1623,58 @@ var initCommand = new Command3("init").description("Projekt f\xFCr SHIVA Code in
|
|
|
1524
1623
|
} else if (!isAuthenticated()) {
|
|
1525
1624
|
log.dim('Tipp: Mit "shiva login" anmelden f\xFCr Cloud-Sync');
|
|
1526
1625
|
}
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1626
|
+
if (claudeMdAction === "repair-only") {
|
|
1627
|
+
log.success("Config repariert");
|
|
1628
|
+
log.newline();
|
|
1629
|
+
log.success("Projekt ist bereit!");
|
|
1630
|
+
} else {
|
|
1631
|
+
let claudeMdContent;
|
|
1632
|
+
if (options.template) {
|
|
1633
|
+
const template = getTemplate(options.template);
|
|
1634
|
+
if (!template) {
|
|
1635
|
+
log.error(`Template nicht gefunden: ${options.template}`);
|
|
1636
|
+
log.info("Verf\xFCgbare Templates: " + getTemplateNames().join(", "));
|
|
1637
|
+
return;
|
|
1638
|
+
}
|
|
1639
|
+
claudeMdContent = `# ${scanned.name}
|
|
1536
1640
|
|
|
1537
1641
|
`;
|
|
1538
|
-
|
|
1642
|
+
claudeMdContent += `**Template:** ${template.name}
|
|
1539
1643
|
|
|
1540
1644
|
`;
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1645
|
+
claudeMdContent += template.claudeMd;
|
|
1646
|
+
if (template.secrets.length > 0) {
|
|
1647
|
+
claudeMdContent += `
|
|
1544
1648
|
## Required Secrets
|
|
1545
1649
|
|
|
1546
1650
|
`;
|
|
1547
|
-
|
|
1651
|
+
claudeMdContent += `This project needs the following secrets:
|
|
1548
1652
|
`;
|
|
1549
|
-
|
|
1550
|
-
|
|
1653
|
+
for (const secret of template.secrets) {
|
|
1654
|
+
claudeMdContent += `- \`${secret}\`
|
|
1551
1655
|
`;
|
|
1552
|
-
|
|
1553
|
-
|
|
1656
|
+
}
|
|
1657
|
+
claudeMdContent += `
|
|
1554
1658
|
Add with: \`shiva secrets add <KEY> <VALUE>\`
|
|
1555
1659
|
`;
|
|
1660
|
+
}
|
|
1661
|
+
claudeMdContent += generateShivaSection(project || void 0);
|
|
1662
|
+
log.info(`Template "${options.template}" verwendet`);
|
|
1663
|
+
} else if (claudeMdAction === "append") {
|
|
1664
|
+
claudeMdContent = existingClaudeMd + generateShivaSection(project || void 0);
|
|
1665
|
+
log.info("SHIVA-Sektion angef\xFCgt");
|
|
1666
|
+
} else {
|
|
1667
|
+
claudeMdContent = generateClaudeMd(scanned, project || void 0);
|
|
1556
1668
|
}
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1669
|
+
writeFileSync(claudeMdPath, claudeMdContent);
|
|
1670
|
+
if (claudeMdAction === "append") {
|
|
1671
|
+
log.success("CLAUDE.md aktualisiert");
|
|
1672
|
+
} else {
|
|
1673
|
+
log.success("CLAUDE.md erstellt");
|
|
1674
|
+
}
|
|
1675
|
+
log.newline();
|
|
1676
|
+
log.success("Projekt initialisiert!");
|
|
1560
1677
|
}
|
|
1561
|
-
writeFileSync(claudeMdPath, claudeMdContent);
|
|
1562
|
-
log.success("CLAUDE.md erstellt");
|
|
1563
|
-
log.newline();
|
|
1564
|
-
log.success("Projekt initialisiert!");
|
|
1565
1678
|
if (!isAuthenticated()) {
|
|
1566
1679
|
log.newline();
|
|
1567
1680
|
log.info("N\xE4chste Schritte:");
|
|
@@ -3752,11 +3865,139 @@ projectCommand.command("status").description("Projekt-Status anzeigen").action(a
|
|
|
3752
3865
|
log.newline();
|
|
3753
3866
|
});
|
|
3754
3867
|
|
|
3755
|
-
// src/commands/
|
|
3868
|
+
// src/commands/project/repair.ts
|
|
3756
3869
|
import { Command as Command10 } from "commander";
|
|
3870
|
+
import { existsSync as existsSync6, readFileSync as readFileSync3 } from "fs";
|
|
3871
|
+
import { resolve as resolve6 } from "path";
|
|
3872
|
+
import ora6 from "ora";
|
|
3873
|
+
var repairCommand = new Command10("repair").description("Repariert SHIVA-Konfiguration (fehlende projectId, etc.)").option("-d, --dir <directory>", "Projektverzeichnis", ".").option("-v, --verbose", "Detaillierte Ausgabe").action(async (options) => {
|
|
3874
|
+
log.brand();
|
|
3875
|
+
const projectDir = resolve6(options.dir);
|
|
3876
|
+
const results = [];
|
|
3877
|
+
if (!existsSync6(projectDir)) {
|
|
3878
|
+
log.error(`Verzeichnis nicht gefunden: ${projectDir}`);
|
|
3879
|
+
return;
|
|
3880
|
+
}
|
|
3881
|
+
log.header("SHIVA Repair");
|
|
3882
|
+
log.newline();
|
|
3883
|
+
const spinner = ora6("Pr\xFCfe Konfiguration...").start();
|
|
3884
|
+
if (!hasShivaDir(projectDir)) {
|
|
3885
|
+
spinner.warn(".shiva Verzeichnis fehlt");
|
|
3886
|
+
results.push({
|
|
3887
|
+
issue: ".shiva Verzeichnis",
|
|
3888
|
+
status: "failed",
|
|
3889
|
+
message: 'F\xFChre "shiva init" aus um das Projekt zu initialisieren'
|
|
3890
|
+
});
|
|
3891
|
+
} else {
|
|
3892
|
+
results.push({
|
|
3893
|
+
issue: ".shiva Verzeichnis",
|
|
3894
|
+
status: "ok",
|
|
3895
|
+
message: "Vorhanden"
|
|
3896
|
+
});
|
|
3897
|
+
}
|
|
3898
|
+
const claudeMdPath = resolve6(projectDir, "CLAUDE.md");
|
|
3899
|
+
if (!existsSync6(claudeMdPath)) {
|
|
3900
|
+
results.push({
|
|
3901
|
+
issue: "CLAUDE.md",
|
|
3902
|
+
status: "failed",
|
|
3903
|
+
message: 'F\xFChre "shiva init" aus um CLAUDE.md zu erstellen'
|
|
3904
|
+
});
|
|
3905
|
+
} else {
|
|
3906
|
+
const claudeMdContent = readFileSync3(claudeMdPath, "utf-8");
|
|
3907
|
+
if (hasShivaInstructions(claudeMdContent)) {
|
|
3908
|
+
results.push({
|
|
3909
|
+
issue: "CLAUDE.md SHIVA-Anweisungen",
|
|
3910
|
+
status: "ok",
|
|
3911
|
+
message: "Vorhanden"
|
|
3912
|
+
});
|
|
3913
|
+
} else {
|
|
3914
|
+
results.push({
|
|
3915
|
+
issue: "CLAUDE.md SHIVA-Anweisungen",
|
|
3916
|
+
status: "failed",
|
|
3917
|
+
message: 'F\xFChre "shiva init" aus um SHIVA-Anweisungen hinzuzuf\xFCgen'
|
|
3918
|
+
});
|
|
3919
|
+
}
|
|
3920
|
+
}
|
|
3921
|
+
const config = getProjectConfig(projectDir);
|
|
3922
|
+
if (!config.projectId) {
|
|
3923
|
+
spinner.text = "Versuche projectId von Cloud zu holen...";
|
|
3924
|
+
if (!isAuthenticated()) {
|
|
3925
|
+
results.push({
|
|
3926
|
+
issue: "projectId in Config",
|
|
3927
|
+
status: "failed",
|
|
3928
|
+
message: 'Nicht angemeldet - f\xFChre "shiva login" aus'
|
|
3929
|
+
});
|
|
3930
|
+
} else {
|
|
3931
|
+
try {
|
|
3932
|
+
const project = await api.findProjectByPath(projectDir);
|
|
3933
|
+
if (project) {
|
|
3934
|
+
updateProjectConfig(projectDir, { projectId: project.id });
|
|
3935
|
+
results.push({
|
|
3936
|
+
issue: "projectId in Config",
|
|
3937
|
+
status: "fixed",
|
|
3938
|
+
message: `Repariert (ID: ${project.id})`
|
|
3939
|
+
});
|
|
3940
|
+
} else {
|
|
3941
|
+
spinner.text = "Erstelle Projekt in Cloud...";
|
|
3942
|
+
const result = await api.createOrUpdateProject({
|
|
3943
|
+
name: __require("path").basename(projectDir),
|
|
3944
|
+
path: projectDir
|
|
3945
|
+
});
|
|
3946
|
+
updateProjectConfig(projectDir, { projectId: result.projectId });
|
|
3947
|
+
results.push({
|
|
3948
|
+
issue: "projectId in Config",
|
|
3949
|
+
status: "fixed",
|
|
3950
|
+
message: `Projekt erstellt (ID: ${result.projectId})`
|
|
3951
|
+
});
|
|
3952
|
+
}
|
|
3953
|
+
} catch (error) {
|
|
3954
|
+
results.push({
|
|
3955
|
+
issue: "projectId in Config",
|
|
3956
|
+
status: "failed",
|
|
3957
|
+
message: error instanceof Error ? error.message : "Cloud-Fehler"
|
|
3958
|
+
});
|
|
3959
|
+
}
|
|
3960
|
+
}
|
|
3961
|
+
} else {
|
|
3962
|
+
results.push({
|
|
3963
|
+
issue: "projectId in Config",
|
|
3964
|
+
status: "ok",
|
|
3965
|
+
message: `ID: ${config.projectId}`
|
|
3966
|
+
});
|
|
3967
|
+
}
|
|
3968
|
+
spinner.stop();
|
|
3969
|
+
log.newline();
|
|
3970
|
+
const fixed = results.filter((r) => r.status === "fixed").length;
|
|
3971
|
+
const failed = results.filter((r) => r.status === "failed").length;
|
|
3972
|
+
const ok = results.filter((r) => r.status === "ok").length;
|
|
3973
|
+
for (const result of results) {
|
|
3974
|
+
const icon = result.status === "ok" ? colors.green("\u2713") : result.status === "fixed" ? colors.yellow("\u26A1") : colors.red("\u2717");
|
|
3975
|
+
const statusText = result.status === "fixed" ? colors.yellow("REPARIERT") : result.status === "ok" ? colors.green("OK") : colors.red("FEHLT");
|
|
3976
|
+
console.log(` ${icon} ${result.issue}`);
|
|
3977
|
+
if (options.verbose || result.status !== "ok") {
|
|
3978
|
+
console.log(` ${colors.dim(result.message)}`);
|
|
3979
|
+
}
|
|
3980
|
+
}
|
|
3981
|
+
log.newline();
|
|
3982
|
+
log.separator("\u2500", 40);
|
|
3983
|
+
if (failed === 0) {
|
|
3984
|
+
if (fixed > 0) {
|
|
3985
|
+
log.success(`${fixed} Problem${fixed > 1 ? "e" : ""} repariert!`);
|
|
3986
|
+
} else {
|
|
3987
|
+
log.success("Alles in Ordnung!");
|
|
3988
|
+
}
|
|
3989
|
+
} else {
|
|
3990
|
+
log.warn(`${failed} Problem${failed > 1 ? "e" : ""} gefunden`);
|
|
3991
|
+
log.info("F\xFChre die vorgeschlagenen Befehle aus um zu reparieren");
|
|
3992
|
+
}
|
|
3993
|
+
log.newline();
|
|
3994
|
+
});
|
|
3995
|
+
|
|
3996
|
+
// src/commands/session/start.ts
|
|
3997
|
+
import { Command as Command11 } from "commander";
|
|
3757
3998
|
import * as fs from "fs";
|
|
3758
3999
|
import * as path3 from "path";
|
|
3759
|
-
import
|
|
4000
|
+
import ora7 from "ora";
|
|
3760
4001
|
import { spawnSync as spawnSync4 } from "child_process";
|
|
3761
4002
|
|
|
3762
4003
|
// src/services/infrastructure/terminal.ts
|
|
@@ -3868,11 +4109,11 @@ var DockerService = class {
|
|
|
3868
4109
|
throw new Error(`Invalid image name: ${sanitizeForLog(image)}`);
|
|
3869
4110
|
}
|
|
3870
4111
|
const cmd = this.getCommand();
|
|
3871
|
-
return new Promise((
|
|
4112
|
+
return new Promise((resolve14, reject) => {
|
|
3872
4113
|
const pull = spawn(cmd, ["pull", image], { stdio: "inherit" });
|
|
3873
4114
|
pull.on("close", (code) => {
|
|
3874
4115
|
if (code === 0) {
|
|
3875
|
-
|
|
4116
|
+
resolve14();
|
|
3876
4117
|
} else {
|
|
3877
4118
|
reject(new Error(`Failed to pull image: ${sanitizeForLog(image)}`));
|
|
3878
4119
|
}
|
|
@@ -4921,7 +5162,7 @@ function getTerminalName(terminal) {
|
|
|
4921
5162
|
|
|
4922
5163
|
// src/services/sandbox/sandbox.ts
|
|
4923
5164
|
import { execSync } from "child_process";
|
|
4924
|
-
import { existsSync as
|
|
5165
|
+
import { existsSync as existsSync7, mkdirSync, rmSync, readdirSync as readdirSync2, copyFileSync, readFileSync as readFileSync4 } from "fs";
|
|
4925
5166
|
import { join as join3, dirname } from "path";
|
|
4926
5167
|
import { randomUUID } from "crypto";
|
|
4927
5168
|
import Conf2 from "conf";
|
|
@@ -5092,13 +5333,13 @@ var SandboxService = class {
|
|
|
5092
5333
|
for (const file of untrackedFiles) {
|
|
5093
5334
|
const srcPath = join3(projectPath, file);
|
|
5094
5335
|
const destPath = join3(sandboxPath, file);
|
|
5095
|
-
if (!
|
|
5336
|
+
if (!existsSync7(srcPath)) continue;
|
|
5096
5337
|
const config = this.getConfig();
|
|
5097
5338
|
if (config.excludePaths.some((excluded) => file.startsWith(excluded))) {
|
|
5098
5339
|
continue;
|
|
5099
5340
|
}
|
|
5100
5341
|
const destDir = dirname(destPath);
|
|
5101
|
-
if (!
|
|
5342
|
+
if (!existsSync7(destDir)) {
|
|
5102
5343
|
mkdirSync(destDir, { recursive: true });
|
|
5103
5344
|
}
|
|
5104
5345
|
copyFileSync(srcPath, destPath);
|
|
@@ -5217,7 +5458,7 @@ var SandboxService = class {
|
|
|
5217
5458
|
stdio: "pipe"
|
|
5218
5459
|
});
|
|
5219
5460
|
} catch {
|
|
5220
|
-
if (
|
|
5461
|
+
if (existsSync7(session.sandboxPath)) {
|
|
5221
5462
|
rmSync(session.sandboxPath, { recursive: true, force: true });
|
|
5222
5463
|
}
|
|
5223
5464
|
try {
|
|
@@ -5229,7 +5470,7 @@ var SandboxService = class {
|
|
|
5229
5470
|
}
|
|
5230
5471
|
}
|
|
5231
5472
|
} else {
|
|
5232
|
-
if (
|
|
5473
|
+
if (existsSync7(session.sandboxPath)) {
|
|
5233
5474
|
rmSync(session.sandboxPath, { recursive: true, force: true });
|
|
5234
5475
|
}
|
|
5235
5476
|
}
|
|
@@ -5274,8 +5515,8 @@ var SandboxService = class {
|
|
|
5274
5515
|
const untrackedFiles = untrackedOutput.split("\n").filter((f) => f.trim().length > 0);
|
|
5275
5516
|
for (const file of untrackedFiles) {
|
|
5276
5517
|
const filePath = join3(session.sandboxPath, file);
|
|
5277
|
-
if (
|
|
5278
|
-
const content =
|
|
5518
|
+
if (existsSync7(filePath)) {
|
|
5519
|
+
const content = readFileSync4(filePath, "utf-8");
|
|
5279
5520
|
const lineCount = content.split("\n").length;
|
|
5280
5521
|
changes.push({
|
|
5281
5522
|
type: "added",
|
|
@@ -5309,7 +5550,7 @@ var SandboxService = class {
|
|
|
5309
5550
|
const config = this.getConfig();
|
|
5310
5551
|
const sandboxEntries = /* @__PURE__ */ new Set();
|
|
5311
5552
|
const sandboxFullPath = join3(sandboxPath, relativePath);
|
|
5312
|
-
if (
|
|
5553
|
+
if (existsSync7(sandboxFullPath)) {
|
|
5313
5554
|
const entries = readdirSync2(sandboxFullPath, { withFileTypes: true });
|
|
5314
5555
|
for (const entry of entries) {
|
|
5315
5556
|
if (config.excludePaths.includes(entry.name) || entry.name === ".shiva") {
|
|
@@ -5320,14 +5561,14 @@ var SandboxService = class {
|
|
|
5320
5561
|
const originalEntryPath = join3(originalPath, entryRelPath);
|
|
5321
5562
|
const sandboxEntryPath = join3(sandboxPath, entryRelPath);
|
|
5322
5563
|
if (entry.isDirectory()) {
|
|
5323
|
-
if (!
|
|
5564
|
+
if (!existsSync7(originalEntryPath)) {
|
|
5324
5565
|
await this.countNewDirectoryChanges(sandboxEntryPath, entryRelPath, changes);
|
|
5325
5566
|
} else {
|
|
5326
5567
|
await this.compareDirectories(originalPath, sandboxPath, entryRelPath, changes);
|
|
5327
5568
|
}
|
|
5328
5569
|
} else {
|
|
5329
|
-
if (!
|
|
5330
|
-
const content =
|
|
5570
|
+
if (!existsSync7(originalEntryPath)) {
|
|
5571
|
+
const content = readFileSync4(sandboxEntryPath, "utf-8");
|
|
5331
5572
|
changes.push({
|
|
5332
5573
|
type: "added",
|
|
5333
5574
|
path: entryRelPath,
|
|
@@ -5336,8 +5577,8 @@ var SandboxService = class {
|
|
|
5336
5577
|
selected: true
|
|
5337
5578
|
});
|
|
5338
5579
|
} else {
|
|
5339
|
-
const originalContent =
|
|
5340
|
-
const sandboxContent =
|
|
5580
|
+
const originalContent = readFileSync4(originalEntryPath, "utf-8");
|
|
5581
|
+
const sandboxContent = readFileSync4(sandboxEntryPath, "utf-8");
|
|
5341
5582
|
if (originalContent !== sandboxContent) {
|
|
5342
5583
|
const { additions, deletions } = this.countLineDiff(originalContent, sandboxContent);
|
|
5343
5584
|
changes.push({
|
|
@@ -5353,7 +5594,7 @@ var SandboxService = class {
|
|
|
5353
5594
|
}
|
|
5354
5595
|
}
|
|
5355
5596
|
const originalFullPath = join3(originalPath, relativePath);
|
|
5356
|
-
if (
|
|
5597
|
+
if (existsSync7(originalFullPath)) {
|
|
5357
5598
|
const entries = readdirSync2(originalFullPath, { withFileTypes: true });
|
|
5358
5599
|
for (const entry of entries) {
|
|
5359
5600
|
if (config.excludePaths.includes(entry.name) || entry.name === ".shiva") {
|
|
@@ -5365,7 +5606,7 @@ var SandboxService = class {
|
|
|
5365
5606
|
if (entry.isDirectory()) {
|
|
5366
5607
|
await this.countDeletedDirectoryChanges(originalEntryPath, entryRelPath, changes);
|
|
5367
5608
|
} else {
|
|
5368
|
-
const content =
|
|
5609
|
+
const content = readFileSync4(originalEntryPath, "utf-8");
|
|
5369
5610
|
changes.push({
|
|
5370
5611
|
type: "deleted",
|
|
5371
5612
|
path: entryRelPath,
|
|
@@ -5409,7 +5650,7 @@ var SandboxService = class {
|
|
|
5409
5650
|
if (entry.isDirectory()) {
|
|
5410
5651
|
await this.countNewDirectoryChanges(entryPath, entryRelPath, changes);
|
|
5411
5652
|
} else {
|
|
5412
|
-
const content =
|
|
5653
|
+
const content = readFileSync4(entryPath, "utf-8");
|
|
5413
5654
|
changes.push({
|
|
5414
5655
|
type: "added",
|
|
5415
5656
|
path: entryRelPath,
|
|
@@ -5433,7 +5674,7 @@ var SandboxService = class {
|
|
|
5433
5674
|
if (entry.isDirectory()) {
|
|
5434
5675
|
await this.countDeletedDirectoryChanges(entryPath, entryRelPath, changes);
|
|
5435
5676
|
} else {
|
|
5436
|
-
const content =
|
|
5677
|
+
const content = readFileSync4(entryPath, "utf-8");
|
|
5437
5678
|
changes.push({
|
|
5438
5679
|
type: "deleted",
|
|
5439
5680
|
path: entryRelPath,
|
|
@@ -5461,8 +5702,8 @@ var SandboxService = class {
|
|
|
5461
5702
|
return diff || "(no changes)";
|
|
5462
5703
|
} catch {
|
|
5463
5704
|
const sandboxFilePath2 = join3(session.sandboxPath, filePath);
|
|
5464
|
-
if (
|
|
5465
|
-
const content =
|
|
5705
|
+
if (existsSync7(sandboxFilePath2)) {
|
|
5706
|
+
const content = readFileSync4(sandboxFilePath2, "utf-8");
|
|
5466
5707
|
return `+++ ${filePath} (new file)
|
|
5467
5708
|
${content.split("\n").map((l) => `+ ${l}`).join("\n")}`;
|
|
5468
5709
|
}
|
|
@@ -5471,21 +5712,21 @@ ${content.split("\n").map((l) => `+ ${l}`).join("\n")}`;
|
|
|
5471
5712
|
}
|
|
5472
5713
|
const originalPath = join3(session.projectPath, filePath);
|
|
5473
5714
|
const sandboxFilePath = join3(session.sandboxPath, filePath);
|
|
5474
|
-
const originalExists =
|
|
5475
|
-
const sandboxExists =
|
|
5715
|
+
const originalExists = existsSync7(originalPath);
|
|
5716
|
+
const sandboxExists = existsSync7(sandboxFilePath);
|
|
5476
5717
|
if (!originalExists && sandboxExists) {
|
|
5477
|
-
const content =
|
|
5718
|
+
const content = readFileSync4(sandboxFilePath, "utf-8");
|
|
5478
5719
|
return `+++ ${filePath} (new file)
|
|
5479
5720
|
${content.split("\n").map((l) => `+ ${l}`).join("\n")}`;
|
|
5480
5721
|
}
|
|
5481
5722
|
if (originalExists && !sandboxExists) {
|
|
5482
|
-
const content =
|
|
5723
|
+
const content = readFileSync4(originalPath, "utf-8");
|
|
5483
5724
|
return `--- ${filePath} (deleted)
|
|
5484
5725
|
${content.split("\n").map((l) => `- ${l}`).join("\n")}`;
|
|
5485
5726
|
}
|
|
5486
5727
|
if (originalExists && sandboxExists) {
|
|
5487
|
-
const originalContent =
|
|
5488
|
-
const sandboxContent =
|
|
5728
|
+
const originalContent = readFileSync4(originalPath, "utf-8");
|
|
5729
|
+
const sandboxContent = readFileSync4(sandboxFilePath, "utf-8");
|
|
5489
5730
|
if (originalContent === sandboxContent) {
|
|
5490
5731
|
return "(no changes)";
|
|
5491
5732
|
}
|
|
@@ -5531,13 +5772,13 @@ ${content.split("\n").map((l) => `- ${l}`).join("\n")}`;
|
|
|
5531
5772
|
const srcPath = join3(session.sandboxPath, filePath);
|
|
5532
5773
|
const destPath = join3(session.projectPath, filePath);
|
|
5533
5774
|
if (change.type === "deleted") {
|
|
5534
|
-
if (
|
|
5775
|
+
if (existsSync7(destPath)) {
|
|
5535
5776
|
rmSync(destPath, { force: true });
|
|
5536
5777
|
}
|
|
5537
5778
|
} else {
|
|
5538
|
-
if (
|
|
5779
|
+
if (existsSync7(srcPath)) {
|
|
5539
5780
|
const destDir = dirname(destPath);
|
|
5540
|
-
if (!
|
|
5781
|
+
if (!existsSync7(destDir)) {
|
|
5541
5782
|
mkdirSync(destDir, { recursive: true });
|
|
5542
5783
|
}
|
|
5543
5784
|
copyFileSync(srcPath, destPath);
|
|
@@ -5568,10 +5809,10 @@ ${content.split("\n").map((l) => `- ${l}`).join("\n")}`;
|
|
|
5568
5809
|
for (const filePath of filePaths) {
|
|
5569
5810
|
const sandboxFilePath = join3(session.sandboxPath, filePath);
|
|
5570
5811
|
const originalPath = join3(session.projectPath, filePath);
|
|
5571
|
-
if (
|
|
5812
|
+
if (existsSync7(originalPath)) {
|
|
5572
5813
|
copyFileSync(originalPath, sandboxFilePath);
|
|
5573
5814
|
} else {
|
|
5574
|
-
if (
|
|
5815
|
+
if (existsSync7(sandboxFilePath)) {
|
|
5575
5816
|
rmSync(sandboxFilePath, { force: true });
|
|
5576
5817
|
}
|
|
5577
5818
|
}
|
|
@@ -5643,7 +5884,7 @@ ${content.split("\n").map((l) => `- ${l}`).join("\n")}`;
|
|
|
5643
5884
|
var sandboxService = new SandboxService();
|
|
5644
5885
|
|
|
5645
5886
|
// src/commands/session/start.ts
|
|
5646
|
-
var startCommand = new
|
|
5887
|
+
var startCommand = new Command11("start").description("Projekte starten (mit GitHub Integration)").argument("[projekte...]", "Projektnamen oder Pfade").option("-n, --new", "Neue Sessions statt Resume").option("-t, --terminal <type>", "Terminal-Typ: tmux, gnome-terminal, kitty, alacritty, docker, auto", "auto").option("-d, --docker", "In Docker-Container starten").option("-i, --issue <number>", "Session f\xFCr GitHub Issue starten").option("-p, --pr <number>", "Session f\xFCr PR Review starten").option("--no-context", "Ohne GitHub Context starten").option("-s, --sandbox [mode]", "In Sandbox starten (worktree, copy, docker-overlay)").action(async (projekte, options) => {
|
|
5647
5888
|
try {
|
|
5648
5889
|
if (options.issue) {
|
|
5649
5890
|
await startIssueSession(parseInt(options.issue, 10), options);
|
|
@@ -5660,7 +5901,7 @@ var startCommand = new Command10("start").description("Projekte starten (mit Git
|
|
|
5660
5901
|
log.info("Oder: shiva start --pr <nummer>");
|
|
5661
5902
|
return;
|
|
5662
5903
|
}
|
|
5663
|
-
const spinner =
|
|
5904
|
+
const spinner = ora7("Bereite Projekte vor...").start();
|
|
5664
5905
|
const allProjects = await getAllClaudeProjects();
|
|
5665
5906
|
const launches = [];
|
|
5666
5907
|
for (const projektArg of projekte) {
|
|
@@ -5815,7 +6056,7 @@ var startCommand = new Command10("start").description("Projekte starten (mit Git
|
|
|
5815
6056
|
}
|
|
5816
6057
|
});
|
|
5817
6058
|
async function startIssueSession(issueNumber, options) {
|
|
5818
|
-
const spinner =
|
|
6059
|
+
const spinner = ora7(`Suche Issue #${issueNumber}...`).start();
|
|
5819
6060
|
if (!isGhInstalled() || !isGhAuthenticated()) {
|
|
5820
6061
|
spinner.fail("GitHub nicht verf\xFCgbar");
|
|
5821
6062
|
log.info("Anmelden mit: shiva github login");
|
|
@@ -5924,7 +6165,7 @@ function generateIssueContext(issue, repo) {
|
|
|
5924
6165
|
return lines.join("\n");
|
|
5925
6166
|
}
|
|
5926
6167
|
async function startPRSession(prNumber, options) {
|
|
5927
|
-
const spinner =
|
|
6168
|
+
const spinner = ora7(`Suche PR #${prNumber}...`).start();
|
|
5928
6169
|
if (!isGhInstalled() || !isGhAuthenticated()) {
|
|
5929
6170
|
spinner.fail("GitHub nicht verf\xFCgbar");
|
|
5930
6171
|
log.info("Anmelden mit: shiva github login");
|
|
@@ -6032,12 +6273,12 @@ function generatePRReviewContext(pr, repo) {
|
|
|
6032
6273
|
}
|
|
6033
6274
|
|
|
6034
6275
|
// src/commands/session/resume.ts
|
|
6035
|
-
import { Command as
|
|
6276
|
+
import { Command as Command12 } from "commander";
|
|
6036
6277
|
import { spawn as spawn3 } from "child_process";
|
|
6037
6278
|
import inquirer4 from "inquirer";
|
|
6038
|
-
import
|
|
6279
|
+
import ora8 from "ora";
|
|
6039
6280
|
import * as fs2 from "fs";
|
|
6040
|
-
var resumeCommand = new
|
|
6281
|
+
var resumeCommand = new Command12("resume").description("Neueste Claude Code Session fortsetzen").argument("[projekt]", "Projektname oder Pfad").option("-s, --session <id>", "Bestimmte Session-ID fortsetzen").option("-b, --branch", "Session f\xFCr aktuellen Branch verwenden").option("-l, --list", "Sessions zur Auswahl anzeigen").option("--save-mapping", "Branch-Session Mapping speichern").action(async (projekt, options) => {
|
|
6041
6282
|
try {
|
|
6042
6283
|
let project = null;
|
|
6043
6284
|
let session = null;
|
|
@@ -6162,7 +6403,7 @@ var resumeCommand = new Command11("resume").description("Neueste Claude Code Ses
|
|
|
6162
6403
|
}
|
|
6163
6404
|
});
|
|
6164
6405
|
async function selectProjectInteractive() {
|
|
6165
|
-
const spinner =
|
|
6406
|
+
const spinner = ora8("Lade Projekte...").start();
|
|
6166
6407
|
const projects = await getAllClaudeProjects();
|
|
6167
6408
|
spinner.stop();
|
|
6168
6409
|
const projectsWithSessions = projects.filter((p) => p.sessions.length > 0);
|
|
@@ -6255,12 +6496,12 @@ function launchClaudeResume(projectPath, sessionId) {
|
|
|
6255
6496
|
}
|
|
6256
6497
|
|
|
6257
6498
|
// src/commands/session/restore.ts
|
|
6258
|
-
import { Command as
|
|
6499
|
+
import { Command as Command13 } from "commander";
|
|
6259
6500
|
import { spawn as spawn4 } from "child_process";
|
|
6260
6501
|
import inquirer5 from "inquirer";
|
|
6261
|
-
import
|
|
6502
|
+
import ora9 from "ora";
|
|
6262
6503
|
import * as fs3 from "fs";
|
|
6263
|
-
var restoreCommand = new
|
|
6504
|
+
var restoreCommand = new Command13("restore").description("Context aus crashed Session wiederherstellen").argument("[projekt]", "Projektname oder Pfad").option("--level <level>", "Recovery-Level: minimal, standard, full", "standard").option("-o, --output <pfad>", "Ausgabeverzeichnis f\xFCr Recovery-Datei").option("--no-prompt", "Keine neue Session starten").action(async (projekt, options) => {
|
|
6264
6505
|
try {
|
|
6265
6506
|
let project = null;
|
|
6266
6507
|
let session = null;
|
|
@@ -6271,7 +6512,7 @@ var restoreCommand = new Command12("restore").description("Context aus crashed S
|
|
|
6271
6512
|
return;
|
|
6272
6513
|
}
|
|
6273
6514
|
if (!projekt) {
|
|
6274
|
-
const spinner2 =
|
|
6515
|
+
const spinner2 = ora9("Lade Projekte...").start();
|
|
6275
6516
|
const projects = await getAllClaudeProjects();
|
|
6276
6517
|
spinner2.stop();
|
|
6277
6518
|
const projectsWithSessions = projects.filter((p) => p.sessions.length > 0);
|
|
@@ -6344,7 +6585,7 @@ var restoreCommand = new Command12("restore").description("Context aus crashed S
|
|
|
6344
6585
|
log.keyValue("Status", `${statusText} (${fileSize})`);
|
|
6345
6586
|
log.keyValue("Level", level);
|
|
6346
6587
|
log.newline();
|
|
6347
|
-
const spinner =
|
|
6588
|
+
const spinner = ora9("Extrahiere Context...").start();
|
|
6348
6589
|
try {
|
|
6349
6590
|
const context = await getRecoveredContext(session, level);
|
|
6350
6591
|
spinner.succeed("Context extrahiert");
|
|
@@ -6409,8 +6650,8 @@ var restoreCommand = new Command12("restore").description("Context aus crashed S
|
|
|
6409
6650
|
});
|
|
6410
6651
|
|
|
6411
6652
|
// src/commands/session/sessions.ts
|
|
6412
|
-
import { Command as
|
|
6413
|
-
import
|
|
6653
|
+
import { Command as Command14 } from "commander";
|
|
6654
|
+
import ora10 from "ora";
|
|
6414
6655
|
|
|
6415
6656
|
// src/services/data/tags.ts
|
|
6416
6657
|
import * as fs4 from "fs";
|
|
@@ -6591,11 +6832,11 @@ function logErrorWithSuggestion(error, commandName) {
|
|
|
6591
6832
|
}
|
|
6592
6833
|
|
|
6593
6834
|
// src/commands/session/sessions.ts
|
|
6594
|
-
var sessionsCommand = new
|
|
6835
|
+
var sessionsCommand = new Command14("sessions").description("Alle Claude Code Sessions auflisten").option("-a, --all", "Auch leere Projekte zeigen").option("-p, --project <pfad>", "Nur ein bestimmtes Projekt").option("-t, --tag <tag>", "Nach Tag filtern (Komma-getrennt f\xFCr mehrere)").option("-r, --refresh", "Cache invalidieren und neu laden").option("--json", "JSON Output").action(withCommandErrorHandling("sessions", async (options) => {
|
|
6595
6836
|
if (options.refresh) {
|
|
6596
6837
|
invalidateSessionsCache();
|
|
6597
6838
|
}
|
|
6598
|
-
const spinner =
|
|
6839
|
+
const spinner = ora10("Lade Sessions...").start();
|
|
6599
6840
|
let projects = await getAllClaudeProjects(options.refresh);
|
|
6600
6841
|
if (options.project) {
|
|
6601
6842
|
const found = await findProject(options.project);
|
|
@@ -6717,7 +6958,7 @@ sessionsCommand.command("push").description("Sessions in Cloud sichern").option(
|
|
|
6717
6958
|
log.warn("Keine Sessions zum Synchronisieren gefunden");
|
|
6718
6959
|
return;
|
|
6719
6960
|
}
|
|
6720
|
-
const spinner =
|
|
6961
|
+
const spinner = ora10("Synchronisiere Sessions...").start();
|
|
6721
6962
|
let syncedCount = 0;
|
|
6722
6963
|
let errorCount = 0;
|
|
6723
6964
|
for (const project of projects) {
|
|
@@ -6761,7 +7002,7 @@ sessionsCommand.command("pull").description("Sessions aus Cloud laden").option("
|
|
|
6761
7002
|
log.info("Anmelden mit: shiva login");
|
|
6762
7003
|
return;
|
|
6763
7004
|
}
|
|
6764
|
-
const spinner =
|
|
7005
|
+
const spinner = ora10("Lade Sessions aus Cloud...").start();
|
|
6765
7006
|
try {
|
|
6766
7007
|
const cloudSessions = await api2.getSessions();
|
|
6767
7008
|
spinner.stop();
|
|
@@ -6819,7 +7060,7 @@ sessionsCommand.command("sync").description("Sessions mit Cloud synchronisieren"
|
|
|
6819
7060
|
return;
|
|
6820
7061
|
}
|
|
6821
7062
|
}
|
|
6822
|
-
const spinner =
|
|
7063
|
+
const spinner = ora10("Synchronisiere Sessions...").start();
|
|
6823
7064
|
let pushedCount = 0;
|
|
6824
7065
|
for (const project of projects.filter((p) => p.sessions.length > 0)) {
|
|
6825
7066
|
const config = getProjectConfig2(project.absolutePath);
|
|
@@ -6880,7 +7121,7 @@ sessionsCommand.command("active").description("Aktive Cloud-Sessions anzeigen").
|
|
|
6880
7121
|
log.info("Anmelden mit: shiva login");
|
|
6881
7122
|
return;
|
|
6882
7123
|
}
|
|
6883
|
-
const spinner =
|
|
7124
|
+
const spinner = ora10("Lade aktive Sessions...").start();
|
|
6884
7125
|
try {
|
|
6885
7126
|
const sessions = await api2.getActiveSessions();
|
|
6886
7127
|
spinner.stop();
|
|
@@ -6917,7 +7158,7 @@ sessionsCommand.command("stats").description("Cloud-Session-Statistiken anzeigen
|
|
|
6917
7158
|
log.info("Anmelden mit: shiva login");
|
|
6918
7159
|
return;
|
|
6919
7160
|
}
|
|
6920
|
-
const spinner =
|
|
7161
|
+
const spinner = ora10("Lade Session-Statistiken...").start();
|
|
6921
7162
|
try {
|
|
6922
7163
|
const stats = await api2.getSessionStats();
|
|
6923
7164
|
spinner.stop();
|
|
@@ -6949,7 +7190,7 @@ sessionsCommand.command("resume <sessionId>").description("Cloud-Session fortset
|
|
|
6949
7190
|
log.info("Anmelden mit: shiva login");
|
|
6950
7191
|
return;
|
|
6951
7192
|
}
|
|
6952
|
-
const spinner =
|
|
7193
|
+
const spinner = ora10("Lade Session...").start();
|
|
6953
7194
|
try {
|
|
6954
7195
|
const result = await api2.resumeSession(sessionId);
|
|
6955
7196
|
if (result.success) {
|
|
@@ -6974,7 +7215,7 @@ sessionsCommand.command("export <sessionId>").description("Cloud-Session exporti
|
|
|
6974
7215
|
log.info("Anmelden mit: shiva login");
|
|
6975
7216
|
return;
|
|
6976
7217
|
}
|
|
6977
|
-
const spinner =
|
|
7218
|
+
const spinner = ora10("Exportiere Session...").start();
|
|
6978
7219
|
try {
|
|
6979
7220
|
const exportData = await api2.exportSession(sessionId);
|
|
6980
7221
|
spinner.stop();
|
|
@@ -7002,7 +7243,7 @@ sessionsCommand.command("update <sessionId>").description("Cloud-Session aktuali
|
|
|
7002
7243
|
log.info("Verf\xFCgbare Optionen: --summary, --branch");
|
|
7003
7244
|
return;
|
|
7004
7245
|
}
|
|
7005
|
-
const spinner =
|
|
7246
|
+
const spinner = ora10("Aktualisiere Session...").start();
|
|
7006
7247
|
try {
|
|
7007
7248
|
const result = await api2.updateSession(sessionId, {
|
|
7008
7249
|
summary: options.summary,
|
|
@@ -7020,8 +7261,8 @@ sessionsCommand.command("update <sessionId>").description("Cloud-Session aktuali
|
|
|
7020
7261
|
});
|
|
7021
7262
|
|
|
7022
7263
|
// src/commands/session/session.ts
|
|
7023
|
-
import { Command as
|
|
7024
|
-
import
|
|
7264
|
+
import { Command as Command15 } from "commander";
|
|
7265
|
+
import ora11 from "ora";
|
|
7025
7266
|
function formatChangeType(type2) {
|
|
7026
7267
|
switch (type2) {
|
|
7027
7268
|
case "added":
|
|
@@ -7087,9 +7328,9 @@ async function selectSandbox(sessions) {
|
|
|
7087
7328
|
]);
|
|
7088
7329
|
return selected;
|
|
7089
7330
|
}
|
|
7090
|
-
var sessionCommand = new
|
|
7331
|
+
var sessionCommand = new Command15("session").description("Sandbox-Sessions verwalten");
|
|
7091
7332
|
sessionCommand.command("end").description("Aktive Sandbox-Session beenden").argument("[session-id]", "Session ID (optional, nutzt aktive Session)").action(async (sessionId) => {
|
|
7092
|
-
const spinner =
|
|
7333
|
+
const spinner = ora11("Beende Session...").start();
|
|
7093
7334
|
try {
|
|
7094
7335
|
let session = null;
|
|
7095
7336
|
if (sessionId) {
|
|
@@ -7125,7 +7366,7 @@ sessionCommand.command("end").description("Aktive Sandbox-Session beenden").argu
|
|
|
7125
7366
|
}
|
|
7126
7367
|
});
|
|
7127
7368
|
sessionCommand.command("review").description("Sandbox-\xC4nderungen reviewen").argument("[session-id]", "Session ID (optional)").option("--json", "JSON Output").action(async (sessionId, options) => {
|
|
7128
|
-
const spinner =
|
|
7369
|
+
const spinner = ora11("Lade \xC4nderungen...").start();
|
|
7129
7370
|
try {
|
|
7130
7371
|
let session = null;
|
|
7131
7372
|
if (sessionId) {
|
|
@@ -7173,7 +7414,7 @@ sessionCommand.command("review").description("Sandbox-\xC4nderungen reviewen").a
|
|
|
7173
7414
|
}
|
|
7174
7415
|
});
|
|
7175
7416
|
sessionCommand.command("diff").description("Diff f\xFCr Datei anzeigen").argument("[session-id]", "Session ID").argument("[file]", "Datei (optional, zeigt alle wenn nicht angegeben)").option("--stat", "Nur Statistiken zeigen").action(async (sessionId, file, options) => {
|
|
7176
|
-
const spinner =
|
|
7417
|
+
const spinner = ora11("Lade Diff...").start();
|
|
7177
7418
|
try {
|
|
7178
7419
|
let session = null;
|
|
7179
7420
|
if (sessionId) {
|
|
@@ -7222,7 +7463,7 @@ sessionCommand.command("diff").description("Diff f\xFCr Datei anzeigen").argumen
|
|
|
7222
7463
|
}
|
|
7223
7464
|
});
|
|
7224
7465
|
sessionCommand.command("apply").description("Sandbox-\xC4nderungen \xFCbernehmen").argument("[session-id]", "Session ID").argument("[files...]", "Nur bestimmte Dateien \xFCbernehmen").option("--select", "Dateien interaktiv ausw\xE4hlen").option("-y, --yes", "Ohne Best\xE4tigung").action(async (sessionId, files, options) => {
|
|
7225
|
-
const spinner =
|
|
7466
|
+
const spinner = ora11("Bereite Apply vor...").start();
|
|
7226
7467
|
try {
|
|
7227
7468
|
let session = null;
|
|
7228
7469
|
if (sessionId) {
|
|
@@ -7296,7 +7537,7 @@ sessionCommand.command("apply").description("Sandbox-\xC4nderungen \xFCbernehmen
|
|
|
7296
7537
|
return;
|
|
7297
7538
|
}
|
|
7298
7539
|
}
|
|
7299
|
-
const applySpinner =
|
|
7540
|
+
const applySpinner = ora11("\xDCbernehme \xC4nderungen...").start();
|
|
7300
7541
|
await sandboxService.applyChanges(session.id, selectedPaths);
|
|
7301
7542
|
applySpinner.succeed("\xC4nderungen \xFCbernommen");
|
|
7302
7543
|
log.newline();
|
|
@@ -7306,7 +7547,7 @@ sessionCommand.command("apply").description("Sandbox-\xC4nderungen \xFCbernehmen
|
|
|
7306
7547
|
}
|
|
7307
7548
|
});
|
|
7308
7549
|
sessionCommand.command("discard").description("Sandbox-\xC4nderungen verwerfen").argument("[session-id]", "Session ID").argument("[files...]", "Nur bestimmte Dateien verwerfen").option("-y, --yes", "Ohne Best\xE4tigung").action(async (sessionId, files, options) => {
|
|
7309
|
-
const spinner =
|
|
7550
|
+
const spinner = ora11("Bereite Discard vor...").start();
|
|
7310
7551
|
try {
|
|
7311
7552
|
let session = null;
|
|
7312
7553
|
if (sessionId) {
|
|
@@ -7359,7 +7600,7 @@ sessionCommand.command("discard").description("Sandbox-\xC4nderungen verwerfen")
|
|
|
7359
7600
|
return;
|
|
7360
7601
|
}
|
|
7361
7602
|
}
|
|
7362
|
-
const discardSpinner =
|
|
7603
|
+
const discardSpinner = ora11("Verwerfe \xC4nderungen...").start();
|
|
7363
7604
|
if (files && files.length > 0) {
|
|
7364
7605
|
await sandboxService.discardFiles(session.id, files);
|
|
7365
7606
|
discardSpinner.succeed(`${files.length} Dateien verworfen`);
|
|
@@ -7419,7 +7660,7 @@ sessionCommand.command("cleanup").description("Alte Sandboxes aufr\xE4umen").opt
|
|
|
7419
7660
|
return;
|
|
7420
7661
|
}
|
|
7421
7662
|
}
|
|
7422
|
-
const spinner =
|
|
7663
|
+
const spinner = ora11("R\xE4ume auf...").start();
|
|
7423
7664
|
let cleaned;
|
|
7424
7665
|
if (options.all) {
|
|
7425
7666
|
cleaned = await sandboxService.cleanupAllSandboxes();
|
|
@@ -7469,12 +7710,12 @@ sessionCommand.command("config").description("Sandbox-Konfiguration verwalten").
|
|
|
7469
7710
|
});
|
|
7470
7711
|
|
|
7471
7712
|
// src/commands/github/github-cmd.ts
|
|
7472
|
-
import { Command as
|
|
7713
|
+
import { Command as Command16 } from "commander";
|
|
7473
7714
|
import { spawn as spawn5, spawnSync as spawnSync5 } from "child_process";
|
|
7474
7715
|
import * as fs5 from "fs";
|
|
7475
7716
|
import * as path5 from "path";
|
|
7476
7717
|
import inquirer6 from "inquirer";
|
|
7477
|
-
var githubCommand = new
|
|
7718
|
+
var githubCommand = new Command16("github").description("GitHub Integration verwalten").action(() => {
|
|
7478
7719
|
showStatus();
|
|
7479
7720
|
});
|
|
7480
7721
|
githubCommand.command("status").description("GitHub Verbindungsstatus anzeigen").action(() => {
|
|
@@ -8064,9 +8305,9 @@ githubCommand.command("mappings").description("Alle Branch-Session Mappings anze
|
|
|
8064
8305
|
});
|
|
8065
8306
|
|
|
8066
8307
|
// src/commands/github/issues.ts
|
|
8067
|
-
import { Command as
|
|
8068
|
-
import
|
|
8069
|
-
var issuesCommand = new
|
|
8308
|
+
import { Command as Command17 } from "commander";
|
|
8309
|
+
import ora12 from "ora";
|
|
8310
|
+
var issuesCommand = new Command17("issues").description("GitHub Issues \xFCber alle Projekte anzeigen").option("-m, --mine", "Nur mir zugewiesene Issues").option("-p, --project <name>", "Nur Issues eines Projekts").option("-a, --all", "Auch geschlossene Issues").option("-l, --limit <n>", "Maximale Anzahl pro Projekt", "10").option("--json", "JSON Output").action(withCommandErrorHandling("issues", async (options) => {
|
|
8070
8311
|
if (!isGhInstalled()) {
|
|
8071
8312
|
throw Errors.GITHUB_NOT_INSTALLED();
|
|
8072
8313
|
}
|
|
@@ -8074,7 +8315,7 @@ var issuesCommand = new Command16("issues").description("GitHub Issues \xFCber a
|
|
|
8074
8315
|
throw Errors.GITHUB_NOT_AUTHENTICATED();
|
|
8075
8316
|
}
|
|
8076
8317
|
const currentUser = getGhUser();
|
|
8077
|
-
const spinner =
|
|
8318
|
+
const spinner = ora12("Lade Issues...").start();
|
|
8078
8319
|
const allProjects = await getAllClaudeProjects();
|
|
8079
8320
|
let projects = allProjects;
|
|
8080
8321
|
if (options.project) {
|
|
@@ -8161,9 +8402,9 @@ var issuesCommand = new Command16("issues").description("GitHub Issues \xFCber a
|
|
|
8161
8402
|
}));
|
|
8162
8403
|
|
|
8163
8404
|
// src/commands/github/prs.ts
|
|
8164
|
-
import { Command as
|
|
8165
|
-
import
|
|
8166
|
-
var prsCommand = new
|
|
8405
|
+
import { Command as Command18 } from "commander";
|
|
8406
|
+
import ora13 from "ora";
|
|
8407
|
+
var prsCommand = new Command18("prs").description("GitHub Pull Requests \xFCber alle Projekte anzeigen").option("-m, --mine", "Nur meine PRs").option("-r, --review", "PRs wo ich Reviewer bin").option("-p, --project <name>", "Nur PRs eines Projekts").option("-l, --limit <n>", "Maximale Anzahl pro Projekt", "10").option("--json", "JSON Output").action(withCommandErrorHandling("prs", async (options) => {
|
|
8167
8408
|
if (!isGhInstalled()) {
|
|
8168
8409
|
throw Errors.GITHUB_NOT_INSTALLED();
|
|
8169
8410
|
}
|
|
@@ -8171,7 +8412,7 @@ var prsCommand = new Command17("prs").description("GitHub Pull Requests \xFCber
|
|
|
8171
8412
|
throw Errors.GITHUB_NOT_AUTHENTICATED();
|
|
8172
8413
|
}
|
|
8173
8414
|
const currentUser = getGhUser();
|
|
8174
|
-
const spinner =
|
|
8415
|
+
const spinner = ora13("Lade Pull Requests...").start();
|
|
8175
8416
|
const allProjects = await getAllClaudeProjects();
|
|
8176
8417
|
let projects = allProjects;
|
|
8177
8418
|
if (options.project) {
|
|
@@ -8282,10 +8523,10 @@ var prsCommand = new Command17("prs").description("GitHub Pull Requests \xFCber
|
|
|
8282
8523
|
}));
|
|
8283
8524
|
|
|
8284
8525
|
// src/commands/security/scan.ts
|
|
8285
|
-
import { Command as
|
|
8526
|
+
import { Command as Command19 } from "commander";
|
|
8286
8527
|
import { readFile } from "fs/promises";
|
|
8287
|
-
import { existsSync as
|
|
8288
|
-
import { join as join6, resolve as
|
|
8528
|
+
import { existsSync as existsSync13 } from "fs";
|
|
8529
|
+
import { join as join6, resolve as resolve8 } from "path";
|
|
8289
8530
|
|
|
8290
8531
|
// src/services/security/package-scanner.ts
|
|
8291
8532
|
import Conf3 from "conf";
|
|
@@ -9636,11 +9877,11 @@ async function parsePackageJson(filePath) {
|
|
|
9636
9877
|
if (pkg.devDependencies) {
|
|
9637
9878
|
packages.push(...Object.keys(pkg.devDependencies));
|
|
9638
9879
|
}
|
|
9639
|
-
const dir =
|
|
9880
|
+
const dir = resolve8(filePath, "..");
|
|
9640
9881
|
let manager = "npm";
|
|
9641
|
-
if (
|
|
9882
|
+
if (existsSync13(join6(dir, "pnpm-lock.yaml"))) {
|
|
9642
9883
|
manager = "pnpm";
|
|
9643
|
-
} else if (
|
|
9884
|
+
} else if (existsSync13(join6(dir, "yarn.lock"))) {
|
|
9644
9885
|
manager = "yarn";
|
|
9645
9886
|
}
|
|
9646
9887
|
return { packages, manager };
|
|
@@ -9694,7 +9935,7 @@ function displayConfig(config) {
|
|
|
9694
9935
|
log.keyValue("Blocklist entries", `${config.blocklist.length}`);
|
|
9695
9936
|
log.keyValue("Allowlist entries", `${config.allowlist.length}`);
|
|
9696
9937
|
}
|
|
9697
|
-
var scanCommand = new
|
|
9938
|
+
var scanCommand = new Command19("scan").description("Scanne Packages auf Sicherheitsrisiken").argument("[packages...]", "Package names to scan").option("-m, --manager <manager>", "Package manager (npm, pip, cargo)", "npm").option("-f, --file <file>", "Scan dependencies from file (package.json, requirements.txt, Cargo.toml)").option("-c, --command <command>", "Scan packages from install command").option("--project", "Scan all dependencies in current project").option("--hook-mode", "Output in hook format (JSON)").option("-j, --json", "Output as JSON").option("-v, --verbose", "Show detailed output").action(async (packages, options) => {
|
|
9698
9939
|
const config = packageScanner.getConfig();
|
|
9699
9940
|
if (!config.enabled && !options.hookMode) {
|
|
9700
9941
|
log.warn("Package scanning is disabled. Enable it with: shiva scan config --enable");
|
|
@@ -9703,8 +9944,8 @@ var scanCommand = new Command18("scan").description("Scanne Packages auf Sicherh
|
|
|
9703
9944
|
let packagesToScan = packages || [];
|
|
9704
9945
|
let manager = options.manager;
|
|
9705
9946
|
if (options.file) {
|
|
9706
|
-
const filePath =
|
|
9707
|
-
if (!
|
|
9947
|
+
const filePath = resolve8(options.file);
|
|
9948
|
+
if (!existsSync13(filePath)) {
|
|
9708
9949
|
log.error(`File not found: ${filePath}`);
|
|
9709
9950
|
process.exit(1);
|
|
9710
9951
|
}
|
|
@@ -9741,14 +9982,14 @@ var scanCommand = new Command18("scan").description("Scanne Packages auf Sicherh
|
|
|
9741
9982
|
}
|
|
9742
9983
|
if (options.project) {
|
|
9743
9984
|
const cwd = process.cwd();
|
|
9744
|
-
if (
|
|
9985
|
+
if (existsSync13(join6(cwd, "package.json"))) {
|
|
9745
9986
|
const parsed = await parsePackageJson(join6(cwd, "package.json"));
|
|
9746
9987
|
packagesToScan = parsed.packages;
|
|
9747
9988
|
manager = parsed.manager;
|
|
9748
|
-
} else if (
|
|
9989
|
+
} else if (existsSync13(join6(cwd, "requirements.txt"))) {
|
|
9749
9990
|
packagesToScan = await parseRequirementsTxt(join6(cwd, "requirements.txt"));
|
|
9750
9991
|
manager = "pip";
|
|
9751
|
-
} else if (
|
|
9992
|
+
} else if (existsSync13(join6(cwd, "Cargo.toml"))) {
|
|
9752
9993
|
packagesToScan = await parseCargoToml(join6(cwd, "Cargo.toml"));
|
|
9753
9994
|
manager = "cargo";
|
|
9754
9995
|
} else {
|
|
@@ -9791,7 +10032,7 @@ var scanCommand = new Command18("scan").description("Scanne Packages auf Sicherh
|
|
|
9791
10032
|
process.exit(1);
|
|
9792
10033
|
}
|
|
9793
10034
|
});
|
|
9794
|
-
var blocklistCommand = new
|
|
10035
|
+
var blocklistCommand = new Command19("blocklist").description("Verwalte Package-Blocklist").option("--add <package>", "Add package to blocklist").option("--remove <package>", "Remove package from blocklist").option("--reason <reason>", "Reason for blocking (used with --add)").option("-m, --manager <manager>", "Package manager", "npm").option("--list", "List all blocked packages").action(async (options) => {
|
|
9795
10036
|
const manager = options.manager;
|
|
9796
10037
|
if (options.add) {
|
|
9797
10038
|
const reason = options.reason || "Manually blocked";
|
|
@@ -9826,7 +10067,7 @@ var blocklistCommand = new Command18("blocklist").description("Verwalte Package-
|
|
|
9826
10067
|
log.plain(colors.dim(` Added: ${entry.addedAt} (${entry.source})`));
|
|
9827
10068
|
}
|
|
9828
10069
|
});
|
|
9829
|
-
var allowlistCommand = new
|
|
10070
|
+
var allowlistCommand = new Command19("allowlist").description("Verwalte Package-Allowlist").option("--add <package>", "Add package to allowlist").option("--remove <package>", "Remove package from allowlist").option("--list", "List all allowed packages").action(async (options) => {
|
|
9830
10071
|
if (options.add) {
|
|
9831
10072
|
packageScanner.addToAllowlist(options.add);
|
|
9832
10073
|
log.success(`Added "${options.add}" to allowlist`);
|
|
@@ -9852,7 +10093,7 @@ var allowlistCommand = new Command18("allowlist").description("Verwalte Package-
|
|
|
9852
10093
|
log.plain(`${colors.green("\u2713")} ${pkg}`);
|
|
9853
10094
|
}
|
|
9854
10095
|
});
|
|
9855
|
-
var configCommand2 = new
|
|
10096
|
+
var configCommand2 = new Command19("config").description("Konfiguriere Package-Scanning").option("--enable", "Enable package scanning").option("--disable", "Disable package scanning").option("--auto-block", "Enable auto-blocking of suspicious packages").option("--no-auto-block", "Disable auto-blocking").option("--min-downloads <n>", "Set minimum weekly downloads threshold", parseInt).option("--max-age <days>", "Set maximum age threshold in days", parseInt).option("--typosquat", "Enable typosquatting detection").option("--no-typosquat", "Disable typosquatting detection").option("--scripts", "Enable script analysis").option("--no-scripts", "Disable script analysis").option("--show", "Show current configuration").option("--reset", "Reset to defaults").action(async (options) => {
|
|
9856
10097
|
if (options.show) {
|
|
9857
10098
|
displayConfig(packageScanner.getConfig());
|
|
9858
10099
|
return;
|
|
@@ -9897,10 +10138,10 @@ scanCommand.addCommand(allowlistCommand);
|
|
|
9897
10138
|
scanCommand.addCommand(configCommand2);
|
|
9898
10139
|
|
|
9899
10140
|
// src/commands/security/security.ts
|
|
9900
|
-
import { Command as
|
|
10141
|
+
import { Command as Command20 } from "commander";
|
|
9901
10142
|
import inquirer7 from "inquirer";
|
|
9902
|
-
var securityCommand = new
|
|
9903
|
-
var permissionsCommand = new
|
|
10143
|
+
var securityCommand = new Command20("security").description("Sicherheitseinstellungen verwalten");
|
|
10144
|
+
var permissionsCommand = new Command20("permissions").description("Permission-Bypass konfigurieren").option("--skip", "Permissions \xFCberspringen (--dangerously-skip-permissions)").option("--no-skip", "Permissions nicht \xFCberspringen").option("--inherit", "Von globaler Einstellung erben").option("--block-tool <tool>", "Tool blockieren").option("--unblock-tool <tool>", "Tool-Block aufheben").option("--allow-path <path>", "Pfad erlauben").option("--block-path <path>", "Pfad blockieren").option("--status", "Aktuellen Status anzeigen").action(async (options) => {
|
|
9904
10145
|
const projectPath = process.cwd();
|
|
9905
10146
|
if (!hasShivaDir(projectPath)) {
|
|
9906
10147
|
initShivaDir(projectPath);
|
|
@@ -9972,7 +10213,7 @@ function displayPermissionsStatus(config) {
|
|
|
9972
10213
|
log.newline();
|
|
9973
10214
|
}
|
|
9974
10215
|
securityCommand.addCommand(permissionsCommand);
|
|
9975
|
-
var approvalCommand = new
|
|
10216
|
+
var approvalCommand = new Command20("approval").description("Plan-Approval-Strategie konfigurieren").argument("[strategy]", "Strategie: auto, manual, hybrid").option("--max-files <n>", "Max. Dateien f\xFCr Auto-Approval").option("--max-lines <n>", "Max. Zeilen f\xFCr Auto-Approval").option("--require <pattern>", "Pattern, das Approval erfordert").option("--skip <pattern>", "Pattern, das Approval \xFCberspringt").option("--remove-require <pattern>", "Require-Pattern entfernen").option("--remove-skip <pattern>", "Skip-Pattern entfernen").option("--status", "Aktuellen Status anzeigen").action(async (strategy, options) => {
|
|
9976
10217
|
const projectPath = process.cwd();
|
|
9977
10218
|
if (!hasShivaDir(projectPath)) {
|
|
9978
10219
|
initShivaDir(projectPath);
|
|
@@ -10309,7 +10550,7 @@ securityCommand.command("status").description("Sicherheitsstatus anzeigen").acti
|
|
|
10309
10550
|
displayPermissionsStatus(config.security.permissions);
|
|
10310
10551
|
displayApprovalStatus(config.security.approval);
|
|
10311
10552
|
});
|
|
10312
|
-
var tfaCommand = new
|
|
10553
|
+
var tfaCommand = new Command20("2fa").description("Zwei-Faktor-Authentifizierung").option("--enable", "2FA aktivieren").option("--disable", "2FA deaktivieren").option("--status", "Status anzeigen").option("--backup", "Neue Backup-Codes generieren").action(async (options) => {
|
|
10313
10554
|
if (!isAuthenticated()) {
|
|
10314
10555
|
log.error("Nicht angemeldet. Verwende: shiva login");
|
|
10315
10556
|
return;
|
|
@@ -10399,7 +10640,7 @@ var tfaCommand = new Command19("2fa").description("Zwei-Faktor-Authentifizierung
|
|
|
10399
10640
|
}
|
|
10400
10641
|
});
|
|
10401
10642
|
securityCommand.addCommand(tfaCommand);
|
|
10402
|
-
var devicesCommand = new
|
|
10643
|
+
var devicesCommand = new Command20("devices").description("Vertrauensw\xFCrdige Ger\xE4te verwalten").option("--list", "Ger\xE4te auflisten").option("--revoke <id>", "Ger\xE4t widerrufen").option("--revoke-all", "Alle Ger\xE4te widerrufen").action(async (options) => {
|
|
10403
10644
|
if (!isAuthenticated()) {
|
|
10404
10645
|
log.error("Nicht angemeldet. Verwende: shiva login");
|
|
10405
10646
|
return;
|
|
@@ -10449,13 +10690,13 @@ var devicesCommand = new Command19("devices").description("Vertrauensw\xFCrdige
|
|
|
10449
10690
|
securityCommand.addCommand(devicesCommand);
|
|
10450
10691
|
|
|
10451
10692
|
// src/commands/security/secrets.ts
|
|
10452
|
-
import { Command as
|
|
10693
|
+
import { Command as Command21 } from "commander";
|
|
10453
10694
|
import inquirer8 from "inquirer";
|
|
10454
|
-
import
|
|
10695
|
+
import ora14 from "ora";
|
|
10455
10696
|
import * as fs6 from "fs";
|
|
10456
10697
|
import * as path6 from "path";
|
|
10457
10698
|
var SECURE_FILE_MODE = 384;
|
|
10458
|
-
var secretsCommand = new
|
|
10699
|
+
var secretsCommand = new Command21("secrets").description("API Keys und Secrets verwalten (Cloud Vault)").action(async () => {
|
|
10459
10700
|
await listSecrets();
|
|
10460
10701
|
});
|
|
10461
10702
|
secretsCommand.command("list").alias("ls").description("Alle Secrets anzeigen").option("-p, --project <id>", "Nur Secrets f\xFCr Projekt").action(async (options) => {
|
|
@@ -10466,7 +10707,7 @@ async function listSecrets(projectId) {
|
|
|
10466
10707
|
log.errorWithSuggestion(Errors.NOT_AUTHENTICATED());
|
|
10467
10708
|
return;
|
|
10468
10709
|
}
|
|
10469
|
-
const spinner =
|
|
10710
|
+
const spinner = ora14("Lade Secrets...").start();
|
|
10470
10711
|
try {
|
|
10471
10712
|
const result = await api.listSecrets(projectId);
|
|
10472
10713
|
spinner.stop();
|
|
@@ -10564,7 +10805,7 @@ secretsCommand.command("add").description("Secret hinzuf\xFCgen").argument("<key
|
|
|
10564
10805
|
log.dim("Abgebrochen");
|
|
10565
10806
|
return;
|
|
10566
10807
|
}
|
|
10567
|
-
const spinner =
|
|
10808
|
+
const spinner = ora14("Speichere Secret...").start();
|
|
10568
10809
|
try {
|
|
10569
10810
|
await api.addSecret({
|
|
10570
10811
|
key,
|
|
@@ -10599,7 +10840,7 @@ secretsCommand.command("remove").alias("rm").alias("delete").description("Secret
|
|
|
10599
10840
|
return;
|
|
10600
10841
|
}
|
|
10601
10842
|
}
|
|
10602
|
-
const spinner =
|
|
10843
|
+
const spinner = ora14("L\xF6sche Secret...").start();
|
|
10603
10844
|
try {
|
|
10604
10845
|
await api.deleteSecret(key, options.project);
|
|
10605
10846
|
spinner.stop();
|
|
@@ -10638,7 +10879,7 @@ secretsCommand.command("get").description("Secret-Wert anzeigen (maskiert)").arg
|
|
|
10638
10879
|
return;
|
|
10639
10880
|
}
|
|
10640
10881
|
}
|
|
10641
|
-
const spinner =
|
|
10882
|
+
const spinner = ora14("Lade Secret...").start();
|
|
10642
10883
|
try {
|
|
10643
10884
|
const result = await api.getSecret(key, options.project);
|
|
10644
10885
|
spinner.stop();
|
|
@@ -10692,7 +10933,7 @@ secretsCommand.command("env").description("Secrets als .env Format ausgeben").op
|
|
|
10692
10933
|
log.dim("Abgebrochen");
|
|
10693
10934
|
return;
|
|
10694
10935
|
}
|
|
10695
|
-
const spinner =
|
|
10936
|
+
const spinner = ora14("Lade Secrets...").start();
|
|
10696
10937
|
try {
|
|
10697
10938
|
const secrets = await api.getSecretsForInjection(options.project);
|
|
10698
10939
|
spinner.stop();
|
|
@@ -10768,7 +11009,7 @@ secretsCommand.command("import").description(".env Datei in Vault importieren").
|
|
|
10768
11009
|
return;
|
|
10769
11010
|
}
|
|
10770
11011
|
}
|
|
10771
|
-
const spinner =
|
|
11012
|
+
const spinner = ora14("Importiere Secrets...").start();
|
|
10772
11013
|
let imported = 0;
|
|
10773
11014
|
let failed = 0;
|
|
10774
11015
|
for (const secret of secrets) {
|
|
@@ -10810,7 +11051,7 @@ secretsCommand.command("export").description("Secrets exportieren").option("-p,
|
|
|
10810
11051
|
log.dim("Abgebrochen");
|
|
10811
11052
|
return;
|
|
10812
11053
|
}
|
|
10813
|
-
const spinner =
|
|
11054
|
+
const spinner = ora14("Exportiere Secrets...").start();
|
|
10814
11055
|
try {
|
|
10815
11056
|
const secrets = await api.getSecretsForInjection(options.project);
|
|
10816
11057
|
spinner.stop();
|
|
@@ -10842,8 +11083,8 @@ secretsCommand.command("export").description("Secrets exportieren").option("-p,
|
|
|
10842
11083
|
});
|
|
10843
11084
|
|
|
10844
11085
|
// src/commands/memory/search.ts
|
|
10845
|
-
import { Command as
|
|
10846
|
-
import
|
|
11086
|
+
import { Command as Command22 } from "commander";
|
|
11087
|
+
import ora15 from "ora";
|
|
10847
11088
|
|
|
10848
11089
|
// src/services/data/memory.ts
|
|
10849
11090
|
import * as fs7 from "fs";
|
|
@@ -11129,8 +11370,8 @@ function escapeRegex(str) {
|
|
|
11129
11370
|
}
|
|
11130
11371
|
|
|
11131
11372
|
// src/commands/memory/search.ts
|
|
11132
|
-
var searchCommand = new
|
|
11133
|
-
const spinner =
|
|
11373
|
+
var searchCommand = new Command22("search").description("Memories \xFCber alle Projekte durchsuchen").argument("<query>", "Suchbegriff").option("-c, --category <category>", "Nach Kategorie filtern (general, preference, decision, context)").option("-p, --project <name>", "In bestimmtem Projekt suchen").option("-s, --source <source>", "Quelle: local, cloud, all (default: all)").option("-l, --limit <n>", "Max. Ergebnisse (default: 50)", "50").option("--case-sensitive", "Gro\xDF-/Kleinschreibung beachten").option("--json", "JSON Ausgabe").action(async (query, options) => {
|
|
11374
|
+
const spinner = ora15("Durchsuche Memories...").start();
|
|
11134
11375
|
try {
|
|
11135
11376
|
const result = await searchMemories(query, {
|
|
11136
11377
|
caseSensitive: options.caseSensitive,
|
|
@@ -11202,11 +11443,11 @@ function escapeRegex2(str) {
|
|
|
11202
11443
|
}
|
|
11203
11444
|
|
|
11204
11445
|
// src/commands/memory/forget.ts
|
|
11205
|
-
import { Command as
|
|
11446
|
+
import { Command as Command23 } from "commander";
|
|
11206
11447
|
import * as path8 from "path";
|
|
11207
11448
|
import inquirer9 from "inquirer";
|
|
11208
|
-
import
|
|
11209
|
-
var forgetCommand = new
|
|
11449
|
+
import ora16 from "ora";
|
|
11450
|
+
var forgetCommand = new Command23("forget").description("Memories l\xF6schen (GDPR)").argument("[key]", "Memory-Key zum L\xF6schen").option("-p, --project <path>", "Projekt-Pfad").option("--all", "Alle Memories eines Projekts l\xF6schen").option("--search <query>", "Memories nach Suchbegriff l\xF6schen").option("--local-only", "Nur lokal l\xF6schen").option("--cloud-only", "Nur aus Cloud l\xF6schen").option("-f, --force", "Ohne Best\xE4tigung l\xF6schen").option("--dry-run", "Nur anzeigen, was gel\xF6scht w\xFCrde").action(async (key, options) => {
|
|
11210
11451
|
log.newline();
|
|
11211
11452
|
console.log(colors.orange.bold("SHIVA Code - Forget"));
|
|
11212
11453
|
console.log(colors.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
@@ -11259,7 +11500,7 @@ async function handleDeleteAll(projectPath, options) {
|
|
|
11259
11500
|
return;
|
|
11260
11501
|
}
|
|
11261
11502
|
}
|
|
11262
|
-
const spinner =
|
|
11503
|
+
const spinner = ora16("L\xF6sche Memories...").start();
|
|
11263
11504
|
try {
|
|
11264
11505
|
const result = await deleteAllProjectMemories(projectPath);
|
|
11265
11506
|
spinner.succeed("Memories gel\xF6scht");
|
|
@@ -11273,7 +11514,7 @@ async function handleDeleteAll(projectPath, options) {
|
|
|
11273
11514
|
}
|
|
11274
11515
|
}
|
|
11275
11516
|
async function handleDeleteBySearch(query, projectPath, options) {
|
|
11276
|
-
const spinner =
|
|
11517
|
+
const spinner = ora16("Suche Memories...").start();
|
|
11277
11518
|
const result = await searchMemories(query, {
|
|
11278
11519
|
project: options.project ? projectPath : void 0
|
|
11279
11520
|
});
|
|
@@ -11308,7 +11549,7 @@ async function handleDeleteBySearch(query, projectPath, options) {
|
|
|
11308
11549
|
return;
|
|
11309
11550
|
}
|
|
11310
11551
|
}
|
|
11311
|
-
const deleteSpinner =
|
|
11552
|
+
const deleteSpinner = ora16("L\xF6sche Memories...").start();
|
|
11312
11553
|
let deleted = 0;
|
|
11313
11554
|
let failed = 0;
|
|
11314
11555
|
for (const memory of result.memories) {
|
|
@@ -11351,7 +11592,7 @@ async function handleDeleteKey(key, projectPath, options) {
|
|
|
11351
11592
|
return;
|
|
11352
11593
|
}
|
|
11353
11594
|
}
|
|
11354
|
-
const spinner =
|
|
11595
|
+
const spinner = ora16("L\xF6sche Memory...").start();
|
|
11355
11596
|
try {
|
|
11356
11597
|
const result = await deleteMemory(projectPath, key, {
|
|
11357
11598
|
localOnly: options.localOnly,
|
|
@@ -11374,7 +11615,7 @@ async function handleDeleteKey(key, projectPath, options) {
|
|
|
11374
11615
|
}
|
|
11375
11616
|
}
|
|
11376
11617
|
async function handleInteractiveDelete(projectPath, options) {
|
|
11377
|
-
const spinner =
|
|
11618
|
+
const spinner = ora16("Lade Memories...").start();
|
|
11378
11619
|
const memories = await getAllMemories();
|
|
11379
11620
|
spinner.stop();
|
|
11380
11621
|
if (memories.length === 0) {
|
|
@@ -11418,7 +11659,7 @@ async function handleInteractiveDelete(projectPath, options) {
|
|
|
11418
11659
|
return;
|
|
11419
11660
|
}
|
|
11420
11661
|
}
|
|
11421
|
-
const deleteSpinner =
|
|
11662
|
+
const deleteSpinner = ora16("L\xF6sche Memories...").start();
|
|
11422
11663
|
let deleted = 0;
|
|
11423
11664
|
let failed = 0;
|
|
11424
11665
|
for (const memory of selected) {
|
|
@@ -11447,18 +11688,18 @@ function truncate(str, maxLen) {
|
|
|
11447
11688
|
}
|
|
11448
11689
|
|
|
11449
11690
|
// src/commands/memory/context.ts
|
|
11450
|
-
import { Command as
|
|
11691
|
+
import { Command as Command24 } from "commander";
|
|
11451
11692
|
import * as path9 from "path";
|
|
11452
11693
|
import * as fs8 from "fs";
|
|
11453
|
-
import
|
|
11454
|
-
var contextCommand = new
|
|
11694
|
+
import ora17 from "ora";
|
|
11695
|
+
var contextCommand = new Command24("context").description("Zeigt was in Claude injected w\xFCrde").option("-d, --dir <path>", "Projektverzeichnis").option("--github", "GitHub Context einschlie\xDFen").option("--secrets", "Secret-Keys anzeigen").option("--raw", "Rohe CLAUDE.md Ausgabe").option("--json", "JSON Ausgabe").option("-s, --size", "Nur Gr\xF6\xDFe anzeigen").action(async (options) => {
|
|
11455
11696
|
const projectPath = options.dir ? path9.resolve(options.dir) : process.cwd();
|
|
11456
11697
|
const projectName = path9.basename(projectPath);
|
|
11457
11698
|
if (!fs8.existsSync(projectPath)) {
|
|
11458
11699
|
log.error(`Verzeichnis nicht gefunden: ${projectPath}`);
|
|
11459
11700
|
return;
|
|
11460
11701
|
}
|
|
11461
|
-
const spinner =
|
|
11702
|
+
const spinner = ora17("Sammle Context...").start();
|
|
11462
11703
|
try {
|
|
11463
11704
|
const preview = await getContextPreview(projectPath);
|
|
11464
11705
|
if (options.github) {
|
|
@@ -11642,9 +11883,9 @@ function formatGitHubContext(context) {
|
|
|
11642
11883
|
}
|
|
11643
11884
|
|
|
11644
11885
|
// src/commands/memory/tags.ts
|
|
11645
|
-
import { Command as
|
|
11886
|
+
import { Command as Command25 } from "commander";
|
|
11646
11887
|
import inquirer10 from "inquirer";
|
|
11647
|
-
var tagsCommand = new
|
|
11888
|
+
var tagsCommand = new Command25("tags").description("Session-Tags verwalten").action(async () => {
|
|
11648
11889
|
await listTags();
|
|
11649
11890
|
});
|
|
11650
11891
|
tagsCommand.command("list").alias("ls").description("Alle Tags anzeigen").action(async () => {
|
|
@@ -11843,8 +12084,8 @@ tagsCommand.command("cloud").description("Memory-Tags aus Cloud laden").option("
|
|
|
11843
12084
|
log.info("Anmelden mit: shiva login");
|
|
11844
12085
|
return;
|
|
11845
12086
|
}
|
|
11846
|
-
const
|
|
11847
|
-
const spinner =
|
|
12087
|
+
const ora25 = (await import("ora")).default;
|
|
12088
|
+
const spinner = ora25("Lade Memory-Tags aus Cloud...").start();
|
|
11848
12089
|
try {
|
|
11849
12090
|
const cloudTags = await api2.getMemoryTags();
|
|
11850
12091
|
spinner.stop();
|
|
@@ -11871,10 +12112,10 @@ tagsCommand.command("cloud").description("Memory-Tags aus Cloud laden").option("
|
|
|
11871
12112
|
});
|
|
11872
12113
|
|
|
11873
12114
|
// src/commands/memory/export.ts
|
|
11874
|
-
import { Command as
|
|
12115
|
+
import { Command as Command26 } from "commander";
|
|
11875
12116
|
import * as path11 from "path";
|
|
11876
12117
|
import * as fs10 from "fs";
|
|
11877
|
-
import
|
|
12118
|
+
import ora18 from "ora";
|
|
11878
12119
|
import inquirer11 from "inquirer";
|
|
11879
12120
|
|
|
11880
12121
|
// src/services/session/export.ts
|
|
@@ -12126,7 +12367,7 @@ function previewExportFile(filepath) {
|
|
|
12126
12367
|
}
|
|
12127
12368
|
|
|
12128
12369
|
// src/commands/memory/export.ts
|
|
12129
|
-
var exportCommand = new
|
|
12370
|
+
var exportCommand = new Command26("export").description("Sessions exportieren").argument("[session-id]", "Session ID (optional)").option("-o, --output <path>", "Ausgabedatei/-verzeichnis").option("-p, --project <name>", "Alle Sessions eines Projekts exportieren").option("-t, --transcript", "Transkript einschlie\xDFen").option("-c, --conversation", "Parsed Conversation einschlie\xDFen").option("--backup", "Vollst\xE4ndiges Backup erstellen (tar.gz)").option("--all", "Alle Sessions exportieren").action(async (sessionId, options) => {
|
|
12130
12371
|
log.newline();
|
|
12131
12372
|
console.log(colors.orange.bold("SHIVA Code - Export"));
|
|
12132
12373
|
console.log(colors.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
@@ -12153,7 +12394,7 @@ var exportCommand = new Command25("export").description("Sessions exportieren").
|
|
|
12153
12394
|
}
|
|
12154
12395
|
await handleInteractiveExport(exportOptions);
|
|
12155
12396
|
});
|
|
12156
|
-
var importCommand = new
|
|
12397
|
+
var importCommand = new Command26("import").description("Sessions importieren").argument("<path>", "Import-Datei oder Verzeichnis").option("-p, --project <path>", "Ziel-Projektpfad").option("--preview", "Nur Vorschau, nicht importieren").option("--restore", "Backup-Archiv wiederherstellen").action(async (inputPath, options) => {
|
|
12157
12398
|
log.newline();
|
|
12158
12399
|
console.log(colors.orange.bold("SHIVA Code - Import"));
|
|
12159
12400
|
console.log(colors.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
|
|
@@ -12179,7 +12420,7 @@ var importCommand = new Command25("import").description("Sessions importieren").
|
|
|
12179
12420
|
}
|
|
12180
12421
|
});
|
|
12181
12422
|
async function handleBackup(outputPath) {
|
|
12182
|
-
const spinner =
|
|
12423
|
+
const spinner = ora18("Erstelle Backup...").start();
|
|
12183
12424
|
const filename = `shiva-backup-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.tar.gz`;
|
|
12184
12425
|
const output = outputPath || path11.join(process.cwd(), filename);
|
|
12185
12426
|
const success = createBackupArchive(output);
|
|
@@ -12192,7 +12433,7 @@ async function handleBackup(outputPath) {
|
|
|
12192
12433
|
}
|
|
12193
12434
|
}
|
|
12194
12435
|
async function handleExportAll(outputDir, options = {}) {
|
|
12195
|
-
const spinner =
|
|
12436
|
+
const spinner = ora18("Lade Sessions...").start();
|
|
12196
12437
|
const projects = await getAllClaudeProjects();
|
|
12197
12438
|
const allSessionIds = projects.flatMap((p) => p.sessions.map((s) => s.sessionId));
|
|
12198
12439
|
if (allSessionIds.length === 0) {
|
|
@@ -12210,7 +12451,7 @@ async function handleExportAll(outputDir, options = {}) {
|
|
|
12210
12451
|
log.dim(`Verzeichnis: ${output}`);
|
|
12211
12452
|
}
|
|
12212
12453
|
async function handleExportProject(projectName, outputDir, options = {}) {
|
|
12213
|
-
const spinner =
|
|
12454
|
+
const spinner = ora18("Suche Projekt...").start();
|
|
12214
12455
|
const projects = await getAllClaudeProjects();
|
|
12215
12456
|
const project = projects.find(
|
|
12216
12457
|
(p) => p.projectName.toLowerCase() === projectName.toLowerCase() || p.absolutePath.includes(projectName)
|
|
@@ -12231,7 +12472,7 @@ async function handleExportProject(projectName, outputDir, options = {}) {
|
|
|
12231
12472
|
log.dim(`Verzeichnis: ${output}`);
|
|
12232
12473
|
}
|
|
12233
12474
|
async function handleExportSession(sessionId, outputPath, options = {}) {
|
|
12234
|
-
const spinner =
|
|
12475
|
+
const spinner = ora18("Exportiere Session...").start();
|
|
12235
12476
|
const output = outputPath || `session-${sessionId.slice(0, 8)}.json`;
|
|
12236
12477
|
const success = await exportSessionToFile(sessionId, output, options);
|
|
12237
12478
|
if (success) {
|
|
@@ -12271,7 +12512,7 @@ async function handleInteractiveExport(options = {}) {
|
|
|
12271
12512
|
await handleExportSession(selectedSession, void 0, options);
|
|
12272
12513
|
}
|
|
12273
12514
|
async function handleImportFile(filepath, targetProject) {
|
|
12274
|
-
const spinner =
|
|
12515
|
+
const spinner = ora18("Importiere Session...").start();
|
|
12275
12516
|
const result = await importSessionFromFile(filepath, targetProject);
|
|
12276
12517
|
if (result.success) {
|
|
12277
12518
|
spinner.succeed(result.message);
|
|
@@ -12286,7 +12527,7 @@ async function handleImportFile(filepath, targetProject) {
|
|
|
12286
12527
|
}
|
|
12287
12528
|
}
|
|
12288
12529
|
async function handleImportDirectory(dirPath, targetProject) {
|
|
12289
|
-
const spinner =
|
|
12530
|
+
const spinner = ora18("Importiere Sessions...").start();
|
|
12290
12531
|
const result = await importSessionsFromDirectory(dirPath, targetProject);
|
|
12291
12532
|
spinner.succeed(`Import abgeschlossen`);
|
|
12292
12533
|
log.info(`${result.success} Sessions importiert`);
|
|
@@ -12305,7 +12546,7 @@ async function handleRestore(archivePath, targetDir) {
|
|
|
12305
12546
|
log.dim("Abgebrochen");
|
|
12306
12547
|
return;
|
|
12307
12548
|
}
|
|
12308
|
-
const spinner =
|
|
12549
|
+
const spinner = ora18("Stelle Backup wieder her...").start();
|
|
12309
12550
|
const success = restoreFromArchive(archivePath, targetDir);
|
|
12310
12551
|
if (success) {
|
|
12311
12552
|
spinner.succeed("Backup wiederhergestellt");
|
|
@@ -12345,8 +12586,8 @@ async function handlePreview(filepath) {
|
|
|
12345
12586
|
}
|
|
12346
12587
|
|
|
12347
12588
|
// src/commands/memory/remember.ts
|
|
12348
|
-
import { Command as
|
|
12349
|
-
var rememberCommand = new
|
|
12589
|
+
import { Command as Command27 } from "commander";
|
|
12590
|
+
var rememberCommand = new Command27("remember").description("Memory in der Cloud speichern").argument("<text>", "Der Text der gespeichert werden soll").option("-k, --key <key>", "Schl\xFCssel/Titel f\xFCr die Memory").option("-c, --category <category>", "Kategorie (context, learning, preference, fact)", "fact").action(async (text, options) => {
|
|
12350
12591
|
if (!isAuthenticated()) {
|
|
12351
12592
|
log.error("Nicht angemeldet");
|
|
12352
12593
|
log.info("Anmelden mit: shiva login");
|
|
@@ -12378,7 +12619,7 @@ var rememberCommand = new Command26("remember").description("Memory in der Cloud
|
|
|
12378
12619
|
});
|
|
12379
12620
|
|
|
12380
12621
|
// src/commands/system/doctor.ts
|
|
12381
|
-
import { Command as
|
|
12622
|
+
import { Command as Command28 } from "commander";
|
|
12382
12623
|
import { execSync as execSync3 } from "child_process";
|
|
12383
12624
|
import * as fs11 from "fs";
|
|
12384
12625
|
import * as path12 from "path";
|
|
@@ -12636,7 +12877,7 @@ function printResult(result) {
|
|
|
12636
12877
|
console.log(` ${colors.dim("\u2192")} ${colors.dim(result.hint)}`);
|
|
12637
12878
|
}
|
|
12638
12879
|
}
|
|
12639
|
-
var doctorCommand = new
|
|
12880
|
+
var doctorCommand = new Command28("doctor").description("System-Check f\xFCr SHIVA und Claude Code").option("-v, --verbose", "Zeige zus\xE4tzliche Details").option("-j, --json", "Ausgabe als JSON").action(async (options) => {
|
|
12640
12881
|
if (!options.json) {
|
|
12641
12882
|
log.newline();
|
|
12642
12883
|
console.log(colors.orange.bold("\u{1F3E5} SHIVA Doctor - System Health Check"));
|
|
@@ -12705,7 +12946,7 @@ var doctorCommand = new Command27("doctor").description("System-Check f\xFCr SHI
|
|
|
12705
12946
|
});
|
|
12706
12947
|
|
|
12707
12948
|
// src/commands/system/upgrade.ts
|
|
12708
|
-
import { Command as
|
|
12949
|
+
import { Command as Command29 } from "commander";
|
|
12709
12950
|
import { execSync as execSync4, spawn as spawn6 } from "child_process";
|
|
12710
12951
|
import * as fs12 from "fs";
|
|
12711
12952
|
import * as path13 from "path";
|
|
@@ -12794,7 +13035,7 @@ function getUpgradeCommand(pm) {
|
|
|
12794
13035
|
async function runUpgrade(pm) {
|
|
12795
13036
|
const command = getUpgradeCommand(pm);
|
|
12796
13037
|
const [cmd, ...args] = command.split(" ");
|
|
12797
|
-
return new Promise((
|
|
13038
|
+
return new Promise((resolve14) => {
|
|
12798
13039
|
log.info(`F\xFChre aus: ${command}`);
|
|
12799
13040
|
log.newline();
|
|
12800
13041
|
const proc = spawn6(cmd, args, {
|
|
@@ -12802,14 +13043,14 @@ async function runUpgrade(pm) {
|
|
|
12802
13043
|
shell: true
|
|
12803
13044
|
});
|
|
12804
13045
|
proc.on("close", (code) => {
|
|
12805
|
-
|
|
13046
|
+
resolve14(code === 0);
|
|
12806
13047
|
});
|
|
12807
13048
|
proc.on("error", () => {
|
|
12808
|
-
|
|
13049
|
+
resolve14(false);
|
|
12809
13050
|
});
|
|
12810
13051
|
});
|
|
12811
13052
|
}
|
|
12812
|
-
var upgradeCommand = new
|
|
13053
|
+
var upgradeCommand = new Command29("upgrade").description("SHIVA CLI aktualisieren").option("-c, --check", "Nur auf Updates pr\xFCfen, nicht installieren").option("-f, --force", "Update erzwingen, auch wenn aktuell").option("--npm", "npm verwenden").option("--yarn", "yarn verwenden").option("--pnpm", "pnpm verwenden").action(async (options) => {
|
|
12813
13054
|
log.newline();
|
|
12814
13055
|
console.log(colors.orange.bold("\u{1F680} SHIVA Upgrade"));
|
|
12815
13056
|
log.newline();
|
|
@@ -12854,12 +13095,12 @@ var upgradeCommand = new Command28("upgrade").description("SHIVA CLI aktualisier
|
|
|
12854
13095
|
log.plain(` ${getUpgradeCommand(pm)}`);
|
|
12855
13096
|
}
|
|
12856
13097
|
});
|
|
12857
|
-
var selfUpdateCommand = new
|
|
13098
|
+
var selfUpdateCommand = new Command29("self-update").description('Alias f\xFCr "shiva upgrade"').action(async () => {
|
|
12858
13099
|
await upgradeCommand.parseAsync(["upgrade"], { from: "user" });
|
|
12859
13100
|
});
|
|
12860
13101
|
|
|
12861
13102
|
// src/commands/system/telemetry.ts
|
|
12862
|
-
import { Command as
|
|
13103
|
+
import { Command as Command30 } from "commander";
|
|
12863
13104
|
import Conf4 from "conf";
|
|
12864
13105
|
var telemetryConfig = new Conf4({
|
|
12865
13106
|
projectName: "shiva-code",
|
|
@@ -12895,7 +13136,7 @@ var DATA_NOT_COLLECTED = [
|
|
|
12895
13136
|
"Pers\xF6nliche Daten oder IP-Adressen",
|
|
12896
13137
|
"Code oder Datei-Inhalte"
|
|
12897
13138
|
];
|
|
12898
|
-
var telemetryCommand = new
|
|
13139
|
+
var telemetryCommand = new Command30("telemetry").description("Telemetrie/Analytics verwalten").option("--enable", "Telemetrie aktivieren (opt-in)").option("--disable", "Telemetrie deaktivieren (opt-out)").option("--status", "Aktuellen Status anzeigen").option("-j, --json", "Ausgabe als JSON").action((options) => {
|
|
12899
13140
|
const isEnabled = telemetryConfig.get("enabled");
|
|
12900
13141
|
const optInAt = telemetryConfig.get("optInAt");
|
|
12901
13142
|
const optOutAt = telemetryConfig.get("optOutAt");
|
|
@@ -12986,8 +13227,8 @@ var telemetryCommand = new Command29("telemetry").description("Telemetrie/Analyt
|
|
|
12986
13227
|
});
|
|
12987
13228
|
|
|
12988
13229
|
// src/commands/system/completions.ts
|
|
12989
|
-
import { Command as
|
|
12990
|
-
var completionsCommand = new
|
|
13230
|
+
import { Command as Command31 } from "commander";
|
|
13231
|
+
var completionsCommand = new Command31("completions").description("Shell-Completion-Skripte generieren").argument("[shell]", "Shell-Typ: bash, zsh, fish").option("--install", "Direkt installieren (nur bash/zsh)").action(async (shell, options) => {
|
|
12991
13232
|
if (!shell) {
|
|
12992
13233
|
log.newline();
|
|
12993
13234
|
console.log(colors.orange.bold("SHIVA Code - Shell Completions"));
|
|
@@ -13382,10 +13623,10 @@ async function installFishCompletion() {
|
|
|
13382
13623
|
}
|
|
13383
13624
|
|
|
13384
13625
|
// src/commands/system/stats.ts
|
|
13385
|
-
import { Command as
|
|
13386
|
-
import
|
|
13387
|
-
var statsCommand = new
|
|
13388
|
-
const spinner =
|
|
13626
|
+
import { Command as Command32 } from "commander";
|
|
13627
|
+
import ora19 from "ora";
|
|
13628
|
+
var statsCommand = new Command32("stats").description("Session-Statistiken und Analytics anzeigen").option("-d, --days <n>", "Zeitraum in Tagen", "30").option("--json", "JSON Output").action(async (options) => {
|
|
13629
|
+
const spinner = ora19("Sammle Statistiken...").start();
|
|
13389
13630
|
try {
|
|
13390
13631
|
const projects = await getAllClaudeProjects();
|
|
13391
13632
|
const days = parseInt(options.days, 10) || 30;
|
|
@@ -13546,7 +13787,7 @@ statsCommand.command("sessions").description("Session Analytics (Pro Feature)").
|
|
|
13546
13787
|
log.info("Anmelden mit: shiva login");
|
|
13547
13788
|
return;
|
|
13548
13789
|
}
|
|
13549
|
-
const spinner =
|
|
13790
|
+
const spinner = ora19("Lade Session Analytics...").start();
|
|
13550
13791
|
try {
|
|
13551
13792
|
const analytics = await api2.getSessionAnalytics();
|
|
13552
13793
|
spinner.stop();
|
|
@@ -13598,7 +13839,7 @@ statsCommand.command("tokens").description("Token Usage Analytics (Pro Feature)"
|
|
|
13598
13839
|
log.info("Anmelden mit: shiva login");
|
|
13599
13840
|
return;
|
|
13600
13841
|
}
|
|
13601
|
-
const spinner =
|
|
13842
|
+
const spinner = ora19("Lade Token Analytics...").start();
|
|
13602
13843
|
try {
|
|
13603
13844
|
const analytics = await api2.getTokenAnalytics();
|
|
13604
13845
|
spinner.stop();
|
|
@@ -13646,7 +13887,7 @@ statsCommand.command("tools").description("Tool Usage Analytics (Pro Feature)").
|
|
|
13646
13887
|
log.info("Anmelden mit: shiva login");
|
|
13647
13888
|
return;
|
|
13648
13889
|
}
|
|
13649
|
-
const spinner =
|
|
13890
|
+
const spinner = ora19("Lade Tool Analytics...").start();
|
|
13650
13891
|
try {
|
|
13651
13892
|
const analytics = await api2.getToolAnalytics();
|
|
13652
13893
|
spinner.stop();
|
|
@@ -13691,7 +13932,7 @@ statsCommand.command("export").description("Analytics-Daten exportieren (Pro Fea
|
|
|
13691
13932
|
log.info("Anmelden mit: shiva login");
|
|
13692
13933
|
return;
|
|
13693
13934
|
}
|
|
13694
|
-
const spinner =
|
|
13935
|
+
const spinner = ora19("Exportiere Analytics...").start();
|
|
13695
13936
|
try {
|
|
13696
13937
|
const result = await api2.exportAnalytics({
|
|
13697
13938
|
startDate: options.start,
|
|
@@ -13742,16 +13983,16 @@ statsCommand.command("track").description("Analytics Event tracken").argument("<
|
|
|
13742
13983
|
});
|
|
13743
13984
|
|
|
13744
13985
|
// src/commands/system/user.ts
|
|
13745
|
-
import { Command as
|
|
13746
|
-
import
|
|
13747
|
-
var userCommand = new
|
|
13986
|
+
import { Command as Command33 } from "commander";
|
|
13987
|
+
import ora20 from "ora";
|
|
13988
|
+
var userCommand = new Command33("user").description("User Account Verwaltung");
|
|
13748
13989
|
userCommand.command("profile").description("User-Profil anzeigen").option("--json", "JSON Output").action(async (options) => {
|
|
13749
13990
|
if (!isAuthenticated()) {
|
|
13750
13991
|
log.error("Nicht angemeldet");
|
|
13751
13992
|
log.info("Anmelden mit: shiva login");
|
|
13752
13993
|
return;
|
|
13753
13994
|
}
|
|
13754
|
-
const spinner =
|
|
13995
|
+
const spinner = ora20("Lade Profil...").start();
|
|
13755
13996
|
try {
|
|
13756
13997
|
const profile = await api.getUserProfile();
|
|
13757
13998
|
spinner.stop();
|
|
@@ -13788,7 +14029,7 @@ userCommand.command("update").description("User-Profil aktualisieren").option("-
|
|
|
13788
14029
|
log.plain(" --name <name> Name setzen");
|
|
13789
14030
|
return;
|
|
13790
14031
|
}
|
|
13791
|
-
const spinner =
|
|
14032
|
+
const spinner = ora20("Aktualisiere Profil...").start();
|
|
13792
14033
|
try {
|
|
13793
14034
|
const result = await api.updateUserProfile({
|
|
13794
14035
|
name: options.name
|
|
@@ -13809,7 +14050,7 @@ userCommand.command("usage").description("Resource-Nutzung und Limits anzeigen")
|
|
|
13809
14050
|
log.info("Anmelden mit: shiva login");
|
|
13810
14051
|
return;
|
|
13811
14052
|
}
|
|
13812
|
-
const spinner =
|
|
14053
|
+
const spinner = ora20("Lade Usage...").start();
|
|
13813
14054
|
try {
|
|
13814
14055
|
const usage = await api.getUserUsage();
|
|
13815
14056
|
spinner.stop();
|
|
@@ -13852,7 +14093,7 @@ userCommand.command("subscription").description("Subscription-Status anzeigen").
|
|
|
13852
14093
|
log.info("Anmelden mit: shiva login");
|
|
13853
14094
|
return;
|
|
13854
14095
|
}
|
|
13855
|
-
const spinner =
|
|
14096
|
+
const spinner = ora20("Lade Subscription...").start();
|
|
13856
14097
|
try {
|
|
13857
14098
|
const sub = await api.getSubscription();
|
|
13858
14099
|
spinner.stop();
|
|
@@ -13912,7 +14153,7 @@ userCommand.command("token").description("Neuen CLI-Token generieren").option("-
|
|
|
13912
14153
|
log.dim("Abgebrochen");
|
|
13913
14154
|
return;
|
|
13914
14155
|
}
|
|
13915
|
-
const spinner =
|
|
14156
|
+
const spinner = ora20("Generiere Token...").start();
|
|
13916
14157
|
try {
|
|
13917
14158
|
const result = await api.generateCliToken();
|
|
13918
14159
|
spinner.stop();
|
|
@@ -13977,7 +14218,7 @@ userCommand.command("delete").description("Account unwiderruflich l\xF6schen").a
|
|
|
13977
14218
|
log.dim("Abgebrochen (falscher Best\xE4tigungstext)");
|
|
13978
14219
|
return;
|
|
13979
14220
|
}
|
|
13980
|
-
const spinner =
|
|
14221
|
+
const spinner = ora20("L\xF6sche Account...").start();
|
|
13981
14222
|
try {
|
|
13982
14223
|
const result = await api.deleteAccount("DELETE");
|
|
13983
14224
|
if (result.success) {
|
|
@@ -14019,9 +14260,9 @@ userCommand.command("whoami").description("Aktuelle Anmeldung anzeigen").action(
|
|
|
14019
14260
|
});
|
|
14020
14261
|
|
|
14021
14262
|
// src/commands/advanced/docker.ts
|
|
14022
|
-
import { Command as
|
|
14023
|
-
import
|
|
14024
|
-
var dockerCommand = new
|
|
14263
|
+
import { Command as Command34 } from "commander";
|
|
14264
|
+
import ora21 from "ora";
|
|
14265
|
+
var dockerCommand = new Command34("docker").description("Docker-Integration verwalten");
|
|
14025
14266
|
dockerCommand.command("status").description("Docker-Verf\xFCgbarkeit pr\xFCfen").action(() => {
|
|
14026
14267
|
log.brand();
|
|
14027
14268
|
log.header("Docker Status");
|
|
@@ -14086,7 +14327,7 @@ dockerCommand.command("enable").description("Docker-Modus aktivieren").action(as
|
|
|
14086
14327
|
return;
|
|
14087
14328
|
}
|
|
14088
14329
|
const image = dockerService.getDefaultImage();
|
|
14089
|
-
const spinner =
|
|
14330
|
+
const spinner = ora21(`Pr\xFCfe Image: ${image}...`).start();
|
|
14090
14331
|
if (!dockerService.imageExists(image)) {
|
|
14091
14332
|
spinner.text = `Lade Image herunter: ${image}...`;
|
|
14092
14333
|
try {
|
|
@@ -14145,7 +14386,7 @@ dockerCommand.command("logs").description("Container-Logs anzeigen").argument("<
|
|
|
14145
14386
|
console.log(logs);
|
|
14146
14387
|
});
|
|
14147
14388
|
dockerCommand.command("stop").description("Container stoppen").argument("<name>", "Container-Name oder ID").action(async (name) => {
|
|
14148
|
-
const spinner =
|
|
14389
|
+
const spinner = ora21(`Stoppe Container ${name}...`).start();
|
|
14149
14390
|
try {
|
|
14150
14391
|
await dockerService.stopContainer(name);
|
|
14151
14392
|
spinner.succeed(`Container gestoppt: ${name}`);
|
|
@@ -14155,7 +14396,7 @@ dockerCommand.command("stop").description("Container stoppen").argument("<name>"
|
|
|
14155
14396
|
}
|
|
14156
14397
|
});
|
|
14157
14398
|
dockerCommand.command("clean").description("Gestoppte Container aufr\xE4umen").action(async () => {
|
|
14158
|
-
const spinner =
|
|
14399
|
+
const spinner = ora21("R\xE4ume Container auf...").start();
|
|
14159
14400
|
try {
|
|
14160
14401
|
const count = await dockerService.cleanContainers();
|
|
14161
14402
|
spinner.succeed(`${count} Container entfernt`);
|
|
@@ -14166,7 +14407,7 @@ dockerCommand.command("clean").description("Gestoppte Container aufr\xE4umen").a
|
|
|
14166
14407
|
});
|
|
14167
14408
|
dockerCommand.command("pull").description("Docker-Image herunterladen").argument("[image]", "Image-Name (default: shiva/claude-runner:latest)").action(async (image) => {
|
|
14168
14409
|
const targetImage = image || dockerService.getDefaultImage();
|
|
14169
|
-
const spinner =
|
|
14410
|
+
const spinner = ora21(`Lade Image herunter: ${targetImage}...`).start();
|
|
14170
14411
|
try {
|
|
14171
14412
|
await dockerService.pullImage(targetImage);
|
|
14172
14413
|
spinner.succeed(`Image heruntergeladen: ${targetImage}`);
|
|
@@ -14251,11 +14492,11 @@ dockerCommand.action(() => {
|
|
|
14251
14492
|
});
|
|
14252
14493
|
|
|
14253
14494
|
// src/commands/advanced/workflow.ts
|
|
14254
|
-
import { Command as
|
|
14495
|
+
import { Command as Command35 } from "commander";
|
|
14255
14496
|
import * as fs13 from "fs";
|
|
14256
14497
|
import * as path14 from "path";
|
|
14257
14498
|
import * as os6 from "os";
|
|
14258
|
-
import
|
|
14499
|
+
import ora22 from "ora";
|
|
14259
14500
|
import inquirer12 from "inquirer";
|
|
14260
14501
|
var builtInWorkflows = {
|
|
14261
14502
|
morning: {
|
|
@@ -14275,7 +14516,7 @@ var builtInWorkflows = {
|
|
|
14275
14516
|
]
|
|
14276
14517
|
}
|
|
14277
14518
|
};
|
|
14278
|
-
var workflowCommand = new
|
|
14519
|
+
var workflowCommand = new Command35("workflow").description("Automatisierte Workflows ausf\xFChren").action(async () => {
|
|
14279
14520
|
await listWorkflows();
|
|
14280
14521
|
});
|
|
14281
14522
|
workflowCommand.command("list").alias("ls").description("Verf\xFCgbare Workflows anzeigen").action(async () => {
|
|
@@ -14444,7 +14685,7 @@ function deleteCustomWorkflow(name) {
|
|
|
14444
14685
|
fs13.writeFileSync(filepath, JSON.stringify(workflows, null, 2));
|
|
14445
14686
|
}
|
|
14446
14687
|
async function executeStep(step) {
|
|
14447
|
-
const spinner =
|
|
14688
|
+
const spinner = ora22("Ausf\xFChren...").start();
|
|
14448
14689
|
try {
|
|
14449
14690
|
switch (step.type) {
|
|
14450
14691
|
case "issues": {
|
|
@@ -14530,17 +14771,17 @@ async function executeStep(step) {
|
|
|
14530
14771
|
}
|
|
14531
14772
|
|
|
14532
14773
|
// src/commands/advanced/hook.ts
|
|
14533
|
-
import { Command as
|
|
14534
|
-
import { existsSync as
|
|
14774
|
+
import { Command as Command36 } from "commander";
|
|
14775
|
+
import { existsSync as existsSync22, readFileSync as readFileSync12, writeFileSync as writeFileSync10, mkdirSync as mkdirSync6 } from "fs";
|
|
14535
14776
|
import { homedir as homedir7 } from "os";
|
|
14536
14777
|
import { join as join12 } from "path";
|
|
14537
14778
|
var CLAUDE_SETTINGS_PATH = join12(homedir7(), ".claude", "settings.json");
|
|
14538
14779
|
function getClaudeSettings() {
|
|
14539
|
-
if (!
|
|
14780
|
+
if (!existsSync22(CLAUDE_SETTINGS_PATH)) {
|
|
14540
14781
|
return {};
|
|
14541
14782
|
}
|
|
14542
14783
|
try {
|
|
14543
|
-
const content =
|
|
14784
|
+
const content = readFileSync12(CLAUDE_SETTINGS_PATH, "utf-8");
|
|
14544
14785
|
return JSON.parse(content);
|
|
14545
14786
|
} catch {
|
|
14546
14787
|
return {};
|
|
@@ -14548,7 +14789,7 @@ function getClaudeSettings() {
|
|
|
14548
14789
|
}
|
|
14549
14790
|
function saveClaudeSettings(settings) {
|
|
14550
14791
|
const dir = join12(homedir7(), ".claude");
|
|
14551
|
-
if (!
|
|
14792
|
+
if (!existsSync22(dir)) {
|
|
14552
14793
|
mkdirSync6(dir, { recursive: true });
|
|
14553
14794
|
}
|
|
14554
14795
|
writeFileSync10(CLAUDE_SETTINGS_PATH, JSON.stringify(settings, null, 2));
|
|
@@ -14565,11 +14806,11 @@ function removeShivaHooks(eventHooks) {
|
|
|
14565
14806
|
(entry) => !entry.hooks?.some((h) => h.command?.includes("shiva"))
|
|
14566
14807
|
);
|
|
14567
14808
|
}
|
|
14568
|
-
var hookCommand = new
|
|
14809
|
+
var hookCommand = new Command36("hook").description("Claude Code Hook Integration verwalten");
|
|
14569
14810
|
hookCommand.command("install").description("SHIVA Hooks in Claude Code installieren").option("--github", "GitHub Context Injection aktivieren").option("--sync", "Cloud Sync Hooks aktivieren (Standard)").option("--scan", "Package Security Scanning aktivieren").option("--all", "Alle Hooks aktivieren").action((options) => {
|
|
14570
14811
|
log.brand();
|
|
14571
14812
|
const claudePath = join12(homedir7(), ".claude");
|
|
14572
|
-
if (!
|
|
14813
|
+
if (!existsSync22(claudePath)) {
|
|
14573
14814
|
log.error("Claude Code nicht gefunden");
|
|
14574
14815
|
log.newline();
|
|
14575
14816
|
log.info("Installiere Claude Code:");
|
|
@@ -14987,8 +15228,8 @@ hookCommand.command("cloud-list").description("Cloud-Hooks auflisten").option("-
|
|
|
14987
15228
|
log.info("Anmelden mit: shiva login");
|
|
14988
15229
|
return;
|
|
14989
15230
|
}
|
|
14990
|
-
const
|
|
14991
|
-
const spinner =
|
|
15231
|
+
const ora25 = (await import("ora")).default;
|
|
15232
|
+
const spinner = ora25("Lade Cloud-Hooks...").start();
|
|
14992
15233
|
try {
|
|
14993
15234
|
let hooks;
|
|
14994
15235
|
if (options.event) {
|
|
@@ -15035,8 +15276,8 @@ hookCommand.command("cloud-create").description("Neuen Cloud-Hook erstellen").re
|
|
|
15035
15276
|
log.info("Anmelden mit: shiva login");
|
|
15036
15277
|
return;
|
|
15037
15278
|
}
|
|
15038
|
-
const
|
|
15039
|
-
const spinner =
|
|
15279
|
+
const ora25 = (await import("ora")).default;
|
|
15280
|
+
const spinner = ora25("Erstelle Cloud-Hook...").start();
|
|
15040
15281
|
try {
|
|
15041
15282
|
const result = await api2.createHook({
|
|
15042
15283
|
event: options.event,
|
|
@@ -15064,8 +15305,8 @@ hookCommand.command("cloud-test").description("Cloud-Hook testen").argument("<ho
|
|
|
15064
15305
|
log.info("Anmelden mit: shiva login");
|
|
15065
15306
|
return;
|
|
15066
15307
|
}
|
|
15067
|
-
const
|
|
15068
|
-
const spinner =
|
|
15308
|
+
const ora25 = (await import("ora")).default;
|
|
15309
|
+
const spinner = ora25("Teste Hook...").start();
|
|
15069
15310
|
try {
|
|
15070
15311
|
const result = await api2.testHook(hookId);
|
|
15071
15312
|
spinner.stop();
|
|
@@ -15111,8 +15352,8 @@ hookCommand.command("cloud-delete").description("Cloud-Hook l\xF6schen").argumen
|
|
|
15111
15352
|
return;
|
|
15112
15353
|
}
|
|
15113
15354
|
}
|
|
15114
|
-
const
|
|
15115
|
-
const spinner =
|
|
15355
|
+
const ora25 = (await import("ora")).default;
|
|
15356
|
+
const spinner = ora25("L\xF6sche Hook...").start();
|
|
15116
15357
|
try {
|
|
15117
15358
|
const result = await api2.deleteHook(hookId);
|
|
15118
15359
|
if (result.success) {
|
|
@@ -15138,8 +15379,8 @@ hookCommand.command("cloud-toggle").description("Cloud-Hook aktivieren/deaktivie
|
|
|
15138
15379
|
log.error("Bitte --enable oder --disable angeben");
|
|
15139
15380
|
return;
|
|
15140
15381
|
}
|
|
15141
|
-
const
|
|
15142
|
-
const spinner =
|
|
15382
|
+
const ora25 = (await import("ora")).default;
|
|
15383
|
+
const spinner = ora25("Aktualisiere Hook...").start();
|
|
15143
15384
|
try {
|
|
15144
15385
|
const result = await api2.updateHook(hookId, { enabled });
|
|
15145
15386
|
if (result.success) {
|
|
@@ -15154,11 +15395,11 @@ hookCommand.command("cloud-toggle").description("Cloud-Hook aktivieren/deaktivie
|
|
|
15154
15395
|
});
|
|
15155
15396
|
|
|
15156
15397
|
// src/commands/advanced/package.ts
|
|
15157
|
-
import { Command as
|
|
15398
|
+
import { Command as Command37 } from "commander";
|
|
15158
15399
|
import * as fs14 from "fs";
|
|
15159
15400
|
import inquirer13 from "inquirer";
|
|
15160
|
-
import
|
|
15161
|
-
var packageCommand = new
|
|
15401
|
+
import ora23 from "ora";
|
|
15402
|
+
var packageCommand = new Command37("package").description("Projekt-Gruppen (Packages) verwalten").action(() => {
|
|
15162
15403
|
listPackages();
|
|
15163
15404
|
});
|
|
15164
15405
|
packageCommand.command("list").description("Alle Packages auflisten").option("--json", "JSON Output").action((options) => {
|
|
@@ -15274,7 +15515,7 @@ packageCommand.command("start <name>").description("Alle Projekte eines Packages
|
|
|
15274
15515
|
log.error(`Package "${pkg.name}" hat keine Projekte.`);
|
|
15275
15516
|
return;
|
|
15276
15517
|
}
|
|
15277
|
-
const spinner =
|
|
15518
|
+
const spinner = ora23("Bereite Projekte vor...").start();
|
|
15278
15519
|
try {
|
|
15279
15520
|
const launches = await getPackageLaunchConfig(name, options.new);
|
|
15280
15521
|
spinner.stop();
|
|
@@ -15324,7 +15565,7 @@ packageCommand.command("push").description("Packages in Cloud sichern").option("
|
|
|
15324
15565
|
log.warn("Keine Packages zum Synchronisieren gefunden");
|
|
15325
15566
|
return;
|
|
15326
15567
|
}
|
|
15327
|
-
const spinner =
|
|
15568
|
+
const spinner = ora23("Synchronisiere Packages...").start();
|
|
15328
15569
|
let syncedCount = 0;
|
|
15329
15570
|
let errorCount = 0;
|
|
15330
15571
|
for (const pkg of packages) {
|
|
@@ -15356,7 +15597,7 @@ packageCommand.command("pull").description("Packages aus Cloud laden").option("-
|
|
|
15356
15597
|
log.info("Anmelden mit: shiva login");
|
|
15357
15598
|
return;
|
|
15358
15599
|
}
|
|
15359
|
-
const spinner =
|
|
15600
|
+
const spinner = ora23("Lade Packages aus Cloud...").start();
|
|
15360
15601
|
try {
|
|
15361
15602
|
const cloudPackages = await api2.getPackages();
|
|
15362
15603
|
spinner.stop();
|
|
@@ -15418,7 +15659,7 @@ packageCommand.command("sync").description("Packages mit Cloud synchronisieren")
|
|
|
15418
15659
|
log.info("Anmelden mit: shiva login");
|
|
15419
15660
|
return;
|
|
15420
15661
|
}
|
|
15421
|
-
const spinner =
|
|
15662
|
+
const spinner = ora23("Synchronisiere Packages...").start();
|
|
15422
15663
|
const localPackages = getAllPackages();
|
|
15423
15664
|
let pushedCount = 0;
|
|
15424
15665
|
for (const pkg of localPackages) {
|
|
@@ -15521,11 +15762,11 @@ function listPackages() {
|
|
|
15521
15762
|
}
|
|
15522
15763
|
|
|
15523
15764
|
// src/commands/advanced/sandbox.ts
|
|
15524
|
-
import { Command as
|
|
15525
|
-
import
|
|
15526
|
-
var sandboxCommand = new
|
|
15765
|
+
import { Command as Command38 } from "commander";
|
|
15766
|
+
import ora24 from "ora";
|
|
15767
|
+
var sandboxCommand = new Command38("sandbox").description("Sandbox-Management mit Cloud-Sync");
|
|
15527
15768
|
sandboxCommand.command("list").description("Alle Sandboxes auflisten").option("--local", "Nur lokale Sandboxes").option("--cloud", "Nur Cloud Sandboxes").option("--status <status>", "Nach Status filtern: active, pending-review, applied, discarded").option("--json", "JSON Output").action(async (options) => {
|
|
15528
|
-
const spinner =
|
|
15769
|
+
const spinner = ora24("Lade Sandboxes...").start();
|
|
15529
15770
|
try {
|
|
15530
15771
|
const results = [];
|
|
15531
15772
|
if (!options.cloud) {
|
|
@@ -15595,7 +15836,7 @@ sandboxCommand.command("list").description("Alle Sandboxes auflisten").option("-
|
|
|
15595
15836
|
}
|
|
15596
15837
|
});
|
|
15597
15838
|
sandboxCommand.command("pending").description("Sandboxes mit Pending Review Status").option("--json", "JSON Output").action(async (options) => {
|
|
15598
|
-
const spinner =
|
|
15839
|
+
const spinner = ora24("Lade Pending Sandboxes...").start();
|
|
15599
15840
|
try {
|
|
15600
15841
|
const localPending = sandboxService.listPendingReview();
|
|
15601
15842
|
let cloudPending = [];
|
|
@@ -15639,7 +15880,7 @@ sandboxCommand.command("pending").description("Sandboxes mit Pending Review Stat
|
|
|
15639
15880
|
}
|
|
15640
15881
|
});
|
|
15641
15882
|
sandboxCommand.command("stats").description("Sandbox-Statistiken anzeigen").option("--json", "JSON Output").action(async (options) => {
|
|
15642
|
-
const spinner =
|
|
15883
|
+
const spinner = ora24("Lade Statistiken...").start();
|
|
15643
15884
|
try {
|
|
15644
15885
|
const localSandboxes = sandboxService.listSandboxes();
|
|
15645
15886
|
const localStats = {
|
|
@@ -15693,7 +15934,7 @@ sandboxCommand.command("sync").description("Sandbox mit Cloud synchronisieren").
|
|
|
15693
15934
|
log.info("Anmelden mit: shiva login");
|
|
15694
15935
|
return;
|
|
15695
15936
|
}
|
|
15696
|
-
const spinner =
|
|
15937
|
+
const spinner = ora24("Synchronisiere Sandbox...").start();
|
|
15697
15938
|
try {
|
|
15698
15939
|
if (id) {
|
|
15699
15940
|
await api.syncSandbox(id, {
|
|
@@ -15734,7 +15975,7 @@ sandboxCommand.command("cleanup").description("Alte Sandboxes aufr\xE4umen").opt
|
|
|
15734
15975
|
return;
|
|
15735
15976
|
}
|
|
15736
15977
|
}
|
|
15737
|
-
const spinner =
|
|
15978
|
+
const spinner = ora24("R\xE4ume Sandboxes auf...").start();
|
|
15738
15979
|
try {
|
|
15739
15980
|
let localDeleted = 0;
|
|
15740
15981
|
let cloudDeleted = 0;
|
|
@@ -15762,7 +16003,7 @@ sandboxCommand.command("cleanup").description("Alte Sandboxes aufr\xE4umen").opt
|
|
|
15762
16003
|
});
|
|
15763
16004
|
sandboxCommand.command("config").description("Sandbox-Konfiguration verwalten").option("--show", "Konfiguration anzeigen").option("--mode <mode>", "Standard-Modus: worktree, copy, docker-overlay").option("--cleanup-days <days>", "Auto-Cleanup nach X Tagen").option("--max <n>", "Maximale aktive Sandboxes").option("--require-review", "Review vor Apply erforderlich").option("--no-require-review", "Review nicht erforderlich").option("--pull", "Konfiguration aus Cloud laden").option("--push", "Konfiguration in Cloud speichern").action(async (options) => {
|
|
15764
16005
|
if (options.pull && isAuthenticated()) {
|
|
15765
|
-
const spinner =
|
|
16006
|
+
const spinner = ora24("Lade Konfiguration aus Cloud...").start();
|
|
15766
16007
|
try {
|
|
15767
16008
|
const cloudConfig = await api.getSandboxConfig();
|
|
15768
16009
|
sandboxService.updateConfig({
|
|
@@ -15779,7 +16020,7 @@ sandboxCommand.command("config").description("Sandbox-Konfiguration verwalten").
|
|
|
15779
16020
|
}
|
|
15780
16021
|
}
|
|
15781
16022
|
if (options.push && isAuthenticated()) {
|
|
15782
|
-
const spinner =
|
|
16023
|
+
const spinner = ora24("Speichere Konfiguration in Cloud...").start();
|
|
15783
16024
|
try {
|
|
15784
16025
|
const localConfig = sandboxService.getConfig();
|
|
15785
16026
|
const cloudMode = localConfig.defaultMode === "none" ? "worktree" : localConfig.defaultMode;
|
|
@@ -15850,7 +16091,7 @@ sandboxCommand.command("delete <id>").description("Sandbox l\xF6schen").option("
|
|
|
15850
16091
|
return;
|
|
15851
16092
|
}
|
|
15852
16093
|
}
|
|
15853
|
-
const spinner =
|
|
16094
|
+
const spinner = ora24("L\xF6sche Sandbox...").start();
|
|
15854
16095
|
try {
|
|
15855
16096
|
try {
|
|
15856
16097
|
await sandboxService.deleteSandbox(id);
|
|
@@ -15874,8 +16115,8 @@ sandboxCommand.command("delete <id>").description("Sandbox l\xF6schen").option("
|
|
|
15874
16115
|
});
|
|
15875
16116
|
|
|
15876
16117
|
// src/index.ts
|
|
15877
|
-
var program = new
|
|
15878
|
-
program.name("shiva").description("SHIVA Code - Control Station for Claude Code").version("0.
|
|
16118
|
+
var program = new Command39();
|
|
16119
|
+
program.name("shiva").description("SHIVA Code - Control Station for Claude Code").version("0.6.3");
|
|
15879
16120
|
program.addCommand(loginCommand);
|
|
15880
16121
|
program.addCommand(logoutCommand);
|
|
15881
16122
|
program.addCommand(sessionsCommand);
|
|
@@ -15891,6 +16132,7 @@ program.addCommand(connectCommand);
|
|
|
15891
16132
|
program.addCommand(disconnectCommand);
|
|
15892
16133
|
program.addCommand(configCommand);
|
|
15893
16134
|
program.addCommand(projectCommand);
|
|
16135
|
+
program.addCommand(repairCommand);
|
|
15894
16136
|
program.addCommand(githubCommand);
|
|
15895
16137
|
program.addCommand(issuesCommand);
|
|
15896
16138
|
program.addCommand(prsCommand);
|
|
@@ -15922,7 +16164,7 @@ program.action(async () => {
|
|
|
15922
16164
|
async function interactiveMenu(choices, shortcuts) {
|
|
15923
16165
|
const write = (str) => process.stdout.write(str);
|
|
15924
16166
|
const totalLines = 1 + choices.length + 1;
|
|
15925
|
-
return new Promise((
|
|
16167
|
+
return new Promise((resolve14) => {
|
|
15926
16168
|
let selectedIndex = 0;
|
|
15927
16169
|
let resolved = false;
|
|
15928
16170
|
let firstRender = true;
|
|
@@ -15977,7 +16219,7 @@ async function interactiveMenu(choices, shortcuts) {
|
|
|
15977
16219
|
resolved = true;
|
|
15978
16220
|
cleanup();
|
|
15979
16221
|
showSelection(shortcutType);
|
|
15980
|
-
|
|
16222
|
+
resolve14({ type: shortcutType });
|
|
15981
16223
|
return;
|
|
15982
16224
|
}
|
|
15983
16225
|
if (keyName === "up") {
|
|
@@ -15990,12 +16232,12 @@ async function interactiveMenu(choices, shortcuts) {
|
|
|
15990
16232
|
resolved = true;
|
|
15991
16233
|
cleanup();
|
|
15992
16234
|
showSelection(choices[selectedIndex].name);
|
|
15993
|
-
|
|
16235
|
+
resolve14(choices[selectedIndex].value);
|
|
15994
16236
|
} else if (keyName === "escape") {
|
|
15995
16237
|
resolved = true;
|
|
15996
16238
|
cleanup();
|
|
15997
16239
|
showSelection("Beenden");
|
|
15998
|
-
|
|
16240
|
+
resolve14({ type: "quit" });
|
|
15999
16241
|
}
|
|
16000
16242
|
};
|
|
16001
16243
|
process.stdin.on("keypress", handler);
|