claude-yolo-extended 1.8.0 → 1.8.2
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/CLAUDE.md +76 -0
- package/README.md +69 -3
- package/bin/cl.js +151 -0
- package/package.json +2 -5
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Claude YOLO Extended - Project Information
|
|
2
|
+
|
|
3
|
+
This document contains important information about the Claude YOLO Extended project for AI assistants.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Claude YOLO Extended is a wrapper for the Claude CLI that provides:
|
|
8
|
+
- **YOLO Mode**: Bypasses safety checks (use with caution)
|
|
9
|
+
- **SAFE Mode**: Standard Claude CLI behavior with all safety checks
|
|
10
|
+
- **Cross-Platform Support**: Works on Windows, Ubuntu, and other Unix systems
|
|
11
|
+
- **Auto-Update**: Automatically updates to the latest Claude CLI version
|
|
12
|
+
|
|
13
|
+
## Installation Methods
|
|
14
|
+
|
|
15
|
+
### From npm (Recommended for users)
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g claude-yolo-extended
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### From source (For development)
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.com/jslitzkerttcu/claude-yolo.git
|
|
23
|
+
cd claude-yolo
|
|
24
|
+
npm install
|
|
25
|
+
npm link
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Key Commands
|
|
29
|
+
|
|
30
|
+
- `claude-yolo-extended` - Run in current mode (default: YOLO)
|
|
31
|
+
- `claude-yolo-extended --safe` - Run in SAFE mode
|
|
32
|
+
- `claude-yolo-extended mode yolo` - Switch to YOLO mode
|
|
33
|
+
- `claude-yolo-extended mode safe` - Switch to SAFE mode
|
|
34
|
+
- `cl /YON` - Enable YOLO mode and start Claude
|
|
35
|
+
- `cl /YOFF` - Enable SAFE mode and start Claude
|
|
36
|
+
|
|
37
|
+
## Development Workflow
|
|
38
|
+
|
|
39
|
+
### Making Changes
|
|
40
|
+
|
|
41
|
+
1. Make code changes
|
|
42
|
+
2. Test locally with `npm link`
|
|
43
|
+
3. Run `claude-yolo-extended --help` to verify
|
|
44
|
+
|
|
45
|
+
### Publishing Updates
|
|
46
|
+
|
|
47
|
+
1. Update version: `npm version patch|minor|major`
|
|
48
|
+
2. Publish: `npm publish`
|
|
49
|
+
3. Push to GitHub: `git push origin main --tags`
|
|
50
|
+
|
|
51
|
+
### Version Strategy
|
|
52
|
+
|
|
53
|
+
- **patch**: Bug fixes (1.8.0 -> 1.8.1)
|
|
54
|
+
- **minor**: New features (1.8.0 -> 1.9.0)
|
|
55
|
+
- **major**: Breaking changes (1.8.0 -> 2.0.0)
|
|
56
|
+
|
|
57
|
+
## Important Files
|
|
58
|
+
|
|
59
|
+
- `bin/claude-yolo.js` - Main wrapper script
|
|
60
|
+
- `bin/cl` - Bash convenience wrapper
|
|
61
|
+
- `bin/cl.ps1` - PowerShell convenience wrapper
|
|
62
|
+
- `package.json` - Project configuration
|
|
63
|
+
- `.npmignore` - Files excluded from npm package
|
|
64
|
+
|
|
65
|
+
## Security Considerations
|
|
66
|
+
|
|
67
|
+
- YOLO mode bypasses important safety checks
|
|
68
|
+
- The tool modifies Claude CLI behavior at runtime
|
|
69
|
+
- Consent is required on first run
|
|
70
|
+
- Mode preference is stored in `~/.claude_yolo_state`
|
|
71
|
+
|
|
72
|
+
## Project URLs
|
|
73
|
+
|
|
74
|
+
- **npm Package**: https://www.npmjs.com/package/claude-yolo-extended
|
|
75
|
+
- **GitHub Repository**: https://github.com/jslitzkerttcu/claude-yolo
|
|
76
|
+
- **Issues**: https://github.com/jslitzkerttcu/claude-yolo/issues
|
package/README.md
CHANGED
|
@@ -16,10 +16,19 @@ A wrapper for the Claude CLI that can run in YOLO mode (bypassing all safety che
|
|
|
16
16
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
|
+
### Option 1: Install from npm (Recommended)
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Install globally from npm
|
|
23
|
+
npm install -g claude-yolo-extended
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Option 2: Install from source
|
|
27
|
+
|
|
19
28
|
```bash
|
|
20
29
|
# Clone the repository
|
|
21
|
-
git clone https://github.com/jslitzkerttcu/claude-yolo
|
|
22
|
-
cd claude-yolo
|
|
30
|
+
git clone https://github.com/jslitzkerttcu/claude-yolo.git
|
|
31
|
+
cd claude-yolo
|
|
23
32
|
|
|
24
33
|
# Install dependencies
|
|
25
34
|
npm install
|
|
@@ -175,4 +184,61 @@ This is an unofficial tool and not supported by Anthropic. Use at your own risk.
|
|
|
175
184
|
- Running as root with bypassed permissions is extremely dangerous
|
|
176
185
|
- You accept full responsibility for any security implications
|
|
177
186
|
|
|
178
|
-
Anthropic designed these safety checks for good reason. Only use YOLO mode if you fully understand and accept these risks. Use SAFE mode when you want the standard Claude CLI protections.
|
|
187
|
+
Anthropic designed these safety checks for good reason. Only use YOLO mode if you fully understand and accept these risks. Use SAFE mode when you want the standard Claude CLI protections.
|
|
188
|
+
|
|
189
|
+
## Development & Contributing
|
|
190
|
+
|
|
191
|
+
### Making Changes
|
|
192
|
+
|
|
193
|
+
1. Clone the repository:
|
|
194
|
+
```bash
|
|
195
|
+
git clone https://github.com/jslitzkerttcu/claude-yolo.git
|
|
196
|
+
cd claude-yolo
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
2. Install dependencies:
|
|
200
|
+
```bash
|
|
201
|
+
npm install
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
3. Link locally for testing:
|
|
205
|
+
```bash
|
|
206
|
+
npm link
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
4. Test your changes:
|
|
210
|
+
```bash
|
|
211
|
+
claude-yolo-extended --help
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Publishing Updates
|
|
215
|
+
|
|
216
|
+
1. Make your changes and test thoroughly
|
|
217
|
+
|
|
218
|
+
2. Update the version number:
|
|
219
|
+
```bash
|
|
220
|
+
# For bug fixes (1.8.0 -> 1.8.1)
|
|
221
|
+
npm version patch
|
|
222
|
+
|
|
223
|
+
# For new features (1.8.0 -> 1.9.0)
|
|
224
|
+
npm version minor
|
|
225
|
+
|
|
226
|
+
# For breaking changes (1.8.0 -> 2.0.0)
|
|
227
|
+
npm version major
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
3. Publish to npm:
|
|
231
|
+
```bash
|
|
232
|
+
npm publish
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
4. Push changes to GitHub:
|
|
236
|
+
```bash
|
|
237
|
+
git push origin main --tags
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Version Guidelines
|
|
241
|
+
|
|
242
|
+
- **Patch** (x.x.1): Bug fixes, typo corrections, small tweaks
|
|
243
|
+
- **Minor** (x.1.0): New features, improvements that don't break existing functionality
|
|
244
|
+
- **Major** (2.0.0): Breaking changes, major rewrites, incompatible API changes
|
package/bin/cl.js
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { spawn } from 'child_process';
|
|
6
|
+
import os from 'os';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
|
|
9
|
+
// Get the directory of the current module
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
|
|
12
|
+
// ANSI color codes
|
|
13
|
+
const RED = '\x1b[31m';
|
|
14
|
+
const YELLOW = '\x1b[33m';
|
|
15
|
+
const CYAN = '\x1b[36m';
|
|
16
|
+
const GREEN = '\x1b[32m';
|
|
17
|
+
const RESET = '\x1b[0m';
|
|
18
|
+
const BOLD = '\x1b[1m';
|
|
19
|
+
|
|
20
|
+
// State file path
|
|
21
|
+
const stateFile = path.join(os.homedir(), '.claude_yolo_state');
|
|
22
|
+
|
|
23
|
+
// Function to get current mode
|
|
24
|
+
function getMode() {
|
|
25
|
+
try {
|
|
26
|
+
return fs.readFileSync(stateFile, 'utf8').trim();
|
|
27
|
+
} catch {
|
|
28
|
+
return 'YOLO'; // Default to YOLO mode (matches claude-yolo-extended behavior)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Function to set mode
|
|
33
|
+
function setMode(mode) {
|
|
34
|
+
fs.writeFileSync(stateFile, mode);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Get command line arguments
|
|
38
|
+
const args = process.argv.slice(2);
|
|
39
|
+
|
|
40
|
+
// Handle special commands
|
|
41
|
+
if (args.length > 0) {
|
|
42
|
+
const command = args[0].toUpperCase();
|
|
43
|
+
|
|
44
|
+
switch (command) {
|
|
45
|
+
case '/YON':
|
|
46
|
+
console.log(`${YELLOW}${BOLD}🔥 ACTIVATING YOLO MODE 🔥${RESET}`);
|
|
47
|
+
console.log(`${RED}⚠️ WARNING: All safety checks will be DISABLED!${RESET}`);
|
|
48
|
+
console.log(`${RED}⚠️ Claude can access ANY file without asking!${RESET}`);
|
|
49
|
+
setMode('YOLO');
|
|
50
|
+
console.log(`${YELLOW}✓ YOLO mode is now ON${RESET}`);
|
|
51
|
+
|
|
52
|
+
// Auto-start with remaining args
|
|
53
|
+
if (args.length > 1) {
|
|
54
|
+
runClaude(args.slice(1));
|
|
55
|
+
} else {
|
|
56
|
+
runClaude([]);
|
|
57
|
+
}
|
|
58
|
+
break;
|
|
59
|
+
|
|
60
|
+
case '/YOFF':
|
|
61
|
+
console.log(`${CYAN}${BOLD}🛡️ ACTIVATING SAFE MODE 🛡️${RESET}`);
|
|
62
|
+
console.log(`${GREEN}✓ Safety checks will be enabled${RESET}`);
|
|
63
|
+
console.log(`${GREEN}✓ Claude will ask for permissions${RESET}`);
|
|
64
|
+
setMode('SAFE');
|
|
65
|
+
console.log(`${CYAN}✓ YOLO mode is now OFF (Safe mode ON)${RESET}`);
|
|
66
|
+
|
|
67
|
+
// Auto-start with remaining args
|
|
68
|
+
if (args.length > 1) {
|
|
69
|
+
runClaude(args.slice(1));
|
|
70
|
+
} else {
|
|
71
|
+
runClaude([]);
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
|
|
75
|
+
case '/STATUS':
|
|
76
|
+
const mode = getMode();
|
|
77
|
+
console.log(`${BOLD}Claude CLI Status:${RESET}`);
|
|
78
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
79
|
+
if (mode === 'YOLO') {
|
|
80
|
+
console.log(`Mode: ${YELLOW}${BOLD}YOLO${RESET} 🔥`);
|
|
81
|
+
console.log(`Safety: ${RED}DISABLED${RESET}`);
|
|
82
|
+
console.log(`Permissions: ${RED}BYPASSED${RESET}`);
|
|
83
|
+
} else {
|
|
84
|
+
console.log(`Mode: ${CYAN}${BOLD}SAFE${RESET} 🛡️`);
|
|
85
|
+
console.log(`Safety: ${GREEN}ENABLED${RESET}`);
|
|
86
|
+
console.log(`Permissions: ${GREEN}REQUIRED${RESET}`);
|
|
87
|
+
}
|
|
88
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
89
|
+
break;
|
|
90
|
+
|
|
91
|
+
case '/HELP':
|
|
92
|
+
case '/H':
|
|
93
|
+
case '/?':
|
|
94
|
+
console.log(`${BOLD}Claude CLI Wrapper - Help${RESET}`);
|
|
95
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
96
|
+
console.log(`${CYAN}cl /YON${RESET} - Enable YOLO mode (bypass safety)`);
|
|
97
|
+
console.log(`${CYAN}cl /YOFF${RESET} - Disable YOLO mode (safe mode)`);
|
|
98
|
+
console.log(`${CYAN}cl /STATUS${RESET} - Show current mode`);
|
|
99
|
+
console.log(`${CYAN}cl /HELP${RESET} - Show this help`);
|
|
100
|
+
console.log(`${CYAN}cl [args]${RESET} - Run claude with current mode`);
|
|
101
|
+
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
102
|
+
console.log('');
|
|
103
|
+
console.log(`${BOLD}Examples:${RESET}`);
|
|
104
|
+
console.log(' cl /YON # Enable YOLO mode');
|
|
105
|
+
console.log(' cl /YOFF # Enable SAFE mode');
|
|
106
|
+
console.log(' cl "write a function" # Run Claude in current mode');
|
|
107
|
+
console.log('');
|
|
108
|
+
console.log(`${BOLD}Mode Persistence:${RESET}`);
|
|
109
|
+
console.log('Your mode choice is saved in ~/.claude_yolo_state');
|
|
110
|
+
console.log('and persists between terminal sessions.');
|
|
111
|
+
break;
|
|
112
|
+
|
|
113
|
+
default:
|
|
114
|
+
// Run Claude with provided arguments
|
|
115
|
+
runClaude(args);
|
|
116
|
+
}
|
|
117
|
+
} else {
|
|
118
|
+
// No arguments, just run Claude
|
|
119
|
+
runClaude([]);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function runClaude(claudeArgs) {
|
|
123
|
+
const mode = getMode();
|
|
124
|
+
|
|
125
|
+
// Show current mode
|
|
126
|
+
if (mode === 'YOLO') {
|
|
127
|
+
console.log(`${YELLOW}[YOLO]${RESET} Running Claude in YOLO mode...`);
|
|
128
|
+
} else {
|
|
129
|
+
console.log(`${CYAN}[SAFE]${RESET} Running Claude in SAFE mode...`);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Determine which command to run
|
|
133
|
+
const command = 'claude-yolo-extended';
|
|
134
|
+
const commandArgs = mode === 'SAFE' ? ['--safe', ...claudeArgs] : claudeArgs;
|
|
135
|
+
|
|
136
|
+
// Spawn the process
|
|
137
|
+
const child = spawn(command, commandArgs, {
|
|
138
|
+
stdio: 'inherit',
|
|
139
|
+
shell: true
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
child.on('error', (err) => {
|
|
143
|
+
console.error(`${RED}Error: Failed to start ${command}${RESET}`);
|
|
144
|
+
console.error(err.message);
|
|
145
|
+
process.exit(1);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
child.on('exit', (code) => {
|
|
149
|
+
process.exit(code || 0);
|
|
150
|
+
});
|
|
151
|
+
}
|
package/package.json
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-yolo-extended",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"description": "Claude CLI wrapper with YOLO mode (bypass safety) and SAFE mode support, auto-updates, and colorful loading messages",
|
|
5
5
|
"bin": {
|
|
6
6
|
"claude-yolo-extended": "bin/claude-yolo.js",
|
|
7
|
-
"cl": "bin/cl"
|
|
7
|
+
"cl": "bin/cl.js"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"punycode": "latest",
|
|
11
11
|
"@anthropic-ai/claude-code": "1.0.53"
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
|
-
"scripts": {
|
|
15
|
-
"postinstall": "node -e \"require('fs').chmodSync('./bin/cl', 0o755);\""
|
|
16
|
-
},
|
|
17
14
|
"repository": {
|
|
18
15
|
"type": "git",
|
|
19
16
|
"url": "git+https://github.com/jslitzkerttcu/claude-yolo.git"
|