claude-yes 1.16.0 → 1.17.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/README.md CHANGED
@@ -8,9 +8,10 @@ A wrapper tool that automates interactions with the Claude CLI by automatically
8
8
 
9
9
  - Same as `claude` command
10
10
  - Automatically responds to common prompts like "Yes, proceed" and "Yes"
11
- - So, this will Let claude run until your task done, and wait for your next prompt.
11
+ - So, this will Let claude keep run until your task done, and wait for your next prompt.
12
+ - You can still Queue More Prompts or Cancel executing task by `ESC` or `Ctrl+C`
12
13
 
13
- ## Installation
14
+ ## Prerequirements
14
15
 
15
16
  First, install Claude Code globally:
16
17
 
@@ -28,17 +29,21 @@ npm install claude-yes -g
28
29
 
29
30
  ## Usage
30
31
 
32
+ ### claude-yes cli
33
+
31
34
  ```bash
32
- claude-yes [command] [prompts] [--exit-on-idle]
35
+ claude-yes [--exit-on-idle=60s] [claude-command] [claude-prompts]
33
36
  # works exactly same as `claude` command, and automatically says "Yes" to all yes/no prompts
34
37
 
35
38
  # e.g.
36
39
  claude-yes "run all tests and commit current changes"
37
40
  bunx claude-yes "Solve TODO.md"
38
41
 
39
- # Auto-exit when Claude becomes idle (useful for automation)
40
- claude-yes "run all tests and commit current changes" --exit-on-idle
42
+ # Auto-exit when Claude becomes idle (useful for automation scripts)
43
+ claude-yes --exit-on-idle=60s "run all tests and commit current changes"
41
44
 
45
+ # Alternative: use with claude-code-execute
46
+ claude-code-execute claude-yes "your task here"
42
47
  ```
43
48
 
44
49
  The tool will:
@@ -47,6 +52,8 @@ The tool will:
47
52
  2. Whenever claude stucked on yes/no prompts, Automatically say YES, YES, YES, YES, YES to claude
48
53
  3. When using `--exit-on-idle` flag, automatically exit when Claude becomes idle for 3 seconds (useful for automation scripts)
49
54
 
55
+ <!-- TODO: add usage As lib: call await claudeYes() and it returns render result -->
56
+
50
57
  ## Options
51
58
 
52
59
  - `--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 +72,6 @@ The tool will automatically send "\r" when it detects this pattern.
65
72
  ## Dependencies
66
73
 
67
74
  - `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
75
 
71
76
  ## Inspiration
72
77
 
@@ -0,0 +1,18 @@
1
+ export class ReadyManager {
2
+ private isReady = false;
3
+ private readyQueue: (() => void)[] = [];
4
+ wait() {
5
+ return new Promise<void>((resolve) => {
6
+ if (this.isReady) return resolve();
7
+ this.readyQueue.push(resolve);
8
+ });
9
+ }
10
+ unready() {
11
+ this.isReady = false;
12
+ }
13
+ ready() {
14
+ this.isReady = true;
15
+ if (!this.readyQueue.length) return; // check len for performance
16
+ this.readyQueue.splice(0).map((resolve) => resolve());
17
+ }
18
+ }
package/cli.ts CHANGED
@@ -14,7 +14,8 @@ const argv = yargs(hideBin(process.argv))
14
14
  .option('exit-on-idle', {
15
15
  type: 'string',
16
16
  default: '60s',
17
- description: 'Exit after being idle for specified duration',
17
+ description:
18
+ 'Exit after being idle for specified duration, default 1min, set to 0 to disable this behaviour',
18
19
  })
19
20
  .option('continue-on-crash', {
20
21
  type: 'boolean',