@jeremyy_prt/cc-config 1.0.2 → 1.1.0
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 +8 -1
- package/cli.js +95 -1
- package/package.json +1 -1
- package/settings.json +2 -24
package/README.md
CHANGED
|
@@ -58,11 +58,18 @@ npx @jeremyy_prt/cc-config setup
|
|
|
58
58
|
|
|
59
59
|
## Config optionnelle
|
|
60
60
|
|
|
61
|
-
Context7 pour @explorer-docs:
|
|
61
|
+
**Context7** pour @explorer-docs:
|
|
62
62
|
```bash
|
|
63
63
|
claude mcp add --transport http context7 https://mcp.context7.com/mcp
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
+
**Alias shell** pour lancer Claude en bypass:
|
|
67
|
+
```bash
|
|
68
|
+
# Ajouter dans ~/.zshrc ou ~/.bashrc
|
|
69
|
+
alias cc='claude --dangerously-skip-permissions'
|
|
70
|
+
alias ccc='claude --dangerously-skip-permissions -c'
|
|
71
|
+
```
|
|
72
|
+
|
|
66
73
|
## License
|
|
67
74
|
|
|
68
75
|
MIT
|
package/cli.js
CHANGED
|
@@ -88,6 +88,84 @@ function mergeSettings() {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
function installShellAliases() {
|
|
92
|
+
const isWindows = process.platform === 'win32';
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
console.log('🔧 Installation des alias shell...');
|
|
96
|
+
|
|
97
|
+
if (isWindows) {
|
|
98
|
+
// PowerShell profile
|
|
99
|
+
const profilePath = path.join(
|
|
100
|
+
process.env.USERPROFILE,
|
|
101
|
+
'Documents',
|
|
102
|
+
'PowerShell',
|
|
103
|
+
'Microsoft.PowerShell_profile.ps1'
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
// Create profile directory if it doesn't exist
|
|
107
|
+
const profileDir = path.dirname(profilePath);
|
|
108
|
+
if (!fs.existsSync(profileDir)) {
|
|
109
|
+
fs.mkdirSync(profileDir, { recursive: true });
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const aliases = `
|
|
113
|
+
# Claude Code aliases
|
|
114
|
+
function cc { claude --dangerously-skip-permissions @args }
|
|
115
|
+
function ccc { claude --dangerously-skip-permissions -c @args }
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
// Check if aliases already exist
|
|
119
|
+
let content = '';
|
|
120
|
+
if (fs.existsSync(profilePath)) {
|
|
121
|
+
content = fs.readFileSync(profilePath, 'utf8');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (!content.includes('Claude Code aliases')) {
|
|
125
|
+
fs.appendFileSync(profilePath, aliases);
|
|
126
|
+
console.log(' ✓ Alias PowerShell installés (cc, ccc)');
|
|
127
|
+
console.log(' → Redémarre PowerShell pour les activer');
|
|
128
|
+
} else {
|
|
129
|
+
console.log(' ✓ Alias déjà installés');
|
|
130
|
+
}
|
|
131
|
+
} else {
|
|
132
|
+
// Unix-like (Mac/Linux)
|
|
133
|
+
const homeDir = os.homedir();
|
|
134
|
+
const shellFiles = [
|
|
135
|
+
path.join(homeDir, '.zshrc'),
|
|
136
|
+
path.join(homeDir, '.bashrc')
|
|
137
|
+
];
|
|
138
|
+
|
|
139
|
+
const aliases = `
|
|
140
|
+
# Claude Code aliases
|
|
141
|
+
alias cc='claude --dangerously-skip-permissions'
|
|
142
|
+
alias ccc='claude --dangerously-skip-permissions -c'
|
|
143
|
+
`;
|
|
144
|
+
|
|
145
|
+
let installed = false;
|
|
146
|
+
for (const shellFile of shellFiles) {
|
|
147
|
+
if (fs.existsSync(shellFile)) {
|
|
148
|
+
let content = fs.readFileSync(shellFile, 'utf8');
|
|
149
|
+
|
|
150
|
+
if (!content.includes('Claude Code aliases')) {
|
|
151
|
+
fs.appendFileSync(shellFile, aliases);
|
|
152
|
+
console.log(` ✓ Alias installés dans ${path.basename(shellFile)}`);
|
|
153
|
+
installed = true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (installed) {
|
|
159
|
+
console.log(' → Redémarre ton terminal pour les activer');
|
|
160
|
+
} else {
|
|
161
|
+
console.log(' ✓ Alias déjà installés');
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
} catch (error) {
|
|
165
|
+
console.log(' ⚠️ Impossible d\'installer les alias');
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
91
169
|
function installStatuslineDeps() {
|
|
92
170
|
const statuslineDir = path.join(CLAUDE_DIR, 'scripts', 'statusline');
|
|
93
171
|
|
|
@@ -98,9 +176,12 @@ function installStatuslineDeps() {
|
|
|
98
176
|
try {
|
|
99
177
|
console.log('📦 Installation des dépendances statusline...');
|
|
100
178
|
|
|
179
|
+
const isWindows = process.platform === 'win32';
|
|
180
|
+
|
|
101
181
|
// Vérifier si bun est disponible
|
|
102
182
|
try {
|
|
103
|
-
|
|
183
|
+
const bunCheck = isWindows ? 'where bun' : 'which bun';
|
|
184
|
+
execSync(bunCheck, { stdio: 'ignore' });
|
|
104
185
|
execSync('bun install', {
|
|
105
186
|
cwd: statuslineDir,
|
|
106
187
|
stdio: 'ignore'
|
|
@@ -122,6 +203,8 @@ function installStatuslineDeps() {
|
|
|
122
203
|
function listInstalled() {
|
|
123
204
|
const commandsDir = path.join(CLAUDE_DIR, 'commands');
|
|
124
205
|
const agentsDir = path.join(CLAUDE_DIR, 'agents');
|
|
206
|
+
const settingsFile = path.join(CLAUDE_DIR, 'settings.json');
|
|
207
|
+
const statuslineDir = path.join(CLAUDE_DIR, 'scripts', 'statusline');
|
|
125
208
|
|
|
126
209
|
console.log('\n📋 Commandes installées:');
|
|
127
210
|
if (fs.existsSync(commandsDir)) {
|
|
@@ -138,6 +221,14 @@ function listInstalled() {
|
|
|
138
221
|
.map(f => f.replace('.md', ''));
|
|
139
222
|
agents.forEach(agent => console.log(` - @${agent}`));
|
|
140
223
|
}
|
|
224
|
+
|
|
225
|
+
console.log('\n⚙️ Configuration:');
|
|
226
|
+
if (fs.existsSync(settingsFile)) {
|
|
227
|
+
console.log(' ✓ Hooks installés (PreToolUse, Stop, Notification)');
|
|
228
|
+
}
|
|
229
|
+
if (fs.existsSync(statuslineDir)) {
|
|
230
|
+
console.log(' ✓ Statusline configurée');
|
|
231
|
+
}
|
|
141
232
|
}
|
|
142
233
|
|
|
143
234
|
function setup() {
|
|
@@ -188,6 +279,9 @@ function setup() {
|
|
|
188
279
|
// Merger settings
|
|
189
280
|
mergeSettings();
|
|
190
281
|
|
|
282
|
+
// Installer alias shell
|
|
283
|
+
installShellAliases();
|
|
284
|
+
|
|
191
285
|
// Installer dépendances statusline
|
|
192
286
|
installStatuslineDeps();
|
|
193
287
|
|
package/package.json
CHANGED
package/settings.json
CHANGED
|
@@ -6,29 +6,7 @@
|
|
|
6
6
|
"hooks": [
|
|
7
7
|
{
|
|
8
8
|
"type": "command",
|
|
9
|
-
"command": "
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"Stop": [
|
|
15
|
-
{
|
|
16
|
-
"matcher": "",
|
|
17
|
-
"hooks": [
|
|
18
|
-
{
|
|
19
|
-
"type": "command",
|
|
20
|
-
"command": "afplay -v 0.1 /Users/jeremy/.claude/song/finish.mp3"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"Notification": [
|
|
26
|
-
{
|
|
27
|
-
"matcher": "",
|
|
28
|
-
"hooks": [
|
|
29
|
-
{
|
|
30
|
-
"type": "command",
|
|
31
|
-
"command": "afplay -v 0.1 /Users/jeremy/.claude/song/need-human.mp3"
|
|
9
|
+
"command": "node ${CLAUDE_CONFIG_DIR}/scripts/validate-command.js"
|
|
32
10
|
}
|
|
33
11
|
]
|
|
34
12
|
}
|
|
@@ -36,7 +14,7 @@
|
|
|
36
14
|
},
|
|
37
15
|
"statusLine": {
|
|
38
16
|
"type": "command",
|
|
39
|
-
"command": "
|
|
17
|
+
"command": "node ${CLAUDE_CONFIG_DIR}/scripts/statusline/src/index.ts",
|
|
40
18
|
"padding": 0
|
|
41
19
|
}
|
|
42
20
|
}
|