claude-yes 1.15.1 → 1.16.1
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/README.md +8 -7
- package/dist/cli.js +11 -7
- package/dist/cli.js.map +170 -0
- package/dist/index.js +11 -7
- package/dist/index.js.map +128 -0
- package/index.ts +15 -11
- package/package.json +40 -40
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ A wrapper tool that automates interactions with the Claude CLI by automatically
|
|
|
10
10
|
- Automatically responds to common prompts like "Yes, proceed" and "Yes"
|
|
11
11
|
- So, this will Let claude run until your task done, and wait for your next prompt.
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Prerequirements
|
|
14
14
|
|
|
15
15
|
First, install Claude Code globally:
|
|
16
16
|
|
|
@@ -28,17 +28,18 @@ npm install claude-yes -g
|
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
30
30
|
|
|
31
|
+
### claude-yes cli
|
|
32
|
+
|
|
31
33
|
```bash
|
|
32
|
-
claude-yes [
|
|
34
|
+
claude-yes [--exit-on-idle=60s] [claude-command] [claude-prompts]
|
|
33
35
|
# works exactly same as `claude` command, and automatically says "Yes" to all yes/no prompts
|
|
34
36
|
|
|
35
37
|
# e.g.
|
|
36
38
|
claude-yes "run all tests and commit current changes"
|
|
37
39
|
bunx claude-yes "Solve TODO.md"
|
|
38
40
|
|
|
39
|
-
# Auto-exit when Claude becomes idle (useful for automation)
|
|
40
|
-
claude-yes "run all tests and commit current changes"
|
|
41
|
-
|
|
41
|
+
# Auto-exit when Claude becomes idle (useful for automation scripts)
|
|
42
|
+
claude-yes --exit-on-idle=60s "run all tests and commit current changes"
|
|
42
43
|
```
|
|
43
44
|
|
|
44
45
|
The tool will:
|
|
@@ -47,6 +48,8 @@ The tool will:
|
|
|
47
48
|
2. Whenever claude stucked on yes/no prompts, Automatically say YES, YES, YES, YES, YES to claude
|
|
48
49
|
3. When using `--exit-on-idle` flag, automatically exit when Claude becomes idle for 3 seconds (useful for automation scripts)
|
|
49
50
|
|
|
51
|
+
<!-- TODO: add usage As lib: call await claudeYes() and it returns render result -->
|
|
52
|
+
|
|
50
53
|
## Options
|
|
51
54
|
|
|
52
55
|
- `--exit-on-idle`: Automatically exit when Claude becomes idle for 3 seconds. Useful for automation scripts where you want the process to terminate when Claude finishes its work.
|
|
@@ -65,8 +68,6 @@ The tool will automatically send "\r" when it detects this pattern.
|
|
|
65
68
|
## Dependencies
|
|
66
69
|
|
|
67
70
|
- `node-pty` - For spawning and managing the Claude CLI process
|
|
68
|
-
- `sflow` - For stream processing and data flow management
|
|
69
|
-
- `from-node-stream` - For converting Node.js streams to web streams
|
|
70
71
|
|
|
71
72
|
## Inspiration
|
|
72
73
|
|
package/dist/cli.js
CHANGED
|
@@ -5120,12 +5120,13 @@ import { writeFile } from "fs/promises";
|
|
|
5120
5120
|
import path2 from "path";
|
|
5121
5121
|
import { mkdir } from "fs/promises";
|
|
5122
5122
|
async function claudeYes({
|
|
5123
|
-
continueOnCrash,
|
|
5124
|
-
exitOnIdle,
|
|
5125
5123
|
claudeArgs = [],
|
|
5124
|
+
continueOnCrash,
|
|
5126
5125
|
cwd = process.cwd(),
|
|
5127
|
-
|
|
5126
|
+
env = process.env,
|
|
5127
|
+
exitOnIdle,
|
|
5128
5128
|
logFile,
|
|
5129
|
+
removeControlCharactersFromStdout = false,
|
|
5129
5130
|
verbose = false
|
|
5130
5131
|
} = {}) {
|
|
5131
5132
|
if (verbose) {
|
|
@@ -5147,13 +5148,13 @@ async function claudeYes({
|
|
|
5147
5148
|
let errorNoConversation = false;
|
|
5148
5149
|
const shellOutputStream = new TransformStream;
|
|
5149
5150
|
const outputWriter = shellOutputStream.writable.getWriter();
|
|
5150
|
-
const pty =
|
|
5151
|
+
const pty = process.versions.bun ? await import("bun-pty") : await import("node-pty");
|
|
5151
5152
|
let shell = pty.spawn("claude", claudeArgs, {
|
|
5152
5153
|
name: "xterm-color",
|
|
5153
5154
|
cols: process.stdout.columns - PREFIXLENGTH,
|
|
5154
5155
|
rows: process.stdout.rows,
|
|
5155
5156
|
cwd,
|
|
5156
|
-
env
|
|
5157
|
+
env
|
|
5157
5158
|
});
|
|
5158
5159
|
let pendingExitCode = Promise.withResolvers();
|
|
5159
5160
|
async function onData(data) {
|
|
@@ -5167,12 +5168,12 @@ async function claudeYes({
|
|
|
5167
5168
|
return pendingExitCode.resolve(exitCode2);
|
|
5168
5169
|
}
|
|
5169
5170
|
console.log("Claude crashed, restarting...");
|
|
5170
|
-
shell = pty.spawn("claude", ["continue", "
|
|
5171
|
+
shell = pty.spawn("claude", ["--continue", "continue"], {
|
|
5171
5172
|
name: "xterm-color",
|
|
5172
5173
|
cols: process.stdout.columns - PREFIXLENGTH,
|
|
5173
5174
|
rows: process.stdout.rows,
|
|
5174
5175
|
cwd,
|
|
5175
|
-
env
|
|
5176
|
+
env
|
|
5176
5177
|
});
|
|
5177
5178
|
shell.onData(onData);
|
|
5178
5179
|
shell.onExit(onExit);
|
|
@@ -11418,3 +11419,6 @@ var { exitCode, logs: logs2 } = await claudeYes({
|
|
|
11418
11419
|
verbose: argv.verbose
|
|
11419
11420
|
});
|
|
11420
11421
|
process.exit(exitCode ?? 1);
|
|
11422
|
+
|
|
11423
|
+
//# debugId=60C91F29E6CD011A64756E2164756E21
|
|
11424
|
+
//# sourceMappingURL=cli.js.map
|