@leynier/ccst 0.5.2 → 0.7.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/AGENTS.md +105 -105
- package/CLAUDE.md +1 -1
- package/GEMINI.md +1 -1
- package/LICENSE +21 -21
- package/package.json +3 -2
- package/{README.md → readme.md} +321 -321
- package/src/commands/ccs/install.ts +136 -0
- package/src/commands/ccs/setup.ts +39 -0
- package/src/commands/ccs/start.ts +80 -19
- package/src/commands/ccs/stop.ts +7 -2
- package/src/index.ts +25 -1
- package/src/utils/daemon.ts +108 -10
- package/src/utils/interactive.ts +3 -0
package/{README.md → readme.md}
RENAMED
|
@@ -1,321 +1,321 @@
|
|
|
1
|
-
# ccst - Claude Code Switch Tools
|
|
2
|
-
|
|
3
|
-
> Fast and predictable way to manage Claude Code contexts (`~/.claude/settings.json`)
|
|
4
|
-
|
|
5
|
-
**ccst** (Claude Code Switch Tools) is inspired by [cctx](https://github.com/nwiizo/cctx), which is itself inspired by kubectx, and ports the cctx experience to TypeScript with additional capabilities. Switch between permission sets, environments, and settings with a single command.
|
|
6
|
-
|
|
7
|
-
## Features
|
|
8
|
-
|
|
9
|
-
- Instant context switching
|
|
10
|
-
- Predictable UX with user-level defaults
|
|
11
|
-
- Security-first separation of work, personal, and project contexts
|
|
12
|
-
- Shell completions for major shells
|
|
13
|
-
- Previous context quick switch with `ccst -`
|
|
14
|
-
- File-based JSON contexts you can edit manually
|
|
15
|
-
|
|
16
|
-
## Quick Start
|
|
17
|
-
|
|
18
|
-
### Installation
|
|
19
|
-
|
|
20
|
-
Install globally with npm (default):
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
npm install -g @leynier/ccst
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Alternative package managers:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
# bun
|
|
30
|
-
bun add -g @leynier/ccst
|
|
31
|
-
|
|
32
|
-
# pnpm
|
|
33
|
-
pnpm add -g @leynier/ccst
|
|
34
|
-
|
|
35
|
-
# yarn
|
|
36
|
-
yarn global add @leynier/ccst
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
### 30-Second Setup
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
# 1. Create your first context from current settings
|
|
43
|
-
ccst -n personal
|
|
44
|
-
|
|
45
|
-
# 2. Create a restricted work context
|
|
46
|
-
ccst -n work
|
|
47
|
-
|
|
48
|
-
# 3. Switch between contexts
|
|
49
|
-
ccst work # Switch to work
|
|
50
|
-
ccst personal # Switch to personal
|
|
51
|
-
ccst - # Switch back to previous
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Usage
|
|
55
|
-
|
|
56
|
-
### Basic Commands
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
# List all contexts
|
|
60
|
-
ccst
|
|
61
|
-
|
|
62
|
-
# Switch to a context
|
|
63
|
-
ccst work
|
|
64
|
-
|
|
65
|
-
# Switch to previous context
|
|
66
|
-
ccst -
|
|
67
|
-
|
|
68
|
-
# Show current context
|
|
69
|
-
ccst -c
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
### Settings Level Management
|
|
73
|
-
|
|
74
|
-
ccst respects Claude Code's settings hierarchy with explicit flags:
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
# Default: always uses user-level contexts
|
|
78
|
-
ccst # Manages ~/.claude/settings.json
|
|
79
|
-
|
|
80
|
-
# Explicit flags for project/local contexts
|
|
81
|
-
ccst --in-project # Manages ./.claude/settings.json
|
|
82
|
-
ccst --local # Manages ./.claude/settings.local.json
|
|
83
|
-
|
|
84
|
-
# All commands work with any level
|
|
85
|
-
ccst --in-project work # Switch to 'work' in project contexts
|
|
86
|
-
ccst --local staging # Switch to 'staging' in local contexts
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Context Management
|
|
90
|
-
|
|
91
|
-
```bash
|
|
92
|
-
# Create new context from current settings
|
|
93
|
-
ccst -n project-alpha
|
|
94
|
-
|
|
95
|
-
# Delete a context
|
|
96
|
-
ccst -d old-project
|
|
97
|
-
|
|
98
|
-
# Rename a context (prompts for new name)
|
|
99
|
-
ccst -r old-name
|
|
100
|
-
|
|
101
|
-
# Edit context with $EDITOR
|
|
102
|
-
ccst -e work
|
|
103
|
-
|
|
104
|
-
# Show context content (JSON)
|
|
105
|
-
ccst -s production
|
|
106
|
-
|
|
107
|
-
# Unset current context
|
|
108
|
-
ccst -u
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
### Import/Export
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
# Export context to file
|
|
115
|
-
ccst --export production > prod-settings.json
|
|
116
|
-
|
|
117
|
-
# Import context from file
|
|
118
|
-
ccst --import staging < staging-settings.json
|
|
119
|
-
|
|
120
|
-
# Share contexts between machines
|
|
121
|
-
ccst --export work | ssh remote-host 'ccst --import work'
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Merge Permissions
|
|
125
|
-
|
|
126
|
-
Merge permissions from other contexts or files to build complex configurations:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
# Merge user settings into current context
|
|
130
|
-
ccst --merge-from user
|
|
131
|
-
|
|
132
|
-
# Merge from another context
|
|
133
|
-
ccst --merge-from personal work
|
|
134
|
-
|
|
135
|
-
# Merge from a specific file
|
|
136
|
-
ccst --merge-from /path/to/permissions.json staging
|
|
137
|
-
|
|
138
|
-
# Remove previously merged permissions
|
|
139
|
-
ccst --unmerge user
|
|
140
|
-
|
|
141
|
-
# View merge history
|
|
142
|
-
ccst --merge-history
|
|
143
|
-
|
|
144
|
-
# Merge into a specific context (default is current)
|
|
145
|
-
ccst --merge-from user production
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Merge features:
|
|
149
|
-
|
|
150
|
-
- Smart deduplication
|
|
151
|
-
- History tracking
|
|
152
|
-
- Reversible unmerge
|
|
153
|
-
- Targeted merges
|
|
154
|
-
|
|
155
|
-
### Shell Completions
|
|
156
|
-
|
|
157
|
-
Enable tab completion for faster workflow:
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
# Bash
|
|
161
|
-
ccst --completions bash > ~/.local/share/bash-completion/completions/ccst
|
|
162
|
-
|
|
163
|
-
# Zsh
|
|
164
|
-
ccst --completions zsh > /usr/local/share/zsh/site-functions/_ccst
|
|
165
|
-
|
|
166
|
-
# Fish
|
|
167
|
-
ccst --completions fish > ~/.config/fish/completions/ccst.fish
|
|
168
|
-
|
|
169
|
-
# PowerShell
|
|
170
|
-
ccst --completions powershell > ccst.ps1
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### Importing Profiles
|
|
174
|
-
|
|
175
|
-
ccst includes importer commands to migrate existing profiles:
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
# Import from CCS profiles (~/.ccs/*.settings.json)
|
|
179
|
-
ccst import ccs
|
|
180
|
-
|
|
181
|
-
# Import from configs directory (default: ~/.ccst)
|
|
182
|
-
ccst import configs
|
|
183
|
-
|
|
184
|
-
# Use a custom configs directory
|
|
185
|
-
ccst import configs -d /path/to/configs
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
## File Structure
|
|
189
|
-
|
|
190
|
-
Contexts are stored as individual JSON files at different levels:
|
|
191
|
-
|
|
192
|
-
User level (`~/.claude/`):
|
|
193
|
-
|
|
194
|
-
```text
|
|
195
|
-
~/.claude/
|
|
196
|
-
├── settings.json # Active user context
|
|
197
|
-
└── settings/
|
|
198
|
-
├── work.json # Work context
|
|
199
|
-
├── personal.json # Personal context
|
|
200
|
-
└── .cctx-state.json # State tracking
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
Project level (`./.claude/`):
|
|
204
|
-
|
|
205
|
-
```text
|
|
206
|
-
./.claude/
|
|
207
|
-
├── settings.json # Shared project context
|
|
208
|
-
├── settings.local.json # Local project context (gitignored)
|
|
209
|
-
└── settings/
|
|
210
|
-
├── staging.json # Staging context
|
|
211
|
-
├── production.json # Production context
|
|
212
|
-
├── .cctx-state.json # Project state
|
|
213
|
-
└── .cctx-state.local.json # Local state
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
## Interactive Mode
|
|
217
|
-
|
|
218
|
-
When no arguments are provided, ccst can enter interactive mode:
|
|
219
|
-
|
|
220
|
-
- fzf integration when available
|
|
221
|
-
- Built-in fallback selector when fzf is not installed
|
|
222
|
-
- Current context highlighted in the list
|
|
223
|
-
|
|
224
|
-
```bash
|
|
225
|
-
# Interactive context selection
|
|
226
|
-
CCTX_INTERACTIVE=1 ccst
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
## Common Workflows
|
|
230
|
-
|
|
231
|
-
### Professional Setup
|
|
232
|
-
|
|
233
|
-
```bash
|
|
234
|
-
# Create restricted work context for safer collaboration
|
|
235
|
-
ccst -n work
|
|
236
|
-
ccst -e work # Edit to add restrictions
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### Project-Based Contexts
|
|
240
|
-
|
|
241
|
-
```bash
|
|
242
|
-
# Create project-specific contexts
|
|
243
|
-
ccst -n client-alpha
|
|
244
|
-
ccst -n side-project
|
|
245
|
-
ccst -n experiments
|
|
246
|
-
|
|
247
|
-
# Switch based on current work
|
|
248
|
-
ccst client-alpha
|
|
249
|
-
ccst experiments
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
### Daily Context Switching
|
|
253
|
-
|
|
254
|
-
```bash
|
|
255
|
-
# Morning: start with work context
|
|
256
|
-
ccst work
|
|
257
|
-
|
|
258
|
-
# Need full access for personal project
|
|
259
|
-
ccst personal
|
|
260
|
-
|
|
261
|
-
# Quick switch back to work
|
|
262
|
-
ccst -
|
|
263
|
-
|
|
264
|
-
# Check current context anytime
|
|
265
|
-
ccst -c
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
## Complete Command Reference
|
|
269
|
-
|
|
270
|
-
### Basic Operations
|
|
271
|
-
|
|
272
|
-
- `ccst` - List contexts (defaults to user-level)
|
|
273
|
-
- `ccst <name>` - Switch to context
|
|
274
|
-
- `ccst -` - Switch to previous context
|
|
275
|
-
- `ccst -c` - Show current context name
|
|
276
|
-
- `ccst -q` - Quiet mode (only show current context)
|
|
277
|
-
|
|
278
|
-
### Context Management Reference
|
|
279
|
-
|
|
280
|
-
- `ccst -n <name>` - Create new context from current settings
|
|
281
|
-
- `ccst -d <name>` - Delete context (interactive if no name)
|
|
282
|
-
- `ccst -r <name>` - Rename context (prompts for new name)
|
|
283
|
-
- `ccst -e [name]` - Edit context with $EDITOR
|
|
284
|
-
- `ccst -s [name]` - Show context content (JSON)
|
|
285
|
-
- `ccst -u` - Unset current context (removes settings file)
|
|
286
|
-
|
|
287
|
-
### Import/Export Reference
|
|
288
|
-
|
|
289
|
-
- `ccst --export [name]` - Export context to stdout
|
|
290
|
-
- `ccst --import <name>` - Import context from stdin
|
|
291
|
-
|
|
292
|
-
### Importer Commands
|
|
293
|
-
|
|
294
|
-
- `ccst import ccs` - Import from CCS settings (~/.ccs)
|
|
295
|
-
- `ccst import configs` - Import from configs directory (default: ~/.ccst)
|
|
296
|
-
- `ccst import configs -d <dir>` - Import from a custom configs directory
|
|
297
|
-
- `ccst import ccs -d <dir>` - Use custom configs directory for default.json
|
|
298
|
-
|
|
299
|
-
### Merge Operations
|
|
300
|
-
|
|
301
|
-
- `ccst --merge-from <source> [target]` - Merge permissions from source into target (default: current)
|
|
302
|
-
- Source can be: `user`, another context name, or file path
|
|
303
|
-
- `ccst --merge-from <source> --merge-full [target]` - Merge ALL settings (not just permissions)
|
|
304
|
-
- `ccst --unmerge <source> [target]` - Remove previously merged permissions
|
|
305
|
-
- `ccst --unmerge <source> --merge-full [target]` - Remove ALL previously merged settings
|
|
306
|
-
- `ccst --merge-history [name]` - Show merge history for context
|
|
307
|
-
|
|
308
|
-
### Settings Levels
|
|
309
|
-
|
|
310
|
-
- `ccst` - User-level contexts (default: `~/.claude/settings.json`)
|
|
311
|
-
- `ccst --in-project` - Project-level contexts (`./.claude/settings.json`)
|
|
312
|
-
- `ccst --local` - Local project contexts (`./.claude/settings.local.json`)
|
|
313
|
-
|
|
314
|
-
### Other Options
|
|
315
|
-
|
|
316
|
-
- `ccst --completions <shell>` - Generate shell completions
|
|
317
|
-
- `ccst --help` - Show help information
|
|
318
|
-
|
|
319
|
-
## Compatibility Note
|
|
320
|
-
|
|
321
|
-
ccst is a TypeScript port of cctx with some differences. Behavior and output are intentionally close to cctx, but there may be small UX or implementation differences.
|
|
1
|
+
# ccst - Claude Code Switch Tools
|
|
2
|
+
|
|
3
|
+
> Fast and predictable way to manage Claude Code contexts (`~/.claude/settings.json`)
|
|
4
|
+
|
|
5
|
+
**ccst** (Claude Code Switch Tools) is inspired by [cctx](https://github.com/nwiizo/cctx), which is itself inspired by kubectx, and ports the cctx experience to TypeScript with additional capabilities. Switch between permission sets, environments, and settings with a single command.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Instant context switching
|
|
10
|
+
- Predictable UX with user-level defaults
|
|
11
|
+
- Security-first separation of work, personal, and project contexts
|
|
12
|
+
- Shell completions for major shells
|
|
13
|
+
- Previous context quick switch with `ccst -`
|
|
14
|
+
- File-based JSON contexts you can edit manually
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
### Installation
|
|
19
|
+
|
|
20
|
+
Install globally with npm (default):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g @leynier/ccst
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Alternative package managers:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# bun
|
|
30
|
+
bun add -g @leynier/ccst
|
|
31
|
+
|
|
32
|
+
# pnpm
|
|
33
|
+
pnpm add -g @leynier/ccst
|
|
34
|
+
|
|
35
|
+
# yarn
|
|
36
|
+
yarn global add @leynier/ccst
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### 30-Second Setup
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# 1. Create your first context from current settings
|
|
43
|
+
ccst -n personal
|
|
44
|
+
|
|
45
|
+
# 2. Create a restricted work context
|
|
46
|
+
ccst -n work
|
|
47
|
+
|
|
48
|
+
# 3. Switch between contexts
|
|
49
|
+
ccst work # Switch to work
|
|
50
|
+
ccst personal # Switch to personal
|
|
51
|
+
ccst - # Switch back to previous
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
### Basic Commands
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# List all contexts
|
|
60
|
+
ccst
|
|
61
|
+
|
|
62
|
+
# Switch to a context
|
|
63
|
+
ccst work
|
|
64
|
+
|
|
65
|
+
# Switch to previous context
|
|
66
|
+
ccst -
|
|
67
|
+
|
|
68
|
+
# Show current context
|
|
69
|
+
ccst -c
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Settings Level Management
|
|
73
|
+
|
|
74
|
+
ccst respects Claude Code's settings hierarchy with explicit flags:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Default: always uses user-level contexts
|
|
78
|
+
ccst # Manages ~/.claude/settings.json
|
|
79
|
+
|
|
80
|
+
# Explicit flags for project/local contexts
|
|
81
|
+
ccst --in-project # Manages ./.claude/settings.json
|
|
82
|
+
ccst --local # Manages ./.claude/settings.local.json
|
|
83
|
+
|
|
84
|
+
# All commands work with any level
|
|
85
|
+
ccst --in-project work # Switch to 'work' in project contexts
|
|
86
|
+
ccst --local staging # Switch to 'staging' in local contexts
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Context Management
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Create new context from current settings
|
|
93
|
+
ccst -n project-alpha
|
|
94
|
+
|
|
95
|
+
# Delete a context
|
|
96
|
+
ccst -d old-project
|
|
97
|
+
|
|
98
|
+
# Rename a context (prompts for new name)
|
|
99
|
+
ccst -r old-name
|
|
100
|
+
|
|
101
|
+
# Edit context with $EDITOR
|
|
102
|
+
ccst -e work
|
|
103
|
+
|
|
104
|
+
# Show context content (JSON)
|
|
105
|
+
ccst -s production
|
|
106
|
+
|
|
107
|
+
# Unset current context
|
|
108
|
+
ccst -u
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Import/Export
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Export context to file
|
|
115
|
+
ccst --export production > prod-settings.json
|
|
116
|
+
|
|
117
|
+
# Import context from file
|
|
118
|
+
ccst --import staging < staging-settings.json
|
|
119
|
+
|
|
120
|
+
# Share contexts between machines
|
|
121
|
+
ccst --export work | ssh remote-host 'ccst --import work'
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Merge Permissions
|
|
125
|
+
|
|
126
|
+
Merge permissions from other contexts or files to build complex configurations:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Merge user settings into current context
|
|
130
|
+
ccst --merge-from user
|
|
131
|
+
|
|
132
|
+
# Merge from another context
|
|
133
|
+
ccst --merge-from personal work
|
|
134
|
+
|
|
135
|
+
# Merge from a specific file
|
|
136
|
+
ccst --merge-from /path/to/permissions.json staging
|
|
137
|
+
|
|
138
|
+
# Remove previously merged permissions
|
|
139
|
+
ccst --unmerge user
|
|
140
|
+
|
|
141
|
+
# View merge history
|
|
142
|
+
ccst --merge-history
|
|
143
|
+
|
|
144
|
+
# Merge into a specific context (default is current)
|
|
145
|
+
ccst --merge-from user production
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Merge features:
|
|
149
|
+
|
|
150
|
+
- Smart deduplication
|
|
151
|
+
- History tracking
|
|
152
|
+
- Reversible unmerge
|
|
153
|
+
- Targeted merges
|
|
154
|
+
|
|
155
|
+
### Shell Completions
|
|
156
|
+
|
|
157
|
+
Enable tab completion for faster workflow:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Bash
|
|
161
|
+
ccst --completions bash > ~/.local/share/bash-completion/completions/ccst
|
|
162
|
+
|
|
163
|
+
# Zsh
|
|
164
|
+
ccst --completions zsh > /usr/local/share/zsh/site-functions/_ccst
|
|
165
|
+
|
|
166
|
+
# Fish
|
|
167
|
+
ccst --completions fish > ~/.config/fish/completions/ccst.fish
|
|
168
|
+
|
|
169
|
+
# PowerShell
|
|
170
|
+
ccst --completions powershell > ccst.ps1
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Importing Profiles
|
|
174
|
+
|
|
175
|
+
ccst includes importer commands to migrate existing profiles:
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Import from CCS profiles (~/.ccs/*.settings.json)
|
|
179
|
+
ccst import ccs
|
|
180
|
+
|
|
181
|
+
# Import from configs directory (default: ~/.ccst)
|
|
182
|
+
ccst import configs
|
|
183
|
+
|
|
184
|
+
# Use a custom configs directory
|
|
185
|
+
ccst import configs -d /path/to/configs
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## File Structure
|
|
189
|
+
|
|
190
|
+
Contexts are stored as individual JSON files at different levels:
|
|
191
|
+
|
|
192
|
+
User level (`~/.claude/`):
|
|
193
|
+
|
|
194
|
+
```text
|
|
195
|
+
~/.claude/
|
|
196
|
+
├── settings.json # Active user context
|
|
197
|
+
└── settings/
|
|
198
|
+
├── work.json # Work context
|
|
199
|
+
├── personal.json # Personal context
|
|
200
|
+
└── .cctx-state.json # State tracking
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Project level (`./.claude/`):
|
|
204
|
+
|
|
205
|
+
```text
|
|
206
|
+
./.claude/
|
|
207
|
+
├── settings.json # Shared project context
|
|
208
|
+
├── settings.local.json # Local project context (gitignored)
|
|
209
|
+
└── settings/
|
|
210
|
+
├── staging.json # Staging context
|
|
211
|
+
├── production.json # Production context
|
|
212
|
+
├── .cctx-state.json # Project state
|
|
213
|
+
└── .cctx-state.local.json # Local state
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Interactive Mode
|
|
217
|
+
|
|
218
|
+
When no arguments are provided, ccst can enter interactive mode:
|
|
219
|
+
|
|
220
|
+
- fzf integration when available
|
|
221
|
+
- Built-in fallback selector when fzf is not installed
|
|
222
|
+
- Current context highlighted in the list
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Interactive context selection
|
|
226
|
+
CCTX_INTERACTIVE=1 ccst
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Common Workflows
|
|
230
|
+
|
|
231
|
+
### Professional Setup
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Create restricted work context for safer collaboration
|
|
235
|
+
ccst -n work
|
|
236
|
+
ccst -e work # Edit to add restrictions
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Project-Based Contexts
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Create project-specific contexts
|
|
243
|
+
ccst -n client-alpha
|
|
244
|
+
ccst -n side-project
|
|
245
|
+
ccst -n experiments
|
|
246
|
+
|
|
247
|
+
# Switch based on current work
|
|
248
|
+
ccst client-alpha
|
|
249
|
+
ccst experiments
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Daily Context Switching
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
# Morning: start with work context
|
|
256
|
+
ccst work
|
|
257
|
+
|
|
258
|
+
# Need full access for personal project
|
|
259
|
+
ccst personal
|
|
260
|
+
|
|
261
|
+
# Quick switch back to work
|
|
262
|
+
ccst -
|
|
263
|
+
|
|
264
|
+
# Check current context anytime
|
|
265
|
+
ccst -c
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
## Complete Command Reference
|
|
269
|
+
|
|
270
|
+
### Basic Operations
|
|
271
|
+
|
|
272
|
+
- `ccst` - List contexts (defaults to user-level)
|
|
273
|
+
- `ccst <name>` - Switch to context
|
|
274
|
+
- `ccst -` - Switch to previous context
|
|
275
|
+
- `ccst -c` - Show current context name
|
|
276
|
+
- `ccst -q` - Quiet mode (only show current context)
|
|
277
|
+
|
|
278
|
+
### Context Management Reference
|
|
279
|
+
|
|
280
|
+
- `ccst -n <name>` - Create new context from current settings
|
|
281
|
+
- `ccst -d <name>` - Delete context (interactive if no name)
|
|
282
|
+
- `ccst -r <name>` - Rename context (prompts for new name)
|
|
283
|
+
- `ccst -e [name]` - Edit context with $EDITOR
|
|
284
|
+
- `ccst -s [name]` - Show context content (JSON)
|
|
285
|
+
- `ccst -u` - Unset current context (removes settings file)
|
|
286
|
+
|
|
287
|
+
### Import/Export Reference
|
|
288
|
+
|
|
289
|
+
- `ccst --export [name]` - Export context to stdout
|
|
290
|
+
- `ccst --import <name>` - Import context from stdin
|
|
291
|
+
|
|
292
|
+
### Importer Commands
|
|
293
|
+
|
|
294
|
+
- `ccst import ccs` - Import from CCS settings (~/.ccs)
|
|
295
|
+
- `ccst import configs` - Import from configs directory (default: ~/.ccst)
|
|
296
|
+
- `ccst import configs -d <dir>` - Import from a custom configs directory
|
|
297
|
+
- `ccst import ccs -d <dir>` - Use custom configs directory for default.json
|
|
298
|
+
|
|
299
|
+
### Merge Operations
|
|
300
|
+
|
|
301
|
+
- `ccst --merge-from <source> [target]` - Merge permissions from source into target (default: current)
|
|
302
|
+
- Source can be: `user`, another context name, or file path
|
|
303
|
+
- `ccst --merge-from <source> --merge-full [target]` - Merge ALL settings (not just permissions)
|
|
304
|
+
- `ccst --unmerge <source> [target]` - Remove previously merged permissions
|
|
305
|
+
- `ccst --unmerge <source> --merge-full [target]` - Remove ALL previously merged settings
|
|
306
|
+
- `ccst --merge-history [name]` - Show merge history for context
|
|
307
|
+
|
|
308
|
+
### Settings Levels
|
|
309
|
+
|
|
310
|
+
- `ccst` - User-level contexts (default: `~/.claude/settings.json`)
|
|
311
|
+
- `ccst --in-project` - Project-level contexts (`./.claude/settings.json`)
|
|
312
|
+
- `ccst --local` - Local project contexts (`./.claude/settings.local.json`)
|
|
313
|
+
|
|
314
|
+
### Other Options
|
|
315
|
+
|
|
316
|
+
- `ccst --completions <shell>` - Generate shell completions
|
|
317
|
+
- `ccst --help` - Show help information
|
|
318
|
+
|
|
319
|
+
## Compatibility Note
|
|
320
|
+
|
|
321
|
+
ccst is a TypeScript port of cctx with some differences. Behavior and output are intentionally close to cctx, but there may be small UX or implementation differences.
|