cluttry 1.0.3 → 1.5.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/CHANGELOG.md +71 -0
- package/README.md +203 -300
- package/dist/commands/completions.d.ts +16 -0
- package/dist/commands/completions.d.ts.map +1 -0
- package/dist/commands/completions.js +46 -0
- package/dist/commands/completions.js.map +1 -0
- package/dist/commands/explain-copy.d.ts +11 -0
- package/dist/commands/explain-copy.d.ts.map +1 -0
- package/dist/commands/explain-copy.js +34 -0
- package/dist/commands/explain-copy.js.map +1 -0
- package/dist/commands/finish.d.ts +20 -0
- package/dist/commands/finish.d.ts.map +1 -0
- package/dist/commands/finish.js +817 -0
- package/dist/commands/finish.js.map +1 -0
- package/dist/commands/gc.d.ts +22 -0
- package/dist/commands/gc.d.ts.map +1 -0
- package/dist/commands/gc.js +163 -0
- package/dist/commands/gc.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/open.d.ts +15 -1
- package/dist/commands/open.d.ts.map +1 -1
- package/dist/commands/open.js +96 -17
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/resume.d.ts +21 -0
- package/dist/commands/resume.d.ts.map +1 -0
- package/dist/commands/resume.js +106 -0
- package/dist/commands/resume.js.map +1 -0
- package/dist/commands/rm.d.ts.map +1 -1
- package/dist/commands/rm.js +6 -14
- package/dist/commands/rm.js.map +1 -1
- package/dist/commands/spawn.d.ts +3 -0
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +182 -19
- package/dist/commands/spawn.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +198 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/completions.d.ts +35 -0
- package/dist/lib/completions.d.ts.map +1 -0
- package/dist/lib/completions.js +368 -0
- package/dist/lib/completions.js.map +1 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +2 -0
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/errors.d.ts +43 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +251 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/git.d.ts +17 -0
- package/dist/lib/git.d.ts.map +1 -1
- package/dist/lib/git.js +78 -10
- package/dist/lib/git.js.map +1 -1
- package/dist/lib/safety.d.ts +79 -0
- package/dist/lib/safety.d.ts.map +1 -0
- package/dist/lib/safety.js +133 -0
- package/dist/lib/safety.js.map +1 -0
- package/dist/lib/secrets.d.ts +29 -0
- package/dist/lib/secrets.d.ts.map +1 -1
- package/dist/lib/secrets.js +115 -0
- package/dist/lib/secrets.js.map +1 -1
- package/dist/lib/session.d.ts +93 -0
- package/dist/lib/session.d.ts.map +1 -0
- package/dist/lib/session.js +254 -0
- package/dist/lib/session.js.map +1 -0
- package/dist/lib/types.d.ts +6 -1
- package/dist/lib/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/.claude/settings.local.json +0 -7
- package/src/commands/doctor.ts +0 -222
- package/src/commands/init.ts +0 -120
- package/src/commands/list.ts +0 -133
- package/src/commands/open.ts +0 -78
- package/src/commands/prune.ts +0 -36
- package/src/commands/rm.ts +0 -125
- package/src/commands/shell.ts +0 -99
- package/src/commands/spawn.ts +0 -169
- package/src/index.ts +0 -123
- package/src/lib/config.ts +0 -120
- package/src/lib/git.ts +0 -243
- package/src/lib/output.ts +0 -102
- package/src/lib/paths.ts +0 -108
- package/src/lib/secrets.ts +0 -193
- package/src/lib/types.ts +0 -69
- package/tests/config.test.ts +0 -102
- package/tests/paths.test.ts +0 -155
- package/tests/secrets.test.ts +0 -150
- package/tsconfig.json +0 -20
- package/vitest.config.ts +0 -15
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry completions command
|
|
3
|
+
*
|
|
4
|
+
* Generate shell completions for bash, zsh, and fish.
|
|
5
|
+
*/
|
|
6
|
+
import { getCompletions, getInstallInstructions, COMMANDS, } from '../lib/completions.js';
|
|
7
|
+
import * as out from '../lib/output.js';
|
|
8
|
+
const VALID_SHELLS = ['bash', 'zsh', 'fish'];
|
|
9
|
+
function isValidShell(shell) {
|
|
10
|
+
return VALID_SHELLS.includes(shell);
|
|
11
|
+
}
|
|
12
|
+
export async function completions(shell, options) {
|
|
13
|
+
// Determine shell from argument or option
|
|
14
|
+
const targetShell = shell ?? options.shell;
|
|
15
|
+
if (!targetShell) {
|
|
16
|
+
// Show help for all shells
|
|
17
|
+
out.header('Shell Completions');
|
|
18
|
+
out.newline();
|
|
19
|
+
out.log('Generate completions for your shell:');
|
|
20
|
+
out.newline();
|
|
21
|
+
for (const sh of VALID_SHELLS) {
|
|
22
|
+
out.log(`${out.fmt.bold(sh)}:`);
|
|
23
|
+
out.log(out.fmt.dim(getInstallInstructions(sh)));
|
|
24
|
+
out.newline();
|
|
25
|
+
}
|
|
26
|
+
out.log('Usage:');
|
|
27
|
+
out.log(` ${out.fmt.cyan('cry completions fish')} # Output fish completions`);
|
|
28
|
+
out.log(` ${out.fmt.cyan('cry completions bash')} # Output bash completions`);
|
|
29
|
+
out.log(` ${out.fmt.cyan('cry completions zsh')} # Output zsh completions`);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (!isValidShell(targetShell)) {
|
|
33
|
+
out.error(`Unknown shell: ${targetShell}`);
|
|
34
|
+
out.info(`Supported shells: ${VALID_SHELLS.join(', ')}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
// Output completions to stdout (for piping to file)
|
|
38
|
+
console.log(getCompletions(targetShell));
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get list of subcommands (for testing)
|
|
42
|
+
*/
|
|
43
|
+
export function getSubcommands() {
|
|
44
|
+
return COMMANDS.map(c => c.name);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=completions.js.map
|
|
@@ -0,0 +1 @@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C,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,sBAAsB,CAAC,+BAA+B,CAAC,CAAC;QAClF,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC,+BAA+B,CAAC,CAAC;QACjF,OAAO;IACT,CAAC;IAED,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,GAAG,CAAC,KAAK,CAAC,kBAAkB,WAAW,EAAE,CAAC,CAAC;QAC3C,GAAG,CAAC,IAAI,CAAC,qBAAqB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,oDAAoD;IACpD,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry explain-copy command
|
|
3
|
+
*
|
|
4
|
+
* Explain which files will be copied/symlinked and which are blocked.
|
|
5
|
+
* This helps users understand the security model before spawning.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExplainCopyOptions {
|
|
8
|
+
json?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function explainCopy(options: ExplainCopyOptions): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=explain-copy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain-copy.d.ts","sourceRoot":"","sources":["../../src/commands/explain-copy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4B5E"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry explain-copy command
|
|
3
|
+
*
|
|
4
|
+
* Explain which files will be copied/symlinked and which are blocked.
|
|
5
|
+
* This helps users understand the security model before spawning.
|
|
6
|
+
*/
|
|
7
|
+
import { isGitRepo, getRepoRoot, } from '../lib/git.js';
|
|
8
|
+
import { configExists, getMergedConfig, } from '../lib/config.js';
|
|
9
|
+
import { generateCopyPlan, formatCopyPlan } from '../lib/secrets.js';
|
|
10
|
+
import * as out from '../lib/output.js';
|
|
11
|
+
export async function explainCopy(options) {
|
|
12
|
+
// Check if we're in a git repo
|
|
13
|
+
if (!isGitRepo()) {
|
|
14
|
+
out.error('Not a git repository. Run this command from within a git repo.');
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
const repoRoot = getRepoRoot();
|
|
18
|
+
// Check if config exists
|
|
19
|
+
if (!configExists(repoRoot)) {
|
|
20
|
+
out.error('No .cry.json found. Run "cry init" first.');
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
const config = getMergedConfig(repoRoot);
|
|
24
|
+
// Generate the copy plan
|
|
25
|
+
const plan = await generateCopyPlan(config.include, repoRoot);
|
|
26
|
+
if (options.json) {
|
|
27
|
+
console.log(JSON.stringify(plan, null, 2));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// Print formatted output
|
|
31
|
+
out.header('Copy Plan');
|
|
32
|
+
out.log(formatCopyPlan(plan, config.defaultMode));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=explain-copy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain-copy.js","sourceRoot":"","sources":["../../src/commands/explain-copy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,S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
4
|
+
* Show session summary and optionally create PR, cleanup worktree.
|
|
5
|
+
* Safe by default - never auto-merges, never deletes without confirmation.
|
|
6
|
+
*/
|
|
7
|
+
export interface FinishOptions {
|
|
8
|
+
json?: boolean;
|
|
9
|
+
dryRun?: boolean;
|
|
10
|
+
pr?: boolean;
|
|
11
|
+
cleanup?: boolean;
|
|
12
|
+
noCleanup?: boolean;
|
|
13
|
+
nonInteractive?: boolean;
|
|
14
|
+
allowDirty?: boolean;
|
|
15
|
+
deleteBranch?: boolean;
|
|
16
|
+
message?: string;
|
|
17
|
+
skipCommit?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function finish(options: FinishOptions): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=finish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"finish.d.ts","sourceRoot":"","sources":["../../src/commands/finish.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0BH,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AA2sBD,wBAAsB,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAwMlE"}
|