claude-yolo 1.6.0 → 1.6.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 CHANGED
@@ -1,8 +1,8 @@
1
1
  # Claude YOLO
2
2
 
3
- A wrapper for the Claude CLI that always enables danger mode by bypassing Docker and internet permission checks.
3
+ A wrapper for the Claude CLI that ALWAYS enables --dangerously-skip-permissions mode AND bypasses Docker and internet permission checks so that you can run in danger mode anywhere, anytime.
4
4
 
5
- ⚠️ **SECURITY WARNING**: This wrapper bypasses important safety checks by forcibly adding the `--dangerously-skip-permissions` flag to all commands. This bypasses file access permissions that protect your system and privacy.
5
+ ⚠️ **SECURITY WARNING**: This wrapper bypasses important safety checks! This completely bypasses the "human in the loop" checks, this could delete your data, leak your secrets and even brick your computer. Use at your own risk.
6
6
 
7
7
  ## Installation
8
8
 
@@ -10,9 +10,11 @@ A wrapper for the Claude CLI that always enables danger mode by bypassing Docker
10
10
  npm install -g claude-yolo
11
11
  ```
12
12
 
13
- During installation, you will be presented with a consent prompt explaining the security implications. You must explicitly agree to continue with the installation.
13
+ The first time you run `claude-yolo`, you will be presented with a consent prompt explaining the security implications. You must explicitly agree to continue.
14
14
 
15
- ![Consent Prompt](/installation-consent.png)
15
+ <img width="750" alt="image" src="https://github.com/user-attachments/assets/f8e07cf0-6c43-4663-b9e2-f61b1afb4e99" />
16
+
17
+ Your consent choice is remembered for future runs.
16
18
 
17
19
  GitHub: [https://github.com/eastlondoner/claude-yolo](https://github.com/eastlondoner/claude-yolo)
18
20
 
@@ -35,9 +37,15 @@ This wrapper:
35
37
  5. Adds the `--dangerously-skip-permissions` flag to command line arguments
36
38
  6. Imports the modified copy of the CLI
37
39
 
40
+ ## New in Version 1.6.1
41
+
42
+ - **Runtime Consent Check**: Now requires explicit user consent on first run
43
+ - **Consent Persistence**: Remembers user consent for future runs
44
+ - **Fixed Global Installation**: Consent prompt will properly show for both local and global installations
45
+
38
46
  ## New in Version 1.6.0
39
47
 
40
- - **Installation Consent Prompt**: Now requires explicit user consent during installation
48
+ - **Installation Consent Prompt**: Added explicit user consent during installation
41
49
  - **Enhanced Security Warnings**: Clear explanations of the security implications
42
50
  - **Installation Abort Option**: Users can cancel installation if they don't agree with the security implications
43
51
 
@@ -98,4 +106,4 @@ This is an unofficial tool and not supported by Anthropic. Use at your own risk.
98
106
  - Claude may access files it normally would not have permission to access
99
107
  - You accept full responsibility for any security implications
100
108
 
101
- Anthropic designed these safety checks for good reason. Only use claude-yolo if you fully understand and accept these risks.
109
+ Anthropic designed these safety checks for good reason. Only use claude-yolo if you fully understand and accept these risks.
@@ -6,6 +6,14 @@ import path from 'path';
6
6
  import { createRequire } from 'module';
7
7
  import { fileURLToPath } from 'url';
8
8
  import { execSync } from 'child_process';
9
+ import readline from 'readline';
10
+
11
+ // ANSI color codes
12
+ const RED = '\x1b[31m';
13
+ const YELLOW = '\x1b[33m';
14
+ const CYAN = '\x1b[36m';
15
+ const RESET = '\x1b[0m';
16
+ const BOLD = '\x1b[1m';
9
17
 
10
18
  // Debug logging function that only logs if DEBUG env var is set
11
19
  const debug = (message) => {
@@ -14,6 +22,50 @@ const debug = (message) => {
14
22
  }
15
23
  };
16
24
 
25
+ // Function to ask for user consent
26
+ function askForConsent() {
27
+ return new Promise((resolve) => {
28
+ const rl = readline.createInterface({
29
+ input: process.stdin,
30
+ output: process.stdout
31
+ });
32
+
33
+ console.log(`\n${BOLD}${YELLOW}🔥 CLAUDE-YOLO INSTALLATION CONSENT REQUIRED 🔥${RESET}\n`);
34
+ console.log(`${CYAN}----------------------------------------${RESET}`);
35
+ console.log(`${BOLD}What is claude-yolo?${RESET}`);
36
+ console.log(`This package creates a wrapper around the official Claude CLI tool that:`);
37
+ console.log(` 1. ${RED}BYPASSES safety checks${RESET} by automatically adding the --dangerously-skip-permissions flag`);
38
+ console.log(` 2. Automatically updates to the latest Claude CLI version`);
39
+ console.log(` 3. Adds colorful YOLO-themed loading messages\n`);
40
+
41
+ console.log(`${BOLD}${RED}⚠️ IMPORTANT SECURITY WARNING ⚠️${RESET}`);
42
+ console.log(`The ${BOLD}--dangerously-skip-permissions${RESET} flag was designed for use in containers`);
43
+ console.log(`and bypasses important safety checks. This includes ignoring file access`);
44
+ console.log(`permissions that protect your system and privacy.\n`);
45
+
46
+ console.log(`${BOLD}By using claude-yolo:${RESET}`);
47
+ console.log(` • You acknowledge these safety checks are being bypassed`);
48
+ console.log(` • You understand this may allow Claude CLI to access sensitive files`);
49
+ console.log(` • You accept full responsibility for any security implications\n`);
50
+
51
+ console.log(`${CYAN}----------------------------------------${RESET}\n`);
52
+
53
+ rl.question(`${YELLOW}Do you consent to using claude-yolo with these modifications? (yes/no): ${RESET}`, (answer) => {
54
+ rl.close();
55
+ const lowerAnswer = answer.toLowerCase().trim();
56
+ if (lowerAnswer === 'yes' || lowerAnswer === 'y') {
57
+ console.log(`\n${YELLOW}🔥 YOLO MODE APPROVED 🔥${RESET}`);
58
+ resolve(true);
59
+ } else {
60
+ console.log(`\n${CYAN}Aborted. YOLO mode not activated.${RESET}`);
61
+ console.log(`If you want the official Claude CLI with normal safety features, run:`);
62
+ console.log(`claude`);
63
+ resolve(false);
64
+ }
65
+ });
66
+ });
67
+ }
68
+
17
69
  // Get the directory of the current module
18
70
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
19
71
  const require = createRequire(import.meta.url);
@@ -71,65 +123,96 @@ async function checkForUpdates() {
71
123
  const claudeDir = path.join(nodeModulesDir, 'node_modules', '@anthropic-ai', 'claude-code');
72
124
  const originalCliPath = path.join(claudeDir, 'cli.mjs');
73
125
  const yoloCliPath = path.join(claudeDir, 'cli-yolo.mjs');
126
+ const consentFlagPath = path.join(claudeDir, '.claude-yolo-consent');
74
127
 
75
- // Check and update Claude package first
76
- await checkForUpdates();
128
+ // Main function to run the application
129
+ async function run() {
130
+ // Check and update Claude package first
131
+ await checkForUpdates();
77
132
 
78
- if (!fs.existsSync(originalCliPath)) {
79
- console.error(`Error: ${originalCliPath} not found. Make sure @anthropic-ai/claude-code is installed.`);
80
- process.exit(1);
81
- }
82
-
83
- // Read the original CLI file content
84
- let cliContent = fs.readFileSync(originalCliPath, 'utf8');
85
-
86
- // Replace getIsDocker() calls with true
87
- cliContent = cliContent.replace(/[a-zA-Z0-9_]*\.getIsDocker\(\)/g, 'true');
88
- debug("Replaced all instances of *.getIsDocker() with true");
89
-
90
- // Replace hasInternetAccess() calls with false
91
- cliContent = cliContent.replace(/[a-zA-Z0-9_]*\.hasInternetAccess\(\)/g, 'false');
92
- debug("Replaced all instances of *.hasInternetAccess() with false");
133
+ if (!fs.existsSync(originalCliPath)) {
134
+ console.error(`Error: ${originalCliPath} not found. Make sure @anthropic-ai/claude-code is installed.`);
135
+ process.exit(1);
136
+ }
93
137
 
94
- // Add warning message
95
- console.log("\x1b[33m🔥 YOLO MODE ACTIVATED 🔥\x1b[0m");
138
+ // Check if consent is needed
139
+ const consentNeeded = !fs.existsSync(yoloCliPath) || !fs.existsSync(consentFlagPath);
140
+
141
+ // If consent is needed and not already given, ask for it
142
+ if (consentNeeded) {
143
+ const consent = await askForConsent();
144
+ if (!consent) {
145
+ // User didn't consent, exit
146
+ process.exit(1);
147
+ }
148
+
149
+ // Create a flag file to remember that consent was given
150
+ try {
151
+ fs.writeFileSync(consentFlagPath, 'consent-given');
152
+ debug("Created consent flag file");
153
+ } catch (err) {
154
+ debug(`Error creating consent flag file: ${err.message}`);
155
+ // Continue anyway
156
+ }
157
+ }
96
158
 
97
- // Replace the loading messages array with YOLO versions
98
- const originalArray = '["Accomplishing","Actioning","Actualizing","Baking","Brewing","Calculating","Cerebrating","Churning","Clauding","Coalescing","Cogitating","Computing","Conjuring","Considering","Cooking","Crafting","Creating","Crunching","Deliberating","Determining","Doing","Effecting","Finagling","Forging","Forming","Generating","Hatching","Herding","Honking","Hustling","Ideating","Inferring","Manifesting","Marinating","Moseying","Mulling","Mustering","Musing","Noodling","Percolating","Pondering","Processing","Puttering","Reticulating","Ruminating","Schlepping","Shucking","Simmering","Smooshing","Spinning","Stewing","Synthesizing","Thinking","Transmuting","Vibing","Working"]';
99
- const yoloSuffixes = [
100
- " \x1b[31m(safety's off, hold on tight)\x1b[0m",
101
- " \x1b[33m(all gas, no brakes, lfg)\x1b[0m",
102
- " \x1b[35m(yolo mode engaged)\x1b[0m",
103
- " \x1b[36m(dangerous mode! I guess you can just do things)\x1b[0m"
104
- ];
159
+ // Read the original CLI file content
160
+ let cliContent = fs.readFileSync(originalCliPath, 'utf8');
161
+
162
+ // Replace getIsDocker() calls with true
163
+ cliContent = cliContent.replace(/[a-zA-Z0-9_]*\.getIsDocker\(\)/g, 'true');
164
+ debug("Replaced all instances of *.getIsDocker() with true");
165
+
166
+ // Replace hasInternetAccess() calls with false
167
+ cliContent = cliContent.replace(/[a-zA-Z0-9_]*\.hasInternetAccess\(\)/g, 'false');
168
+ debug("Replaced all instances of *.hasInternetAccess() with false");
169
+
170
+ // Add warning message
171
+ console.log(`${YELLOW}🔥 YOLO MODE ACTIVATED 🔥${RESET}`);
172
+
173
+ // Replace the loading messages array with YOLO versions
174
+ const originalArray = '["Accomplishing","Actioning","Actualizing","Baking","Brewing","Calculating","Cerebrating","Churning","Clauding","Coalescing","Cogitating","Computing","Conjuring","Considering","Cooking","Crafting","Creating","Crunching","Deliberating","Determining","Doing","Effecting","Finagling","Forging","Forming","Generating","Hatching","Herding","Honking","Hustling","Ideating","Inferring","Manifesting","Marinating","Moseying","Mulling","Mustering","Musing","Noodling","Percolating","Pondering","Processing","Puttering","Reticulating","Ruminating","Schlepping","Shucking","Simmering","Smooshing","Spinning","Stewing","Synthesizing","Thinking","Transmuting","Vibing","Working"]';
175
+ const yoloSuffixes = [
176
+ ` ${RED}(safety's off, hold on tight)${RESET}`,
177
+ ` ${YELLOW}(all gas, no brakes, lfg)${RESET}`,
178
+ ` ${BOLD}\x1b[35m(yolo mode engaged)${RESET}`,
179
+ ` ${CYAN}(dangerous mode! I guess you can just do things)${RESET}`
180
+ ];
181
+
182
+ // Function to add a random YOLO suffix to each word in the array
183
+ const addYoloSuffixes = (arrayStr) => {
184
+ try {
185
+ const array = JSON.parse(arrayStr);
186
+ const yoloArray = array.map(word => {
187
+ const randomSuffix = yoloSuffixes[Math.floor(Math.random() * yoloSuffixes.length)];
188
+ return word + randomSuffix;
189
+ });
190
+ return JSON.stringify(yoloArray);
191
+ } catch (e) {
192
+ debug(`Error modifying loading messages array: ${e.message}`);
193
+ return arrayStr;
194
+ }
195
+ };
105
196
 
106
- // Function to add a random YOLO suffix to each word in the array
107
- const addYoloSuffixes = (arrayStr) => {
108
- try {
109
- const array = JSON.parse(arrayStr);
110
- const yoloArray = array.map(word => {
111
- const randomSuffix = yoloSuffixes[Math.floor(Math.random() * yoloSuffixes.length)];
112
- return word + randomSuffix;
113
- });
114
- return JSON.stringify(yoloArray);
115
- } catch (e) {
116
- debug(`Error modifying loading messages array: ${e.message}`);
117
- return arrayStr;
118
- }
119
- };
197
+ cliContent = cliContent.replace(originalArray, addYoloSuffixes(originalArray));
198
+ debug("Replaced loading messages with YOLO versions");
120
199
 
121
- cliContent = cliContent.replace(originalArray, addYoloSuffixes(originalArray));
122
- debug("Replaced loading messages with YOLO versions");
200
+ // Write the modified content to a new file, leaving the original untouched
201
+ fs.writeFileSync(yoloCliPath, cliContent);
202
+ debug(`Created modified CLI at ${yoloCliPath}`);
203
+ debug("Modifications complete. The --dangerously-skip-permissions flag should now work everywhere.");
123
204
 
124
- // Write the modified content to a new file, leaving the original untouched
125
- fs.writeFileSync(yoloCliPath, cliContent);
126
- debug(`Created modified CLI at ${yoloCliPath}`);
127
- debug("Modifications complete. The --dangerously-skip-permissions flag should now work everywhere.");
205
+ // Add the --dangerously-skip-permissions flag to the command line arguments
206
+ // This will ensure it's passed to the CLI even if the user didn't specify it
207
+ process.argv.splice(2, 0, '--dangerously-skip-permissions');
208
+ debug("Added --dangerously-skip-permissions flag to command line arguments");
128
209
 
129
- // Add the --dangerously-skip-permissions flag to the command line arguments
130
- // This will ensure it's passed to the CLI even if the user didn't specify it
131
- process.argv.splice(2, 0, '--dangerously-skip-permissions');
132
- debug("Added --dangerously-skip-permissions flag to command line arguments");
210
+ // Now import the modified CLI
211
+ await import(yoloCliPath);
212
+ }
133
213
 
134
- // Now import the modified CLI
135
- import(yoloCliPath);
214
+ // Run the main function
215
+ run().catch(err => {
216
+ console.error("Error:", err);
217
+ process.exit(1);
218
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-yolo",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "YOLO wrapper for Claude CLI with danger mode always enabled, auto-updates, and colorful loading messages",
5
5
  "bin": {
6
6
  "claude-yolo": "./bin/claude-yolo.js"
@@ -10,7 +10,6 @@
10
10
  },
11
11
  "type": "module",
12
12
  "scripts": {
13
- "postinstall": "node postinstall.js"
14
13
  },
15
14
  "repository": {
16
15
  "type": "git",