cc-permissions 0.1.2 → 0.1.11
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 +126 -153
- package/dist/analyze.d.ts.map +1 -1
- package/dist/analyze.js +304 -28
- package/dist/analyze.js.map +1 -1
- package/dist/cli.js +120 -14
- package/dist/cli.js.map +1 -1
- package/dist/permissions.d.ts +9 -0
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +17 -1
- package/dist/permissions.js.map +1 -1
- package/dist/templates/loader.d.ts.map +1 -1
- package/dist/templates/loader.js +41 -1
- package/dist/templates/loader.js.map +1 -1
- package/dist/types.d.ts +12 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -2
- package/templates/android.jsonc +1 -1
- package/templates/aws.jsonc +1 -1
- package/templates/azure.jsonc +3 -3
- package/templates/database.jsonc +5 -1
- package/templates/docker.jsonc +1 -1
- package/templates/dotnet.jsonc +3 -2
- package/templates/flutter.jsonc +1 -1
- package/templates/gcp.jsonc +1 -1
- package/templates/git.jsonc +3 -2
- package/templates/gitea.jsonc +206 -0
- package/templates/github.jsonc +4 -3
- package/templates/gitlab.jsonc +182 -0
- package/templates/go.jsonc +1 -1
- package/templates/ios.jsonc +1 -1
- package/templates/java.jsonc +1 -1
- package/templates/kubernetes.jsonc +2 -3
- package/templates/nodejs.jsonc +1 -1
- package/templates/php.jsonc +1 -1
- package/templates/playwright.jsonc +61 -0
- package/templates/python.jsonc +1 -1
- package/templates/ruby.jsonc +1 -1
- package/templates/rust.jsonc +1 -1
- package/templates/shell.jsonc +2 -4
- package/templates/template.schema.json +20 -0
- package/templates/terraform.jsonc +1 -1
- package/dist/templates/cache.d.ts +0 -71
- package/dist/templates/cache.d.ts.map +0 -1
- package/dist/templates/cache.js +0 -137
- package/dist/templates/cache.js.map +0 -1
- package/dist/templates/dotnet.d.ts +0 -3
- package/dist/templates/dotnet.d.ts.map +0 -1
- package/dist/templates/dotnet.js +0 -76
- package/dist/templates/dotnet.js.map +0 -1
- package/dist/templates/general.d.ts +0 -3
- package/dist/templates/general.d.ts.map +0 -1
- package/dist/templates/general.js +0 -59
- package/dist/templates/general.js.map +0 -1
- package/dist/templates/python.d.ts +0 -3
- package/dist/templates/python.d.ts.map +0 -1
- package/dist/templates/python.js +0 -110
- package/dist/templates/python.js.map +0 -1
- package/dist/templates/remote.d.ts +0 -45
- package/dist/templates/remote.d.ts.map +0 -1
- package/dist/templates/remote.js +0 -147
- package/dist/templates/remote.js.map +0 -1
- package/dist/templates/web.d.ts +0 -3
- package/dist/templates/web.d.ts.map +0 -1
- package/dist/templates/web.js +0 -101
- package/dist/templates/web.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,228 +2,201 @@
|
|
|
2
2
|
|
|
3
3
|
**Thoughtful permission configs for Claude Code without the container overhead.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Claude Code users face a frustrating choice: run in a Docker sandbox with `--dangerously-skip-permissions` for convenience, or run natively and deal with constant permission prompts.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This tool offers a middle ground. Generate permission configurations tailored to your workflow, reducing prompt fatigue while maintaining control over what Claude Code can do.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- **Native execution**: No containers, but constant permission prompts interrupt your workflow
|
|
9
|
+
> ⚠️ **Warning:** This approach is inherently less safe than a fully isolated environment. You're trading sandbox protection for convenience. ⚠️
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
## Getting started
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
The fastest way to get going:
|
|
15
14
|
|
|
16
|
-
|
|
15
|
+
```bash
|
|
16
|
+
npx cc-permissions apply
|
|
17
|
+
```
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
This analyzes your project, detects relevant templates, and applies permissions to `.claude/settings.json`.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
Want to see what would be applied first?
|
|
21
22
|
|
|
22
23
|
```bash
|
|
23
|
-
# Run directly with npx (no install needed)
|
|
24
24
|
npx cc-permissions
|
|
25
|
-
|
|
26
|
-
# Or install globally
|
|
27
|
-
npm install -g cc-permissions
|
|
28
25
|
```
|
|
29
26
|
|
|
30
|
-
|
|
27
|
+
Or install globally to use without npx:
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
/plugin install DanielCarmingham/cc-permissions
|
|
29
|
+
```bash
|
|
30
|
+
npm install -g cc-permissions
|
|
36
31
|
```
|
|
32
|
+
Then run: `cc-permissions apply`
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
- `/cc-permissions:analyze` - Scan project and recommend templates
|
|
40
|
-
- `/cc-permissions:template nodejs,python` - Generate from specific templates
|
|
41
|
-
- `/cc-permissions:list` - List available templates
|
|
42
|
-
- `/cc-permissions:apply` - Apply permissions to settings
|
|
34
|
+
Or use as slash command via a Claude Code plugin:
|
|
43
35
|
|
|
44
|
-
|
|
36
|
+
```bash
|
|
37
|
+
# Add the marketplace
|
|
38
|
+
claude plugin marketplace add DanielCarmingham/cc-permissions
|
|
45
39
|
|
|
46
|
-
|
|
40
|
+
# Install the plugin
|
|
41
|
+
claude plugin install cc-permissions@DanielCarmingham-cc-permissions
|
|
47
42
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
cc-permissions --apply
|
|
43
|
+
# Update to latest version
|
|
44
|
+
claude plugin update cc-permissions@DanielCarmingham-cc-permissions
|
|
51
45
|
|
|
52
|
-
#
|
|
53
|
-
cc-permissions
|
|
46
|
+
# Uninstall
|
|
47
|
+
claude plugin uninstall cc-permissions@DanielCarmingham-cc-permissions
|
|
54
48
|
```
|
|
55
49
|
|
|
56
|
-
|
|
50
|
+
Then use `/cc-permissions:analyze`, `/cc-permissions:apply`, and other slash commands directly in Claude Code.
|
|
57
51
|
|
|
58
|
-
|
|
59
|
-
# Generate standard web development permissions
|
|
60
|
-
cc-permissions template nodejs --level standard
|
|
52
|
+
Note: Third-party plugins don't auto-update by default. Run `claude plugin update` from your terminal to get new versions, or enable auto-update via `/plugin` → Marketplaces → select marketplace → Enable auto-update.
|
|
61
53
|
|
|
62
|
-
|
|
63
|
-
cc-permissions template nodejs,python --level standard
|
|
54
|
+
## How it works
|
|
64
55
|
|
|
65
|
-
|
|
66
|
-
cc-permissions template nodejs --apply
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Analyze Your Project
|
|
56
|
+
Permissions are organized into **templates** and **levels**.
|
|
70
57
|
|
|
71
|
-
|
|
58
|
+
**Templates** group commands by technology. Use `nodejs` for npm/yarn/pnpm commands, `python` for pip and pytest, `docker` for container operations, and so on. Combine them freely:
|
|
72
59
|
|
|
73
60
|
```bash
|
|
74
|
-
cc-permissions
|
|
75
|
-
cc-permissions analyze ./path/to/project
|
|
61
|
+
cc-permissions apply nodejs,python,docker
|
|
76
62
|
```
|
|
77
63
|
|
|
78
|
-
|
|
64
|
+
**Levels** control how permissive each template is:
|
|
79
65
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
66
|
+
| Level | What it allows |
|
|
67
|
+
|-------|----------------|
|
|
68
|
+
| `restrictive` | Read-only operations (list, status, info) |
|
|
69
|
+
| `standard` | Development workflow (run, build, test) |
|
|
70
|
+
| `permissive` | Broader access (install, publish, remove) |
|
|
83
71
|
|
|
84
|
-
|
|
72
|
+
Levels are cumulative. `standard` includes everything from `restrictive`, and `permissive` includes everything from `standard`.
|
|
85
73
|
|
|
86
74
|
```bash
|
|
87
|
-
|
|
75
|
+
# Safe exploration mode
|
|
76
|
+
cc-permissions apply nodejs --level restrictive
|
|
77
|
+
|
|
78
|
+
# Normal development (default)
|
|
79
|
+
cc-permissions apply nodejs
|
|
80
|
+
|
|
81
|
+
# Trusted project, full access
|
|
82
|
+
cc-permissions apply nodejs --level permissive
|
|
88
83
|
```
|
|
89
84
|
|
|
90
|
-
##
|
|
85
|
+
## Templates
|
|
91
86
|
|
|
92
|
-
|
|
87
|
+
### General
|
|
93
88
|
|
|
94
|
-
|
|
|
95
|
-
|
|
96
|
-
|
|
|
97
|
-
| `standard` | Dev workflow (+ git commit/push, npm run/build/test) | Day-to-day development |
|
|
98
|
-
| `permissive` | Few guardrails (+ npm install, most commands except banned) | Trusted projects, greenfield |
|
|
89
|
+
| Template | Description |
|
|
90
|
+
|----------|-------------|
|
|
91
|
+
| [shell](docs/templates/shell.md) | Basic shell and filesystem commands |
|
|
99
92
|
|
|
100
|
-
|
|
93
|
+
### Version Control
|
|
101
94
|
|
|
102
95
|
| Template | Description |
|
|
103
96
|
|----------|-------------|
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
97
|
+
| [git](docs/templates/git.md) | Git version control |
|
|
98
|
+
| [gitea](docs/templates/gitea.md) | Gitea CLI (tea) and MCP server for repository and workflow management |
|
|
99
|
+
| [github](docs/templates/github.md) | GitHub CLI (gh) for repository and workflow management |
|
|
100
|
+
| [gitlab](docs/templates/gitlab.md) | GitLab CLI (glab) and MCP server for repository and workflow management |
|
|
108
101
|
|
|
109
|
-
|
|
102
|
+
### Languages & Runtimes
|
|
110
103
|
|
|
111
|
-
|
|
104
|
+
| Template | Description |
|
|
105
|
+
|----------|-------------|
|
|
106
|
+
| [dotnet](docs/templates/dotnet.md) | dotnet CLI, NuGet, MSBuild |
|
|
107
|
+
| [go](docs/templates/go.md) | Go development and golangci-lint |
|
|
108
|
+
| [java](docs/templates/java.md) | Maven, Gradle, Java, and JVM development |
|
|
109
|
+
| [nodejs](docs/templates/nodejs.md) | Node.js, npm, pnpm, yarn, and bun |
|
|
110
|
+
| [php](docs/templates/php.md) | PHP, Composer, and Laravel Artisan |
|
|
111
|
+
| [python](docs/templates/python.md) | pip, python, venv, pytest, and common data tools |
|
|
112
|
+
| [ruby](docs/templates/ruby.md) | Ruby, Bundler, Rails, and Rake |
|
|
113
|
+
| [rust](docs/templates/rust.md) | Cargo, rustc, and rustup |
|
|
112
114
|
|
|
113
|
-
|
|
115
|
+
### Cloud Providers
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
| Template | Description |
|
|
118
|
+
|----------|-------------|
|
|
119
|
+
| [aws](docs/templates/aws.md) | AWS CLI, SAM, CDK, Amplify, and Elastic Beanstalk |
|
|
120
|
+
| [azure](docs/templates/azure.md) | Azure CLI, Functions, Bicep, and Azure Developer CLI |
|
|
121
|
+
| [gcp](docs/templates/gcp.md) | Google Cloud CLI, gsutil, Firebase, and BigQuery |
|
|
116
122
|
|
|
117
|
-
|
|
118
|
-
# Project settings (default) - .claude/settings.json
|
|
119
|
-
cc-permissions --apply --scope project
|
|
123
|
+
### Container & Infrastructure
|
|
120
124
|
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
| Template | Description |
|
|
126
|
+
|----------|-------------|
|
|
127
|
+
| [docker](docs/templates/docker.md) | Docker, Docker Compose, and Buildx |
|
|
128
|
+
| [kubernetes](docs/templates/kubernetes.md) | kubectl, Helm, k9s, and Minikube |
|
|
129
|
+
| [terraform](docs/templates/terraform.md) | Terraform, Terragrunt, and tflint |
|
|
123
130
|
|
|
124
|
-
|
|
125
|
-
cc-permissions --apply --scope local
|
|
131
|
+
### Testing
|
|
126
132
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
| Template | Description |
|
|
134
|
+
|----------|-------------|
|
|
135
|
+
| [playwright](docs/templates/playwright.md) | Playwright testing framework |
|
|
130
136
|
|
|
131
|
-
|
|
132
|
-
|-------|------|----------|
|
|
133
|
-
| `project` | `.claude/settings.json` | Shared team settings (commit to repo) |
|
|
134
|
-
| `user` / `global` | `~/.claude/settings.json` | Personal defaults across all projects |
|
|
135
|
-
| `local` | `.claude/settings.local.json` | Personal overrides (gitignored) |
|
|
137
|
+
### Mobile Development
|
|
136
138
|
|
|
137
|
-
|
|
139
|
+
| Template | Description |
|
|
140
|
+
|----------|-------------|
|
|
141
|
+
| [android](docs/templates/android.md) | Gradle, ADB, and Android development |
|
|
142
|
+
| [flutter](docs/templates/flutter.md) | Flutter SDK and Dart development |
|
|
143
|
+
| [ios](docs/templates/ios.md) | Xcode, Swift, CocoaPods, and iOS development |
|
|
138
144
|
|
|
139
|
-
|
|
145
|
+
### Utilities
|
|
140
146
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
147
|
+
| Template | Description |
|
|
148
|
+
|----------|-------------|
|
|
149
|
+
| [database](docs/templates/database.md) | PostgreSQL, MySQL, MongoDB, and Redis CLI tools |
|
|
144
150
|
|
|
145
|
-
|
|
146
|
-
cc-permissions template nodejs --format summary
|
|
151
|
+
Click any template to see the full list of commands at each level.
|
|
147
152
|
|
|
148
|
-
|
|
149
|
-
cc-permissions template nodejs --format both
|
|
150
|
-
```
|
|
153
|
+
## Where permissions are saved
|
|
151
154
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
- Developers who prefer native execution over containers
|
|
155
|
-
- Users tired of repetitive permission prompts
|
|
156
|
-
- Teams wanting consistent permission policies across projects
|
|
157
|
-
|
|
158
|
-
## Contributing Templates
|
|
159
|
-
|
|
160
|
-
Templates are located in the `templates/` directory.
|
|
161
|
-
|
|
162
|
-
### Template Structure
|
|
163
|
-
|
|
164
|
-
Each template is a `.jsonc` file with comments allowed:
|
|
165
|
-
|
|
166
|
-
```jsonc
|
|
167
|
-
{
|
|
168
|
-
"$schema": "./template.schema.json",
|
|
169
|
-
"name": "my-template",
|
|
170
|
-
"description": "Brief description of what this template covers",
|
|
171
|
-
"levels": {
|
|
172
|
-
"restrictive": [
|
|
173
|
-
// Read-only commands (exploration, status checks)
|
|
174
|
-
{ "command": "mytool status", "description": "Check status" }
|
|
175
|
-
],
|
|
176
|
-
"standard": [
|
|
177
|
-
// Dev workflow commands (builds, tests, commits)
|
|
178
|
-
{ "command": "mytool build", "description": "Build project" }
|
|
179
|
-
],
|
|
180
|
-
"permissive": [
|
|
181
|
-
// Commands with broader access (installs, publishes)
|
|
182
|
-
{ "command": "mytool install *", "description": "Install packages" }
|
|
183
|
-
]
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
```
|
|
155
|
+
By default, permissions go to `.claude/settings.json` (project scope). You can change this:
|
|
187
156
|
|
|
188
|
-
|
|
157
|
+
```bash
|
|
158
|
+
# Personal defaults across all projects
|
|
159
|
+
cc-permissions apply --scope user
|
|
189
160
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
| `restrictive` | Read-only, safe to run anytime | `git status`, `npm list`, `cargo check` |
|
|
193
|
-
| `standard` | Normal dev workflow | `git commit`, `npm test`, `cargo build` |
|
|
194
|
-
| `permissive` | Broader access, use with caution | `npm install`, `cargo publish` |
|
|
161
|
+
# Project-specific overrides (gitignored)
|
|
162
|
+
cc-permissions apply --scope local
|
|
195
163
|
|
|
196
|
-
|
|
164
|
+
# Custom file
|
|
165
|
+
cc-permissions apply --output ./my-permissions.json
|
|
166
|
+
```
|
|
197
167
|
|
|
198
|
-
|
|
168
|
+
| Scope | File | Use case |
|
|
169
|
+
|-------|------|----------|
|
|
170
|
+
| `project` | `.claude/settings.json` | Team settings, commit to repo |
|
|
171
|
+
| `user` | `~/.claude/settings.json` | Personal defaults |
|
|
172
|
+
| `local` | `.claude/settings.local.json` | Personal overrides, gitignored |
|
|
199
173
|
|
|
200
|
-
|
|
201
|
-
- `rm -rf` - Recursive force delete
|
|
202
|
-
- `sudo` - Privilege escalation
|
|
203
|
-
- `curl | bash` / `wget | sh` - Remote code execution
|
|
204
|
-
- And more...
|
|
174
|
+
## Safety
|
|
205
175
|
|
|
206
|
-
|
|
176
|
+
All generated configs include a deny list blocking dangerous patterns like `rm -rf /`, `sudo`, and piped remote execution (`curl | bash`). You can still shoot yourself in the foot, but the obvious hazards are blocked.
|
|
207
177
|
|
|
208
|
-
|
|
178
|
+
## Other commands
|
|
209
179
|
|
|
210
180
|
```bash
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
npm run version:bump minor # 0.1.0 → 0.2.0
|
|
214
|
-
npm run version:bump major # 0.1.0 → 1.0.0
|
|
215
|
-
npm run version:set 2.0.0 # Set exact version
|
|
216
|
-
```
|
|
181
|
+
# See what would be applied (same as cc-permissions analyze)
|
|
182
|
+
cc-permissions
|
|
217
183
|
|
|
218
|
-
|
|
184
|
+
# List available templates
|
|
185
|
+
cc-permissions list
|
|
219
186
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
187
|
+
# View template permissions without applying
|
|
188
|
+
cc-permissions template nodejs
|
|
189
|
+
|
|
190
|
+
# Output as JSON only
|
|
191
|
+
cc-permissions template nodejs --format json
|
|
192
|
+
|
|
193
|
+
# Output with summary
|
|
194
|
+
cc-permissions template nodejs --format both
|
|
224
195
|
```
|
|
225
196
|
|
|
226
|
-
|
|
197
|
+
## Contributing
|
|
198
|
+
|
|
199
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for instructions on adding new templates and development setup.
|
|
227
200
|
|
|
228
201
|
## License
|
|
229
202
|
|
package/dist/analyze.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"analyze.d.ts","sourceRoot":"","sources":["../src/analyze.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAsE,MAAM,YAAY,CAAC;AAoWrH;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CA4E5D;AAyDD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAyDnE"}
|