@jeremyy_prt/cc-config 1.0.3 → 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/cli.js +81 -0
- package/package.json +1 -1
- package/settings.json +2 -24
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
|
|
|
@@ -201,6 +279,9 @@ function setup() {
|
|
|
201
279
|
// Merger settings
|
|
202
280
|
mergeSettings();
|
|
203
281
|
|
|
282
|
+
// Installer alias shell
|
|
283
|
+
installShellAliases();
|
|
284
|
+
|
|
204
285
|
// Installer dépendances statusline
|
|
205
286
|
installStatuslineDeps();
|
|
206
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
|
}
|