claude-yolo 1.5.1 → 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 +33 -3
- package/bin/claude-yolo.js +136 -53
- package/package.json +3 -1
- package/postinstall.js +52 -0
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Claude YOLO
|
|
2
2
|
|
|
3
|
-
A wrapper for the Claude CLI that
|
|
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
|
+
|
|
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.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
@@ -8,6 +10,12 @@ A wrapper for the Claude CLI that always enables danger mode by bypassing Docker
|
|
|
8
10
|
npm install -g claude-yolo
|
|
9
11
|
```
|
|
10
12
|
|
|
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
|
+
|
|
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.
|
|
18
|
+
|
|
11
19
|
GitHub: [https://github.com/eastlondoner/claude-yolo](https://github.com/eastlondoner/claude-yolo)
|
|
12
20
|
|
|
13
21
|
## Usage
|
|
@@ -29,6 +37,18 @@ This wrapper:
|
|
|
29
37
|
5. Adds the `--dangerously-skip-permissions` flag to command line arguments
|
|
30
38
|
6. Imports the modified copy of the CLI
|
|
31
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
|
+
|
|
46
|
+
## New in Version 1.6.0
|
|
47
|
+
|
|
48
|
+
- **Installation Consent Prompt**: Added explicit user consent during installation
|
|
49
|
+
- **Enhanced Security Warnings**: Clear explanations of the security implications
|
|
50
|
+
- **Installation Abort Option**: Users can cancel installation if they don't agree with the security implications
|
|
51
|
+
|
|
32
52
|
## New in Version 1.5.0
|
|
33
53
|
|
|
34
54
|
- **YOLO Mode Warning**: Displays a "🔥 YOLO MODE ACTIVATED 🔥" warning in yellow text
|
|
@@ -74,6 +94,16 @@ Claude YOLO automatically checks for updates to the Claude package each time it
|
|
|
74
94
|
- Notify you that an update was applied
|
|
75
95
|
3. This ensures you're always using the latest Claude CLI features
|
|
76
96
|
|
|
77
|
-
## Disclaimer
|
|
97
|
+
## Important Security Disclaimer
|
|
98
|
+
|
|
99
|
+
This is an unofficial tool and not supported by Anthropic. Use at your own risk.
|
|
78
100
|
|
|
79
|
-
|
|
101
|
+
**SECURITY WARNING**:
|
|
102
|
+
- This tool bypasses safety mechanisms intentionally built into the Claude CLI
|
|
103
|
+
- The `--dangerously-skip-permissions` flag was designed for use in container environments
|
|
104
|
+
- By using this tool, you acknowledge that:
|
|
105
|
+
- Important safety checks are being bypassed
|
|
106
|
+
- Claude may access files it normally would not have permission to access
|
|
107
|
+
- You accept full responsibility for any security implications
|
|
108
|
+
|
|
109
|
+
Anthropic designed these safety checks for good reason. Only use claude-yolo if you fully understand and accept these risks.
|
package/bin/claude-yolo.js
CHANGED
|
@@ -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
|
-
//
|
|
76
|
-
|
|
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
|
-
|
|
80
|
-
|
|
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
|
-
//
|
|
95
|
-
|
|
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
|
-
//
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"
|
|
103
|
-
|
|
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
|
-
|
|
107
|
-
|
|
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
|
-
|
|
122
|
-
|
|
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
|
-
//
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
debug("
|
|
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
|
-
//
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
//
|
|
135
|
-
|
|
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.
|
|
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"
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"@anthropic-ai/claude-code": "0.2.14"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
|
+
"scripts": {
|
|
13
|
+
},
|
|
12
14
|
"repository": {
|
|
13
15
|
"type": "git",
|
|
14
16
|
"url": "git+https://github.com/eastlondoner/claude-yolo.git"
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import readline from 'readline';
|
|
4
|
+
|
|
5
|
+
// ANSI color codes
|
|
6
|
+
const RED = '\x1b[31m';
|
|
7
|
+
const YELLOW = '\x1b[33m';
|
|
8
|
+
const CYAN = '\x1b[36m';
|
|
9
|
+
const RESET = '\x1b[0m';
|
|
10
|
+
const BOLD = '\x1b[1m';
|
|
11
|
+
|
|
12
|
+
// Create readline interface for user input
|
|
13
|
+
const rl = readline.createInterface({
|
|
14
|
+
input: process.stdin,
|
|
15
|
+
output: process.stdout
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
console.log(`\n${BOLD}${YELLOW}🔥 CLAUDE-YOLO INSTALLATION CONSENT REQUIRED 🔥${RESET}\n`);
|
|
19
|
+
console.log(`${CYAN}----------------------------------------${RESET}`);
|
|
20
|
+
console.log(`${BOLD}What is claude-yolo?${RESET}`);
|
|
21
|
+
console.log(`This package creates a wrapper around the official Claude CLI tool that:`);
|
|
22
|
+
console.log(` 1. ${RED}BYPASSES safety checks${RESET} by automatically adding the --dangerously-skip-permissions flag`);
|
|
23
|
+
console.log(` 2. Automatically updates to the latest Claude CLI version`);
|
|
24
|
+
console.log(` 3. Adds colorful YOLO-themed loading messages\n`);
|
|
25
|
+
|
|
26
|
+
console.log(`${BOLD}${RED}⚠️ IMPORTANT SECURITY WARNING ⚠️${RESET}`);
|
|
27
|
+
console.log(`The ${BOLD}--dangerously-skip-permissions${RESET} flag was designed for use in containers`);
|
|
28
|
+
console.log(`and bypasses important safety checks. This includes ignoring file access`);
|
|
29
|
+
console.log(`permissions that protect your system and privacy.\n`);
|
|
30
|
+
|
|
31
|
+
console.log(`${BOLD}By using claude-yolo:${RESET}`);
|
|
32
|
+
console.log(` • You acknowledge these safety checks are being bypassed`);
|
|
33
|
+
console.log(` • You understand this may allow Claude CLI to access sensitive files`);
|
|
34
|
+
console.log(` • You accept full responsibility for any security implications\n`);
|
|
35
|
+
|
|
36
|
+
console.log(`${CYAN}----------------------------------------${RESET}\n`);
|
|
37
|
+
|
|
38
|
+
// Ask for explicit consent
|
|
39
|
+
rl.question(`${YELLOW}Do you consent to installing claude-yolo with these modifications? (yes/no): ${RESET}`, (answer) => {
|
|
40
|
+
const lowerAnswer = answer.toLowerCase().trim();
|
|
41
|
+
|
|
42
|
+
if (lowerAnswer === 'yes' || lowerAnswer === 'y') {
|
|
43
|
+
console.log(`\n${YELLOW}🔥 YOLO MODE INSTALLATION APPROVED 🔥${RESET}`);
|
|
44
|
+
console.log(`Installation will continue. Use 'claude-yolo' instead of 'claude' to run in YOLO mode.`);
|
|
45
|
+
process.exit(0); // Success exit code
|
|
46
|
+
} else {
|
|
47
|
+
console.log(`\n${CYAN}Installation cancelled by user.${RESET}`);
|
|
48
|
+
console.log(`If you want the official Claude CLI with normal safety features, run:`);
|
|
49
|
+
console.log(`npm install -g @anthropic-ai/claude-code`);
|
|
50
|
+
process.exit(1); // Error exit code to abort installation
|
|
51
|
+
}
|
|
52
|
+
});
|