ccconfig 1.0.0 → 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 +24 -24
- package/ccconfig.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -65,9 +65,9 @@ Configure once by adding to your Shell startup files:
|
|
|
65
65
|
**Fish** (`~/.config/fish/config.fish`):
|
|
66
66
|
```fish
|
|
67
67
|
# Load Claude Code environment variables
|
|
68
|
-
set -l
|
|
69
|
-
if test -f $
|
|
70
|
-
for line in (cat $
|
|
68
|
+
set -l ccconfig_env ~/.config/ccconfig/current.env
|
|
69
|
+
if test -f $ccconfig_env
|
|
70
|
+
for line in (cat $ccconfig_env)
|
|
71
71
|
set -l parts (string split '=' $line)
|
|
72
72
|
set -gx $parts[1] $parts[2]
|
|
73
73
|
end
|
|
@@ -77,25 +77,25 @@ end
|
|
|
77
77
|
**Bash** (`~/.bashrc`):
|
|
78
78
|
```bash
|
|
79
79
|
# Load Claude Code environment variables
|
|
80
|
-
if [ -f ~/.config/
|
|
81
|
-
export $(grep -v '^#' ~/.config/
|
|
80
|
+
if [ -f ~/.config/ccconfig/current.env ]; then
|
|
81
|
+
export $(grep -v '^#' ~/.config/ccconfig/current.env | xargs)
|
|
82
82
|
fi
|
|
83
83
|
```
|
|
84
84
|
|
|
85
85
|
**Zsh** (`~/.zshrc`):
|
|
86
86
|
```zsh
|
|
87
87
|
# Load Claude Code environment variables
|
|
88
|
-
if [ -f ~/.config/
|
|
89
|
-
export $(grep -v '^#' ~/.config/
|
|
88
|
+
if [ -f ~/.config/ccconfig/current.env ]; then
|
|
89
|
+
export $(grep -v '^#' ~/.config/ccconfig/current.env | xargs)
|
|
90
90
|
fi
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
**PowerShell** (`$PROFILE`):
|
|
94
94
|
```powershell
|
|
95
95
|
# Load Claude Code environment variables
|
|
96
|
-
$
|
|
97
|
-
if (Test-Path $
|
|
98
|
-
Get-Content $
|
|
96
|
+
$cconfigEnv = "$env:USERPROFILE\.config\ccconfig\current.env"
|
|
97
|
+
if (Test-Path $cconfigEnv) {
|
|
98
|
+
Get-Content $cconfigEnv | ForEach-Object {
|
|
99
99
|
if ($_ -match '^([^=]+)=(.*)$') {
|
|
100
100
|
[Environment]::SetEnvironmentVariable($matches[1], $matches[2], 'Process')
|
|
101
101
|
}
|
|
@@ -161,14 +161,14 @@ ccconfig env dotenv > .env
|
|
|
161
161
|
|
|
162
162
|
## Configuration File Locations
|
|
163
163
|
|
|
164
|
-
- **Configuration List**: `~/.config/
|
|
164
|
+
- **Configuration List**: `~/.config/ccconfig/profiles.json`
|
|
165
165
|
- **Claude Settings**: `~/.claude/settings.json`
|
|
166
|
-
- **Environment Variables File**: `~/.config/
|
|
167
|
-
- **Mode Settings**: `~/.config/
|
|
166
|
+
- **Environment Variables File**: `~/.config/ccconfig/current.env`
|
|
167
|
+
- **Mode Settings**: `~/.config/ccconfig/mode`
|
|
168
168
|
|
|
169
169
|
## Configuration Example
|
|
170
170
|
|
|
171
|
-
`~/.config/
|
|
171
|
+
`~/.config/ccconfig/profiles.json`:
|
|
172
172
|
|
|
173
173
|
```json
|
|
174
174
|
{
|
|
@@ -228,17 +228,17 @@ source .env
|
|
|
228
228
|
|
|
229
229
|
```bash
|
|
230
230
|
# Backup configuration
|
|
231
|
-
cp ~/.config/
|
|
231
|
+
cp ~/.config/ccconfig/profiles.json ~/backup/ccconfig-profiles.json
|
|
232
232
|
|
|
233
233
|
# Sync to new machine
|
|
234
|
-
scp ~/backup/
|
|
234
|
+
scp ~/backup/ccconfig-profiles.json new-machine:~/.config/ccconfig/
|
|
235
235
|
|
|
236
236
|
# Or use version control (be careful with security!)
|
|
237
|
-
cd ~/.config/
|
|
237
|
+
cd ~/.config/ccconfig
|
|
238
238
|
git init
|
|
239
239
|
echo "*.env" >> .gitignore
|
|
240
240
|
git add profiles.json
|
|
241
|
-
git commit -m "
|
|
241
|
+
git commit -m "ccconfig profiles"
|
|
242
242
|
```
|
|
243
243
|
|
|
244
244
|
## Troubleshooting
|
|
@@ -251,8 +251,8 @@ git commit -m "Claude Code profiles"
|
|
|
251
251
|
3. Check the `env` field in `~/.claude/settings.json`
|
|
252
252
|
|
|
253
253
|
**ENV Mode**:
|
|
254
|
-
1. Check environment variables file: `cat ~/.config/
|
|
255
|
-
2. Confirm Shell configuration is correct: `cat ~/.bashrc | grep
|
|
254
|
+
1. Check environment variables file: `cat ~/.config/ccconfig/current.env`
|
|
255
|
+
2. Confirm Shell configuration is correct: `cat ~/.bashrc | grep ccconfig`
|
|
256
256
|
3. Restart Shell or use `eval $(ccconfig env bash)`
|
|
257
257
|
4. Check process environment variables: `ccconfig current`
|
|
258
258
|
|
|
@@ -269,9 +269,9 @@ ccconfig use work # Reapply configuration
|
|
|
269
269
|
|
|
270
270
|
```bash
|
|
271
271
|
# Fix configuration file permissions
|
|
272
|
-
chmod 600 ~/.config/
|
|
272
|
+
chmod 600 ~/.config/ccconfig/profiles.json
|
|
273
273
|
chmod 600 ~/.claude/settings.json
|
|
274
|
-
chmod 600 ~/.config/
|
|
274
|
+
chmod 600 ~/.config/ccconfig/current.env
|
|
275
275
|
```
|
|
276
276
|
|
|
277
277
|
## Security Considerations
|
|
@@ -306,7 +306,7 @@ Using both simultaneously may cause confusion.
|
|
|
306
306
|
**Q: How to use on Windows?**
|
|
307
307
|
|
|
308
308
|
A: Fully supported on Windows:
|
|
309
|
-
- Configuration file location: `%USERPROFILE%\.config\
|
|
309
|
+
- Configuration file location: `%USERPROFILE%\.config\ccconfig\`
|
|
310
310
|
- Settings mode requires no additional configuration
|
|
311
311
|
- ENV mode uses PowerShell configuration
|
|
312
312
|
|
|
@@ -321,7 +321,7 @@ A:
|
|
|
321
321
|
A: Yes, but be careful:
|
|
322
322
|
```bash
|
|
323
323
|
# Export configuration structure (excluding API keys)
|
|
324
|
-
cat ~/.config/
|
|
324
|
+
cat ~/.config/ccconfig/profiles.json | \
|
|
325
325
|
jq '.profiles | map_values({baseUrl, description})' > team-config.json
|
|
326
326
|
|
|
327
327
|
# Team members manually add their own API keys after importing
|
package/ccconfig.js
CHANGED
|
@@ -6,7 +6,7 @@ const os = require('os');
|
|
|
6
6
|
const readline = require('readline');
|
|
7
7
|
|
|
8
8
|
// Configuration file paths
|
|
9
|
-
const CONFIG_DIR = path.join(os.homedir(), '.config', '
|
|
9
|
+
const CONFIG_DIR = path.join(os.homedir(), '.config', 'ccconfig');
|
|
10
10
|
const PROFILES_FILE = path.join(CONFIG_DIR, 'profiles.json');
|
|
11
11
|
const CLAUDE_SETTINGS = path.join(os.homedir(), '.claude', 'settings.json');
|
|
12
12
|
const ENV_FILE = path.join(CONFIG_DIR, 'current.env');
|
package/package.json
CHANGED