claude-dojo 1.2.0 → 1.2.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 +12 -0
- package/bin/claude-dojo.js +40 -1
- package/package.json +1 -1
- package/server/dist/claudeService.js +10 -0
package/README.md
CHANGED
|
@@ -38,6 +38,18 @@ npx claude-dojo
|
|
|
38
38
|
|
|
39
39
|
This starts the server and opens the dashboard in your browser at `http://localhost:3001`.
|
|
40
40
|
|
|
41
|
+
### CLI Options
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx claude-dojo [options]
|
|
45
|
+
|
|
46
|
+
Options:
|
|
47
|
+
--dangerously-skip-permissions Skip all permission prompts (auto-approve everything)
|
|
48
|
+
--help, -h Show help message
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**Warning**: The `--dangerously-skip-permissions` flag will auto-approve all file writes and shell commands without prompting. Use with caution and only in trusted environments.
|
|
52
|
+
|
|
41
53
|
### Upgrading
|
|
42
54
|
|
|
43
55
|
```bash
|
package/bin/claude-dojo.js
CHANGED
|
@@ -8,6 +8,29 @@ import { existsSync } from 'fs';
|
|
|
8
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
9
|
const __dirname = dirname(__filename);
|
|
10
10
|
|
|
11
|
+
// Parse command line arguments
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
const DANGEROUSLY_SKIP_PERMISSIONS = args.includes('--dangerously-skip-permissions');
|
|
14
|
+
const HELP = args.includes('--help') || args.includes('-h');
|
|
15
|
+
|
|
16
|
+
// Show help
|
|
17
|
+
if (HELP) {
|
|
18
|
+
console.log(`
|
|
19
|
+
Usage: claude-dojo [options]
|
|
20
|
+
|
|
21
|
+
Options:
|
|
22
|
+
--dangerously-skip-permissions Skip all permission prompts (use with caution!)
|
|
23
|
+
--help, -h Show this help message
|
|
24
|
+
|
|
25
|
+
Environment Variables:
|
|
26
|
+
PORT Server port (default: 3001)
|
|
27
|
+
CLAUDE_DOJO_NO_BROWSER Set to '1' to disable auto-opening browser
|
|
28
|
+
ANTHROPIC_API_KEY Your Anthropic API key
|
|
29
|
+
CLAUDE_CODE_USE_BEDROCK Set to '1' to use AWS Bedrock
|
|
30
|
+
`);
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
11
34
|
const PORT = process.env.PORT || 3001;
|
|
12
35
|
const OPEN_BROWSER = process.env.CLAUDE_DOJO_NO_BROWSER !== '1';
|
|
13
36
|
|
|
@@ -52,10 +75,26 @@ console.log(`
|
|
|
52
75
|
|
|
53
76
|
console.log(`Starting server on http://localhost:${PORT}...`);
|
|
54
77
|
|
|
78
|
+
// Show warning if skipping permissions
|
|
79
|
+
if (DANGEROUSLY_SKIP_PERMISSIONS) {
|
|
80
|
+
console.log(`
|
|
81
|
+
\x1b[33m╔════════════════════════════════════════════════════════════════╗
|
|
82
|
+
║ ⚠️ WARNING: Running with --dangerously-skip-permissions ║
|
|
83
|
+
║ ║
|
|
84
|
+
║ All file writes and shell commands will execute automatically ║
|
|
85
|
+
║ without asking for confirmation. Use with caution! ║
|
|
86
|
+
╚════════════════════════════════════════════════════════════════╝\x1b[0m
|
|
87
|
+
`);
|
|
88
|
+
}
|
|
89
|
+
|
|
55
90
|
// Start the server
|
|
56
91
|
const server = spawn('node', [serverPath], {
|
|
57
92
|
stdio: 'inherit',
|
|
58
|
-
env: {
|
|
93
|
+
env: {
|
|
94
|
+
...process.env,
|
|
95
|
+
PORT: String(PORT),
|
|
96
|
+
CLAUDE_DOJO_SKIP_PERMISSIONS: DANGEROUSLY_SKIP_PERMISSIONS ? '1' : '',
|
|
97
|
+
},
|
|
59
98
|
});
|
|
60
99
|
|
|
61
100
|
server.on('error', (err) => {
|
package/package.json
CHANGED
|
@@ -9,6 +9,8 @@ import { glob } from 'glob';
|
|
|
9
9
|
const execAsync = promisify(exec);
|
|
10
10
|
// Check if we should use Bedrock (only if explicitly set)
|
|
11
11
|
const USE_BEDROCK = process.env.CLAUDE_CODE_USE_BEDROCK === '1' || process.env.CLAUDE_CODE_USE_BEDROCK === 'true';
|
|
12
|
+
// Check if we should skip permission prompts
|
|
13
|
+
const SKIP_PERMISSIONS = process.env.CLAUDE_DOJO_SKIP_PERMISSIONS === '1';
|
|
12
14
|
// Model mapping for Bedrock
|
|
13
15
|
const BEDROCK_MODEL = process.env.ANTHROPIC_MODEL || 'anthropic.claude-sonnet-4-20250514-v1:0';
|
|
14
16
|
const ANTHROPIC_MODEL = process.env.ANTHROPIC_MODEL || 'claude-sonnet-4-20250514';
|
|
@@ -110,6 +112,9 @@ class ClaudeService {
|
|
|
110
112
|
console.log('Using Anthropic API directly');
|
|
111
113
|
this.client = new Anthropic();
|
|
112
114
|
}
|
|
115
|
+
if (SKIP_PERMISSIONS) {
|
|
116
|
+
console.log('\x1b[33m[WARNING] Permission prompts disabled - all operations will be auto-approved\x1b[0m');
|
|
117
|
+
}
|
|
113
118
|
}
|
|
114
119
|
// Lazy initialization of client (needed for async Bedrock import)
|
|
115
120
|
async getClient() {
|
|
@@ -179,6 +184,11 @@ class ClaudeService {
|
|
|
179
184
|
}
|
|
180
185
|
// Request permission from user
|
|
181
186
|
async requestPermission(sessionId, type, tool, description, details) {
|
|
187
|
+
// If skip permissions is enabled, auto-allow everything
|
|
188
|
+
if (SKIP_PERMISSIONS) {
|
|
189
|
+
console.log(`[SKIP_PERMISSIONS] Auto-allowing: ${description}`);
|
|
190
|
+
return 'allow_once';
|
|
191
|
+
}
|
|
182
192
|
// Check if already granted
|
|
183
193
|
if (this.hasPermission(sessionId, type, details)) {
|
|
184
194
|
return 'allow_once'; // Already allowed, treat as allow
|