@rucher/cli 0.2.0-beta.9 → 0.3.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +308 -8
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { defineCommand, runMain } from "citty";
|
|
|
3
3
|
import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { basename, dirname, join, resolve } from "node:path";
|
|
5
5
|
import tab from "@bomb.sh/tab/citty";
|
|
6
|
-
import { AGENT_KINDS, BLOCKED_HEADER, CarnetError, GUARDED_TOOLS, KIND_LEGEND, KIND_TAG_PATTERN, LAUNCH_TOOLS, LEGEND, MAIN_HEADER, MAIN_IDLE, NOTES_HEADER, NOTE_KINDS, SIMILAR_PREFIX, SUBAGENT_RULES, WAITING_TOOL, WORKSPACE_FILE, addWorkspaceRepo, appendPromptFile, archiveWorkspaceSessions, claudeCode, createWorkspace, definitionInstructions, deleteWorkspaceNotes, dropWorkspace, formatClock, guardMainLaunch, guardSubagentCall, handleSessionEnd, handleSessionStart, handleStop, handleToolStart, handleToolUse, handleUserPromptSubmit, hostById, isAgentKind, isWorkspaceName, kindTag, labelStatusLine, listWorkspaces, loadWorkspace, memoryHalfLife, moveSession, openCarnet, openResolvedCarnet, openWorkspaceCarnet, removeWorkspaceRepo, renderRunDirectory, renderSections, repoNameFor, repoPathFor, requireWorkspace, resolveWorkspace, shortId, statusLinePath, workspaceExists, workspaceLabel, workspaceLastActive, workspaceRepoNames, workspaceSessionCounts, writeStatusLine } from "@rucher/carnet";
|
|
6
|
+
import { AGENT_KINDS, BLOCKED_HEADER, CarnetError, GUARDED_TOOLS, KIND_LEGEND, KIND_TAG_PATTERN, LAUNCH_TOOLS, LEGEND, MAIN_HEADER, MAIN_IDLE, NOTES_HEADER, NOTE_KINDS, SIMILAR_PREFIX, SUBAGENT_RULES, WAITING_TOOL, WORKSPACE_FILE, addWorkspaceRepo, appendPromptFile, archiveWorkspaceSessions, claudeCode, createWorkspace, definitionInstructions, deleteWorkspaceNotes, dropWorkspace, formatClock, guardMainLaunch, guardSubagentCall, handleSessionEnd, handleSessionStart, handleStop, handleToolStart, handleToolUse, handleUserPromptSubmit, hostById, isAgentKind, isWorkspaceName, kindTag, labelStatusLine, listWorkspaces, loadWorkspace, locateAgent, memoryHalfLife, mergeWorkspaces, moveSession, openCarnet, openResolvedCarnet, openWorkspaceCarnet, planWorkspaceMerge, removeWorkspaceRepo, renameWorkspace, renderRunDirectory, renderSections, repoNameFor, repoPathFor, reportDocument, requireWorkspace, resolveWorkspace, shortId, statusLinePath, workspaceExists, workspaceLabel, workspaceLastActive, workspaceRepoNames, workspaceSessionCounts, writeStatusLine } from "@rucher/carnet";
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
8
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
9
9
|
import { spawnSync } from "node:child_process";
|
|
@@ -92,6 +92,24 @@ function suggestNotes(context, complete) {
|
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
|
+
function suggestAgents(context, complete) {
|
|
96
|
+
quietly(() => {
|
|
97
|
+
const carnet = openCarnet(inWorkspace(context));
|
|
98
|
+
try {
|
|
99
|
+
const seen = /* @__PURE__ */ new Set();
|
|
100
|
+
for (const session of carnet.sessions.list({ includeTemp: true })) {
|
|
101
|
+
const label = session.name ?? shortId(session.id);
|
|
102
|
+
for (const agent of carnet.agents.list(session.id, { includeClosed: true })) {
|
|
103
|
+
if (seen.has(agent.name)) continue;
|
|
104
|
+
seen.add(agent.name);
|
|
105
|
+
complete(agent.name, agent.task ? `${agent.task} · ${label}` : label);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
} finally {
|
|
109
|
+
carnet.close();
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
95
113
|
function suggestDirectories(context, complete) {
|
|
96
114
|
quietly(() => {
|
|
97
115
|
const partial = context.typedWords.at(-1) ?? "";
|
|
@@ -116,6 +134,7 @@ const repoNames = (complete) => suggestRepoNames(processContext(), complete);
|
|
|
116
134
|
const noteKinds = (complete) => suggestNoteKinds(complete);
|
|
117
135
|
const agentKinds = (complete) => suggestAgentKinds(complete);
|
|
118
136
|
const notes = (complete) => suggestNotes(processContext(), complete);
|
|
137
|
+
const agents = (complete) => suggestAgents(processContext(), complete);
|
|
119
138
|
const workspace = { ws: workspaces };
|
|
120
139
|
const completionConfig = { subCommands: {
|
|
121
140
|
status: { options: {
|
|
@@ -128,6 +147,13 @@ const completionConfig = { subCommands: {
|
|
|
128
147
|
kind: agentKinds,
|
|
129
148
|
...workspace
|
|
130
149
|
} },
|
|
150
|
+
report: {
|
|
151
|
+
args: { name: agents },
|
|
152
|
+
options: {
|
|
153
|
+
session: sessions,
|
|
154
|
+
...workspace
|
|
155
|
+
}
|
|
156
|
+
},
|
|
131
157
|
new: { options: workspace },
|
|
132
158
|
tmp: { options: workspace },
|
|
133
159
|
resume: {
|
|
@@ -210,6 +236,11 @@ const completionConfig = { subCommands: {
|
|
|
210
236
|
ws: {
|
|
211
237
|
options: workspace,
|
|
212
238
|
subCommands: {
|
|
239
|
+
rename: { args: { old: workspaces } },
|
|
240
|
+
merge: { args: {
|
|
241
|
+
from: workspaces,
|
|
242
|
+
into: workspaces
|
|
243
|
+
} },
|
|
213
244
|
drop: { args: { name: workspaces } },
|
|
214
245
|
show: { options: workspace },
|
|
215
246
|
add: {
|
|
@@ -246,7 +277,7 @@ async function setupCompletion(main) {
|
|
|
246
277
|
};
|
|
247
278
|
}
|
|
248
279
|
// package.json
|
|
249
|
-
var version = "0.
|
|
280
|
+
var version = "0.3.0-beta.0";
|
|
250
281
|
// src/plugin.ts
|
|
251
282
|
const CLI_VERSION = version;
|
|
252
283
|
function readJson(path) {
|
|
@@ -374,7 +405,7 @@ function subagentStart(stdinText, io) {
|
|
|
374
405
|
return runHook(io, () => {
|
|
375
406
|
const payload = host.parseSubagentPayload(stdinText);
|
|
376
407
|
withCarnet$1(payload, io, (carnet) => {
|
|
377
|
-
carnet.agents.pairSubagent(payload.session_id, payload.agent_id, host.subagentNames(payload));
|
|
408
|
+
carnet.agents.pairSubagent(payload.session_id, payload.agent_id, host.subagentNames(payload), payload.agent_type);
|
|
378
409
|
});
|
|
379
410
|
if (host.subagentInheritsContext(payload)) return;
|
|
380
411
|
const hookSpecificOutput = {
|
|
@@ -426,9 +457,14 @@ function sessionEnd(stdinText, io) {
|
|
|
426
457
|
});
|
|
427
458
|
});
|
|
428
459
|
}
|
|
429
|
-
function
|
|
430
|
-
const
|
|
431
|
-
|
|
460
|
+
function scratchRoots(io) {
|
|
461
|
+
const folder = `claude-${process.getuid?.() ?? 0}`;
|
|
462
|
+
const parents = [
|
|
463
|
+
io.env.CLAUDE_CODE_TMPDIR,
|
|
464
|
+
process.platform === "win32" ? void 0 : "/tmp",
|
|
465
|
+
tmpdir()
|
|
466
|
+
].filter((parent) => Boolean(parent));
|
|
467
|
+
return [...new Set(parents.map((parent) => join(parent, folder)))];
|
|
432
468
|
}
|
|
433
469
|
function denyToolCall(io, reason) {
|
|
434
470
|
const hookSpecificOutput = {
|
|
@@ -446,7 +482,7 @@ function preToolUse(stdinText, io) {
|
|
|
446
482
|
const launch = !payload.agent_id && LAUNCH_TOOLS.has(tool);
|
|
447
483
|
if (!guarded && !launch && (payload.agent_id || tool !== WAITING_TOOL)) return;
|
|
448
484
|
withCarnet$1(payload, io, (carnet) => {
|
|
449
|
-
const reason = guarded ? guardSubagentCall(carnet, payload,
|
|
485
|
+
const reason = guarded ? guardSubagentCall(carnet, payload, scratchRoots(io)) : launch ? guardMainLaunch(carnet, payload) : handleToolStart(carnet, payload);
|
|
450
486
|
if (reason) denyToolCall(io, reason);
|
|
451
487
|
});
|
|
452
488
|
});
|
|
@@ -920,6 +956,36 @@ function workspaceLines(choices, now = /* @__PURE__ */ new Date()) {
|
|
|
920
956
|
async function pickWorkspace(choices) {
|
|
921
957
|
return (await pick(choices, workspaceLines(choices), "workspace"))?.name;
|
|
922
958
|
}
|
|
959
|
+
// src/commands/report.ts
|
|
960
|
+
function runEditor(editor, file) {
|
|
961
|
+
return spawnSync(`${editor} "$RUCHER_EDIT_FILE"`, {
|
|
962
|
+
shell: true,
|
|
963
|
+
stdio: "inherit",
|
|
964
|
+
env: {
|
|
965
|
+
...process.env,
|
|
966
|
+
RUCHER_EDIT_FILE: file
|
|
967
|
+
}
|
|
968
|
+
}).status ?? 1;
|
|
969
|
+
}
|
|
970
|
+
function colorHeadings(text, io) {
|
|
971
|
+
const colors = paint(io);
|
|
972
|
+
return text.split("\n").map((line) => /^#{1,3}\s/.test(line) ? colors.bold(line) : line).join("\n");
|
|
973
|
+
}
|
|
974
|
+
function reportOnce(carnet, io, name, options) {
|
|
975
|
+
const session = options.session || carnet.sessions.list({ includeTemp: true }).length === 0 ? resolveSession(carnet, options.session) : locateAgent(carnet, name).session;
|
|
976
|
+
const document = reportDocument(carnet, session.id, name);
|
|
977
|
+
if (options.path) {
|
|
978
|
+
io.stdout(`${document.path}\n`);
|
|
979
|
+
return 0;
|
|
980
|
+
}
|
|
981
|
+
if (options.edit) {
|
|
982
|
+
const editor = io.env.EDITOR || io.env.VISUAL;
|
|
983
|
+
if (!editor) throw new CliError("No editor set", "set $EDITOR or $VISUAL, or print it without --edit");
|
|
984
|
+
return (options.openEditor ?? runEditor)(editor, document.path);
|
|
985
|
+
}
|
|
986
|
+
io.stdout(`${colorHeadings(document.text, io)}\n`);
|
|
987
|
+
return 0;
|
|
988
|
+
}
|
|
923
989
|
// src/commands/serve.ts
|
|
924
990
|
function serve(io) {
|
|
925
991
|
serveCarnet({
|
|
@@ -1723,6 +1789,110 @@ function workspaceDrop(name, io, options = {}) {
|
|
|
1723
1789
|
carnet.close();
|
|
1724
1790
|
}
|
|
1725
1791
|
}
|
|
1792
|
+
function moveLines(plan) {
|
|
1793
|
+
return plan.moves.map((move) => ` ${move.what}: ${move.from} → ${move.to}`);
|
|
1794
|
+
}
|
|
1795
|
+
function rowLine(plan) {
|
|
1796
|
+
const { sessions, notes, activeDays } = plan.rows;
|
|
1797
|
+
return ` Carnet: ${plural(sessions, "session")}, ${plural(notes, "note")}, ${plural(activeDays, "active day")}`;
|
|
1798
|
+
}
|
|
1799
|
+
function workspaceRename(from, to, io, options = {}) {
|
|
1800
|
+
const carnet = openWorkspaceCarnet(null, { env: io.env });
|
|
1801
|
+
try {
|
|
1802
|
+
const result = renameWorkspace(carnet.db, from, to, {
|
|
1803
|
+
env: io.env,
|
|
1804
|
+
dryRun: options.dryRun,
|
|
1805
|
+
isAlive: options.isAlive ?? processIsAlive,
|
|
1806
|
+
now: options.now
|
|
1807
|
+
});
|
|
1808
|
+
if (options.dryRun) {
|
|
1809
|
+
const lines = [
|
|
1810
|
+
`would rename ${from} to ${to}:`,
|
|
1811
|
+
...moveLines(result),
|
|
1812
|
+
" Claude Code project folder and trust entry, when they exist",
|
|
1813
|
+
rowLine(result),
|
|
1814
|
+
...result.running.length ? [`the real run would stop: ${plural(result.running.length, "session")} running (${result.running.map((row) => row.name ?? row.id.slice(0, 8)).join(", ")})`] : []
|
|
1815
|
+
];
|
|
1816
|
+
io.stdout(`${lines.join("\n")}\n`);
|
|
1817
|
+
return 0;
|
|
1818
|
+
}
|
|
1819
|
+
const done = result;
|
|
1820
|
+
const lines = [
|
|
1821
|
+
`renamed ${from} to ${to}`,
|
|
1822
|
+
...moveLines(done),
|
|
1823
|
+
rowLine(done),
|
|
1824
|
+
` paths rewritten: ${done.paths}`,
|
|
1825
|
+
` trust entry ${done.trustMoved ? "moved" : "not found, unchanged"}`,
|
|
1826
|
+
` backup: ${done.backup}`,
|
|
1827
|
+
...done.warnings.map((warning) => `warning: ${warning}`),
|
|
1828
|
+
`Next: \`rucher resume <session> --ws ${to}\``
|
|
1829
|
+
];
|
|
1830
|
+
io.stdout(`${lines.join("\n")}\n`);
|
|
1831
|
+
return 0;
|
|
1832
|
+
} finally {
|
|
1833
|
+
carnet.close();
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
function moveList(title, moves) {
|
|
1837
|
+
if (!moves.length) return [];
|
|
1838
|
+
return [` ${title}:`, ...moves.map((move) => ` ${move.from} → ${move.to}`)];
|
|
1839
|
+
}
|
|
1840
|
+
function mergePlanLines(plan) {
|
|
1841
|
+
const { sessions, notes, activeDays } = plan.rows;
|
|
1842
|
+
return [
|
|
1843
|
+
` Carnet: ${plural(sessions, "session")}, ${plural(activeDays, "active day")}, ${plural(notes, "note")}${notes ? ` numbered #${plan.firstNumber} to #${plan.lastNumber} in ${plan.into}` : ""}`,
|
|
1844
|
+
...plan.reposAdded.length ? [` repos added: ${plan.reposAdded.join(", ")}`] : [],
|
|
1845
|
+
...plan.reposRenamed.map(([from, into]) => ` repo ${from} is ${into} in ${plan.into}`),
|
|
1846
|
+
...plan.settingsConflicts.length ? [` settings kept from ${plan.into}: ${plan.settingsConflicts.join(", ")}`] : [],
|
|
1847
|
+
` ${plan.instructions} of ${plan.from} appended to ${plan.into}'s under ## Ex-workspace ${plan.from}`,
|
|
1848
|
+
` Claude Code project folder of ${plan.from} merged into ${plan.into}'s (conversations, memory), trust entry dropped`,
|
|
1849
|
+
...moveList("reports", plan.reports),
|
|
1850
|
+
...moveList("sandboxes", plan.sandboxes),
|
|
1851
|
+
...moveList("other files", plan.files),
|
|
1852
|
+
` then ${plan.from}'s definition and run directory go to the backup folder`
|
|
1853
|
+
];
|
|
1854
|
+
}
|
|
1855
|
+
async function workspaceMerge(from, into, io, options = {}) {
|
|
1856
|
+
const carnet = openWorkspaceCarnet(null, { env: io.env });
|
|
1857
|
+
try {
|
|
1858
|
+
const isAlive = options.isAlive ?? processIsAlive;
|
|
1859
|
+
const plan = planWorkspaceMerge(carnet.db, from, into, {
|
|
1860
|
+
env: io.env,
|
|
1861
|
+
isAlive
|
|
1862
|
+
});
|
|
1863
|
+
const running = plan.running.length ? [`the real run would stop: ${plural(plan.running.length, "session")} running (${plan.running.map((row) => row.name ?? row.id.slice(0, 8)).join(", ")})`] : [];
|
|
1864
|
+
io.stdout(`${[
|
|
1865
|
+
`merge ${from} into ${into}:`,
|
|
1866
|
+
...mergePlanLines(plan),
|
|
1867
|
+
...running
|
|
1868
|
+
].join("\n")}\n`);
|
|
1869
|
+
if (options.dryRun) return 0;
|
|
1870
|
+
if (!options.yes) {
|
|
1871
|
+
if (!options.confirm) throw new CliError(`merging deletes ${from}`, "pass --yes to merge without a question");
|
|
1872
|
+
if (!await options.confirm(`Merge ${from} into ${into}? [y/N] `)) {
|
|
1873
|
+
io.stdout("nothing merged\n");
|
|
1874
|
+
return 1;
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
const result = mergeWorkspaces(carnet.db, from, into, {
|
|
1878
|
+
env: io.env,
|
|
1879
|
+
isAlive,
|
|
1880
|
+
now: options.now
|
|
1881
|
+
});
|
|
1882
|
+
const lines = [
|
|
1883
|
+
`merged ${from} into ${into}`,
|
|
1884
|
+
` backup: ${result.backup}`,
|
|
1885
|
+
...result.warnings.map((warning) => `warning: ${warning}`)
|
|
1886
|
+
];
|
|
1887
|
+
io.stdout(`${lines.join("\n")}\n`);
|
|
1888
|
+
if (options.edit === false) return 0;
|
|
1889
|
+
if ((options.openEditor ?? openEditorFor(io))(result.instructionsPath) !== 0) io.stderr(`warning: ${editorCommand(io.env)} exited with an error; the appended instructions stay\n`);
|
|
1890
|
+
workspaceSync(io, { workspace: into });
|
|
1891
|
+
return 0;
|
|
1892
|
+
} finally {
|
|
1893
|
+
carnet.close();
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1726
1896
|
function workspaceErrors(io, run) {
|
|
1727
1897
|
try {
|
|
1728
1898
|
return run();
|
|
@@ -1738,6 +1908,15 @@ function workspaceErrors(io, run) {
|
|
|
1738
1908
|
throw error;
|
|
1739
1909
|
}
|
|
1740
1910
|
}
|
|
1911
|
+
async function workspaceErrorsAsync(io, run) {
|
|
1912
|
+
try {
|
|
1913
|
+
return await run();
|
|
1914
|
+
} catch (error) {
|
|
1915
|
+
return workspaceErrors(io, () => {
|
|
1916
|
+
throw error;
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
}
|
|
1741
1920
|
// src/io.ts
|
|
1742
1921
|
function processIo(options = {}) {
|
|
1743
1922
|
const tty = process.stdout.isTTY === true;
|
|
@@ -1927,6 +2106,45 @@ const logCommand = defineCommand({
|
|
|
1927
2106
|
}
|
|
1928
2107
|
}
|
|
1929
2108
|
});
|
|
2109
|
+
const reportCommand = defineCommand({
|
|
2110
|
+
meta: {
|
|
2111
|
+
name: "report",
|
|
2112
|
+
description: "Print an agent's report, a plan agent's plan with each answer beside its question"
|
|
2113
|
+
},
|
|
2114
|
+
args: {
|
|
2115
|
+
name: {
|
|
2116
|
+
type: "positional",
|
|
2117
|
+
description: "Agent name",
|
|
2118
|
+
required: true
|
|
2119
|
+
},
|
|
2120
|
+
...sessionArgument,
|
|
2121
|
+
edit: {
|
|
2122
|
+
type: "boolean",
|
|
2123
|
+
default: false,
|
|
2124
|
+
description: "Open the report in $EDITOR"
|
|
2125
|
+
},
|
|
2126
|
+
path: {
|
|
2127
|
+
type: "boolean",
|
|
2128
|
+
default: false,
|
|
2129
|
+
description: "Print the report path alone"
|
|
2130
|
+
},
|
|
2131
|
+
...workspaceArgument,
|
|
2132
|
+
...colorArgument
|
|
2133
|
+
},
|
|
2134
|
+
setup: askWorkspace,
|
|
2135
|
+
run({ args }) {
|
|
2136
|
+
const io = processIo({ color: args.color });
|
|
2137
|
+
let code = 0;
|
|
2138
|
+
withCarnet(io, args.ws, (carnet) => {
|
|
2139
|
+
code = reportOnce(carnet, io, args.name, {
|
|
2140
|
+
session: args.session,
|
|
2141
|
+
edit: args.edit,
|
|
2142
|
+
path: args.path
|
|
2143
|
+
});
|
|
2144
|
+
});
|
|
2145
|
+
if (code !== 0) process.exit(code);
|
|
2146
|
+
}
|
|
2147
|
+
});
|
|
1930
2148
|
const sessionsListCommand = defineCommand({
|
|
1931
2149
|
meta: {
|
|
1932
2150
|
name: "list",
|
|
@@ -2452,13 +2670,25 @@ async function askYes(question) {
|
|
|
2452
2670
|
prompt.close();
|
|
2453
2671
|
}
|
|
2454
2672
|
}
|
|
2673
|
+
async function askNo(question) {
|
|
2674
|
+
const { createInterface } = await import("node:readline/promises");
|
|
2675
|
+
const prompt = createInterface({
|
|
2676
|
+
input: process.stdin,
|
|
2677
|
+
output: process.stderr
|
|
2678
|
+
});
|
|
2679
|
+
try {
|
|
2680
|
+
return /^y/i.test((await prompt.question(question)).trim());
|
|
2681
|
+
} finally {
|
|
2682
|
+
prompt.close();
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2455
2685
|
function commaList(value) {
|
|
2456
2686
|
return value?.split(",").map((item) => item.trim()).filter(Boolean);
|
|
2457
2687
|
}
|
|
2458
2688
|
const wsCommand = defineCommand({
|
|
2459
2689
|
meta: {
|
|
2460
2690
|
name: "ws",
|
|
2461
|
-
description: "The workspaces: create, list, show, add or remove repos, render, edit instructions"
|
|
2691
|
+
description: "The workspaces: create, rename, merge, list, show, add or remove repos, render, edit instructions"
|
|
2462
2692
|
},
|
|
2463
2693
|
args: { ...workspaceArgument },
|
|
2464
2694
|
setup: forwardWorkspace,
|
|
@@ -2496,6 +2726,75 @@ const wsCommand = defineCommand({
|
|
|
2496
2726
|
process.exitCode = workspaceErrors(io, () => workspaceCreate(args.name, io, { repos: commaList(args.repos) }));
|
|
2497
2727
|
}
|
|
2498
2728
|
}),
|
|
2729
|
+
rename: defineCommand({
|
|
2730
|
+
meta: {
|
|
2731
|
+
name: "rename",
|
|
2732
|
+
description: "Rename a workspace: its definition, run directory, Claude Code project folder and rows"
|
|
2733
|
+
},
|
|
2734
|
+
args: {
|
|
2735
|
+
old: {
|
|
2736
|
+
type: "positional",
|
|
2737
|
+
description: "Current workspace name",
|
|
2738
|
+
required: true
|
|
2739
|
+
},
|
|
2740
|
+
new: {
|
|
2741
|
+
type: "positional",
|
|
2742
|
+
description: "New name: a-z, 0-9 and -",
|
|
2743
|
+
required: true
|
|
2744
|
+
},
|
|
2745
|
+
"dry-run": {
|
|
2746
|
+
type: "boolean",
|
|
2747
|
+
default: false,
|
|
2748
|
+
description: "Print what would move, change nothing"
|
|
2749
|
+
}
|
|
2750
|
+
},
|
|
2751
|
+
run({ args }) {
|
|
2752
|
+
const io = processIo();
|
|
2753
|
+
process.exitCode = workspaceErrors(io, () => workspaceRename(args.old, args.new, io, { dryRun: args["dry-run"] }));
|
|
2754
|
+
}
|
|
2755
|
+
}),
|
|
2756
|
+
merge: defineCommand({
|
|
2757
|
+
meta: {
|
|
2758
|
+
name: "merge",
|
|
2759
|
+
description: "Merge a workspace into another: sessions, notes, reports, Claude Code conversations, instructions"
|
|
2760
|
+
},
|
|
2761
|
+
args: {
|
|
2762
|
+
from: {
|
|
2763
|
+
type: "positional",
|
|
2764
|
+
description: "Workspace merged, then removed",
|
|
2765
|
+
required: true
|
|
2766
|
+
},
|
|
2767
|
+
into: {
|
|
2768
|
+
type: "positional",
|
|
2769
|
+
description: "Workspace kept",
|
|
2770
|
+
required: true
|
|
2771
|
+
},
|
|
2772
|
+
"dry-run": {
|
|
2773
|
+
type: "boolean",
|
|
2774
|
+
default: false,
|
|
2775
|
+
description: "Print what would move, change nothing"
|
|
2776
|
+
},
|
|
2777
|
+
edit: {
|
|
2778
|
+
type: "boolean",
|
|
2779
|
+
default: true,
|
|
2780
|
+
description: "Open the merged instructions in $EDITOR (--no-edit to skip)"
|
|
2781
|
+
},
|
|
2782
|
+
yes: {
|
|
2783
|
+
type: "boolean",
|
|
2784
|
+
default: false,
|
|
2785
|
+
description: "Merge without asking"
|
|
2786
|
+
}
|
|
2787
|
+
},
|
|
2788
|
+
async run({ args }) {
|
|
2789
|
+
const io = processIo();
|
|
2790
|
+
process.exitCode = await workspaceErrorsAsync(io, () => workspaceMerge(args.from, args.into, io, {
|
|
2791
|
+
dryRun: args["dry-run"],
|
|
2792
|
+
edit: args.edit,
|
|
2793
|
+
yes: args.yes,
|
|
2794
|
+
confirm: process.stdin.isTTY ? askNo : void 0
|
|
2795
|
+
}));
|
|
2796
|
+
}
|
|
2797
|
+
}),
|
|
2499
2798
|
drop: defineCommand({
|
|
2500
2799
|
meta: {
|
|
2501
2800
|
name: "drop",
|
|
@@ -2749,6 +3048,7 @@ const main = defineCommand({
|
|
|
2749
3048
|
subCommands: {
|
|
2750
3049
|
status: statusCommand,
|
|
2751
3050
|
log: logCommand,
|
|
3051
|
+
report: reportCommand,
|
|
2752
3052
|
new: newCommand,
|
|
2753
3053
|
tmp: tmpCommand,
|
|
2754
3054
|
resume: resumeCommand,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rucher/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-beta.0",
|
|
4
4
|
"description": "rucher: status, journal and sessions of your Claude Code sub-agents, from the terminal",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@bomb.sh/tab": "0.0.22",
|
|
38
|
-
"@rucher/carnet": "0.
|
|
38
|
+
"@rucher/carnet": "0.3.0-beta.0",
|
|
39
39
|
"citty": "^0.2.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|