zuppaclaude 1.1.0 → 1.2.1
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/assets/commands/zc/README.md +31 -0
- package/assets/commands/zc/backup.md +62 -0
- package/assets/commands/zc/cloud.md +80 -0
- package/assets/commands/zc/help.md +87 -0
- package/assets/commands/zc/hud.md +45 -0
- package/assets/commands/zc/restore.md +65 -0
- package/assets/commands/zc/session.md +81 -0
- package/assets/commands/zc/settings.md +85 -0
- package/lib/components/commands.js +140 -0
- package/lib/components/index.js +3 -1
- package/lib/installer.js +23 -7
- package/lib/uninstaller.js +7 -3
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# ZuppaClaude Commands
|
|
2
|
+
|
|
3
|
+
ZuppaClaude slash commands for Claude Code session and backup management.
|
|
4
|
+
|
|
5
|
+
## Available Commands
|
|
6
|
+
|
|
7
|
+
| Command | Description |
|
|
8
|
+
|---------|-------------|
|
|
9
|
+
| `/zc:backup` | Full backup (sessions + settings + cloud) |
|
|
10
|
+
| `/zc:restore` | Restore from backup |
|
|
11
|
+
| `/zc:cloud` | Cloud backup management |
|
|
12
|
+
| `/zc:session` | Session management |
|
|
13
|
+
| `/zc:settings` | Settings management |
|
|
14
|
+
| `/zc:help` | Show help and documentation |
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
/zc:backup # Create full backup
|
|
20
|
+
/zc:backup --cloud # Backup to cloud
|
|
21
|
+
/zc:restore # Restore from latest backup
|
|
22
|
+
/zc:session list # List all sessions
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
These commands are installed automatically with ZuppaClaude:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx zuppaclaude install
|
|
31
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zc:backup
|
|
3
|
+
description: "Full backup of Claude Code sessions, settings, and history with cloud support"
|
|
4
|
+
category: utility
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /zc:backup - Full Backup
|
|
8
|
+
|
|
9
|
+
Create a complete backup of your Claude Code sessions, settings, and command history.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/zc:backup [--cloud <remote>]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
| Option | Description |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| `--cloud <remote>` | Upload backup to cloud (requires rclone) |
|
|
22
|
+
|
|
23
|
+
## Examples
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
/zc:backup # Local backup only
|
|
27
|
+
/zc:backup --cloud gdrive # Backup + upload to Google Drive
|
|
28
|
+
/zc:backup --cloud dropbox # Backup + upload to Dropbox
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## What Gets Backed Up
|
|
32
|
+
|
|
33
|
+
- All Claude Code sessions (conversations)
|
|
34
|
+
- Agent sessions
|
|
35
|
+
- Command history
|
|
36
|
+
- ZuppaClaude settings
|
|
37
|
+
- API keys (encoded)
|
|
38
|
+
|
|
39
|
+
## Execution
|
|
40
|
+
|
|
41
|
+
When this command is invoked, execute the following:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx zuppaclaude backup
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If `--cloud` flag is provided:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx zuppaclaude backup --cloud <remote>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## After Backup
|
|
54
|
+
|
|
55
|
+
Show the user:
|
|
56
|
+
1. Backup ID (timestamp)
|
|
57
|
+
2. Number of sessions backed up
|
|
58
|
+
3. Total size
|
|
59
|
+
4. Location
|
|
60
|
+
5. Cloud upload status (if applicable)
|
|
61
|
+
|
|
62
|
+
Suggest: "Run `/zc:restore <backup-id>` to restore this backup later."
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zc:cloud
|
|
3
|
+
description: "Cloud backup management with rclone integration"
|
|
4
|
+
category: utility
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /zc:cloud - Cloud Backup Management
|
|
8
|
+
|
|
9
|
+
Manage cloud backups using rclone. Supports 40+ cloud providers.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/zc:cloud <action> [remote] [backup-id]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Actions
|
|
18
|
+
|
|
19
|
+
| Action | Description |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| `setup` | Show rclone installation and configuration |
|
|
22
|
+
| `remotes` | List configured cloud remotes |
|
|
23
|
+
| `upload` | Upload backups to cloud |
|
|
24
|
+
| `download` | Download backups from cloud |
|
|
25
|
+
| `backups` | List backups on cloud |
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
/zc:cloud setup # Setup instructions
|
|
31
|
+
/zc:cloud remotes # List remotes
|
|
32
|
+
/zc:cloud upload gdrive # Upload all backups
|
|
33
|
+
/zc:cloud download gdrive # Download all backups
|
|
34
|
+
/zc:cloud backups gdrive # List cloud backups
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Execution
|
|
38
|
+
|
|
39
|
+
### Setup
|
|
40
|
+
```bash
|
|
41
|
+
npx zuppaclaude cloud setup
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### List Remotes
|
|
45
|
+
```bash
|
|
46
|
+
npx zuppaclaude cloud remotes
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Upload
|
|
50
|
+
```bash
|
|
51
|
+
npx zuppaclaude cloud upload <remote> [backup-id]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Download
|
|
55
|
+
```bash
|
|
56
|
+
npx zuppaclaude cloud download <remote> [backup-id]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### List Cloud Backups
|
|
60
|
+
```bash
|
|
61
|
+
npx zuppaclaude cloud backups <remote>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Supported Providers
|
|
65
|
+
|
|
66
|
+
| Provider | Remote Name |
|
|
67
|
+
|----------|-------------|
|
|
68
|
+
| Google Drive | gdrive |
|
|
69
|
+
| Dropbox | dropbox |
|
|
70
|
+
| OneDrive | onedrive |
|
|
71
|
+
| Amazon S3 | s3 |
|
|
72
|
+
| SFTP | sftp |
|
|
73
|
+
| FTP | ftp |
|
|
74
|
+
| + 40 more | See rclone docs |
|
|
75
|
+
|
|
76
|
+
## First Time Setup
|
|
77
|
+
|
|
78
|
+
1. Install rclone: `brew install rclone`
|
|
79
|
+
2. Configure remote: `rclone config`
|
|
80
|
+
3. Use with ZuppaClaude: `/zc:backup --cloud <remote>`
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zc:help
|
|
3
|
+
description: "ZuppaClaude help and documentation"
|
|
4
|
+
category: utility
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /zc:help - ZuppaClaude Help
|
|
8
|
+
|
|
9
|
+
Display ZuppaClaude commands and documentation.
|
|
10
|
+
|
|
11
|
+
## Available Commands
|
|
12
|
+
|
|
13
|
+
### Backup & Restore
|
|
14
|
+
|
|
15
|
+
| Command | Description |
|
|
16
|
+
|---------|-------------|
|
|
17
|
+
| `/zc:backup` | Full backup (sessions + settings) |
|
|
18
|
+
| `/zc:backup --cloud gdrive` | Backup and upload to cloud |
|
|
19
|
+
| `/zc:restore` | Restore from backup |
|
|
20
|
+
| `/zc:restore <id> --cloud gdrive` | Restore from cloud |
|
|
21
|
+
|
|
22
|
+
### Session Management
|
|
23
|
+
|
|
24
|
+
| Command | Description |
|
|
25
|
+
|---------|-------------|
|
|
26
|
+
| `/zc:session list` | List all sessions |
|
|
27
|
+
| `/zc:session backup` | Backup sessions only |
|
|
28
|
+
| `/zc:session backups` | List available backups |
|
|
29
|
+
| `/zc:session export <id>` | Export specific session |
|
|
30
|
+
|
|
31
|
+
### Cloud Management
|
|
32
|
+
|
|
33
|
+
| Command | Description |
|
|
34
|
+
|---------|-------------|
|
|
35
|
+
| `/zc:cloud setup` | Show rclone setup |
|
|
36
|
+
| `/zc:cloud remotes` | List cloud remotes |
|
|
37
|
+
| `/zc:cloud upload <r>` | Upload to cloud |
|
|
38
|
+
| `/zc:cloud download <r>` | Download from cloud |
|
|
39
|
+
|
|
40
|
+
### Settings
|
|
41
|
+
|
|
42
|
+
| Command | Description |
|
|
43
|
+
|---------|-------------|
|
|
44
|
+
| `/zc:settings show` | View settings |
|
|
45
|
+
| `/zc:settings export` | Export settings |
|
|
46
|
+
| `/zc:settings import` | Import settings |
|
|
47
|
+
| `/zc:settings reset` | Reset to defaults |
|
|
48
|
+
|
|
49
|
+
### Claude HUD
|
|
50
|
+
|
|
51
|
+
| Command | Description |
|
|
52
|
+
|---------|-------------|
|
|
53
|
+
| `/zc:hud` | Claude HUD setup instructions |
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
# First time? Create a backup:
|
|
59
|
+
/zc:backup
|
|
60
|
+
|
|
61
|
+
# Set up cloud backup:
|
|
62
|
+
/zc:cloud setup
|
|
63
|
+
|
|
64
|
+
# Restore if needed:
|
|
65
|
+
/zc:restore
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## CLI Commands
|
|
69
|
+
|
|
70
|
+
All commands also work from terminal:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
npx zuppaclaude backup
|
|
74
|
+
npx zuppaclaude restore <id>
|
|
75
|
+
npx zuppaclaude session list
|
|
76
|
+
npx zuppaclaude cloud setup
|
|
77
|
+
npx zuppaclaude settings show
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Links
|
|
81
|
+
|
|
82
|
+
- GitHub: https://github.com/hasankaantan/zuppaclaude
|
|
83
|
+
- NPM: https://www.npmjs.com/package/zuppaclaude
|
|
84
|
+
|
|
85
|
+
## Execution
|
|
86
|
+
|
|
87
|
+
When this command is invoked, show this help information to the user.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zc:hud
|
|
3
|
+
description: "Claude HUD setup instructions"
|
|
4
|
+
category: utility
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /zc:hud - Claude HUD Setup
|
|
8
|
+
|
|
9
|
+
Display Claude HUD installation instructions.
|
|
10
|
+
|
|
11
|
+
## What is Claude HUD?
|
|
12
|
+
|
|
13
|
+
Claude HUD is a status display plugin that provides:
|
|
14
|
+
- Real-time context usage meter
|
|
15
|
+
- Active tool tracking
|
|
16
|
+
- Running agent status
|
|
17
|
+
- Todo progress display
|
|
18
|
+
|
|
19
|
+
## Installation Steps
|
|
20
|
+
|
|
21
|
+
Run these commands inside Claude Code:
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
1. /plugin marketplace add jarrodwatts/claude-hud
|
|
25
|
+
2. /plugin install claude-hud
|
|
26
|
+
3. /claude-hud:setup
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Requirements
|
|
30
|
+
|
|
31
|
+
- Claude Code v1.0.80 or later
|
|
32
|
+
- Plugin support enabled
|
|
33
|
+
|
|
34
|
+
## CLI Alternative
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
setup-claude-hud
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Execution
|
|
41
|
+
|
|
42
|
+
When this command is invoked:
|
|
43
|
+
1. Show the Claude HUD information above
|
|
44
|
+
2. Guide the user through the installation steps
|
|
45
|
+
3. Explain that they need to run the plugin commands in Claude Code
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zc:restore
|
|
3
|
+
description: "Restore Claude Code sessions and settings from backup"
|
|
4
|
+
category: utility
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /zc:restore - Restore from Backup
|
|
8
|
+
|
|
9
|
+
Restore your Claude Code sessions and settings from a previous backup.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/zc:restore [backup-id] [--cloud <remote>]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Options
|
|
18
|
+
|
|
19
|
+
| Option | Description |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| `backup-id` | Specific backup to restore (e.g., 2026-01-05T12-00-00) |
|
|
22
|
+
| `--cloud <remote>` | Download backup from cloud first |
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
/zc:restore # Show available backups
|
|
28
|
+
/zc:restore 2026-01-05T12-00-00 # Restore specific backup
|
|
29
|
+
/zc:restore latest # Restore most recent backup
|
|
30
|
+
/zc:restore latest --cloud gdrive # Restore from Google Drive
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Execution Flow
|
|
34
|
+
|
|
35
|
+
### Step 1: List Available Backups
|
|
36
|
+
|
|
37
|
+
If no backup-id provided, first run:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npx zuppaclaude session backups
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Show the list and ask user to select a backup.
|
|
44
|
+
|
|
45
|
+
### Step 2: Restore
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx zuppaclaude restore <backup-id>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If `--cloud` flag is provided:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx zuppaclaude restore <backup-id> --cloud <remote>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Safety
|
|
58
|
+
|
|
59
|
+
- Existing sessions are NOT overwritten
|
|
60
|
+
- Restored sessions get `.restored` suffix
|
|
61
|
+
- User can manually merge if needed
|
|
62
|
+
|
|
63
|
+
## After Restore
|
|
64
|
+
|
|
65
|
+
Remind user: "Restart Claude Code to see restored sessions."
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zc:session
|
|
3
|
+
description: "Claude Code session management - list, backup, restore, export"
|
|
4
|
+
category: utility
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /zc:session - Session Management
|
|
8
|
+
|
|
9
|
+
Manage your Claude Code conversation sessions.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/zc:session <action> [args]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Actions
|
|
18
|
+
|
|
19
|
+
| Action | Description |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| `list` | List all sessions with details |
|
|
22
|
+
| `backup` | Backup sessions only (not settings) |
|
|
23
|
+
| `backups` | List available backups |
|
|
24
|
+
| `restore` | Restore sessions from backup |
|
|
25
|
+
| `export` | Export a specific session to file |
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
/zc:session list # List all sessions
|
|
31
|
+
/zc:session backup # Backup sessions
|
|
32
|
+
/zc:session backups # List backups
|
|
33
|
+
/zc:session restore 2026-01-05T12-00-00 # Restore from backup
|
|
34
|
+
/zc:session export abc123 ./my-session.jsonl # Export session
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Execution
|
|
38
|
+
|
|
39
|
+
### List Sessions
|
|
40
|
+
```bash
|
|
41
|
+
npx zuppaclaude session list
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Shows:
|
|
45
|
+
- Project paths
|
|
46
|
+
- Session IDs
|
|
47
|
+
- Session types (main vs agent)
|
|
48
|
+
- Size and last modified
|
|
49
|
+
|
|
50
|
+
### Backup Sessions
|
|
51
|
+
```bash
|
|
52
|
+
npx zuppaclaude session backup
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### List Backups
|
|
56
|
+
```bash
|
|
57
|
+
npx zuppaclaude session backups
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Restore Sessions
|
|
61
|
+
```bash
|
|
62
|
+
npx zuppaclaude session restore <backup-id>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Export Session
|
|
66
|
+
```bash
|
|
67
|
+
npx zuppaclaude session export <session-id> [output-file]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Session Types
|
|
71
|
+
|
|
72
|
+
| Icon | Type | Description |
|
|
73
|
+
|------|------|-------------|
|
|
74
|
+
| 💬 | Main | Primary conversation sessions |
|
|
75
|
+
| 🤖 | Agent | Sub-agent sessions |
|
|
76
|
+
|
|
77
|
+
## Tips
|
|
78
|
+
|
|
79
|
+
- Use `/zc:backup` for full backup (sessions + settings)
|
|
80
|
+
- Sessions are stored in `~/.claude/projects/`
|
|
81
|
+
- Backups are stored in `~/.config/zuppaclaude/backups/`
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zc:settings
|
|
3
|
+
description: "ZuppaClaude settings management - view, export, import, reset"
|
|
4
|
+
category: utility
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# /zc:settings - Settings Management
|
|
8
|
+
|
|
9
|
+
Manage ZuppaClaude configuration and preferences.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
/zc:settings <action> [file]
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Actions
|
|
18
|
+
|
|
19
|
+
| Action | Description |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| `show` | Display current settings |
|
|
22
|
+
| `export` | Export settings to file |
|
|
23
|
+
| `import` | Import settings from file |
|
|
24
|
+
| `reset` | Reset to defaults |
|
|
25
|
+
| `path` | Show settings file path |
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
/zc:settings show # View settings
|
|
31
|
+
/zc:settings export ~/backup.json # Export settings
|
|
32
|
+
/zc:settings import ~/backup.json # Import settings
|
|
33
|
+
/zc:settings reset # Reset to defaults
|
|
34
|
+
/zc:settings path # Show file path
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Execution
|
|
38
|
+
|
|
39
|
+
### Show Settings
|
|
40
|
+
```bash
|
|
41
|
+
npx zuppaclaude settings show
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Export Settings
|
|
45
|
+
```bash
|
|
46
|
+
npx zuppaclaude settings export <file>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Import Settings
|
|
50
|
+
```bash
|
|
51
|
+
npx zuppaclaude settings import <file>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Reset Settings
|
|
55
|
+
```bash
|
|
56
|
+
npx zuppaclaude settings reset
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Show Path
|
|
60
|
+
```bash
|
|
61
|
+
npx zuppaclaude settings path
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## What's Stored
|
|
65
|
+
|
|
66
|
+
| Setting | Description |
|
|
67
|
+
|---------|-------------|
|
|
68
|
+
| `specKit` | Spec Kit installation preference |
|
|
69
|
+
| `claudeZ` | Claude-Z installation preference |
|
|
70
|
+
| `claudeHUD` | Claude HUD installation preference |
|
|
71
|
+
| `zaiApiKey` | Z.AI API key (encoded) |
|
|
72
|
+
| `installedAt` | Installation timestamp |
|
|
73
|
+
| `version` | ZuppaClaude version |
|
|
74
|
+
|
|
75
|
+
## Settings Location
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
~/.config/zuppaclaude/zc-settings.json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Tips
|
|
82
|
+
|
|
83
|
+
- Settings are automatically saved after installation
|
|
84
|
+
- Previous settings are used on reinstall
|
|
85
|
+
- Use `/zc:backup` to backup settings with sessions
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ZuppaClaude Commands Installer
|
|
3
|
+
* Installs /zc:* slash commands for Claude Code
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { Logger } = require('../utils/logger');
|
|
9
|
+
const { Platform } = require('../utils/platform');
|
|
10
|
+
|
|
11
|
+
class CommandsInstaller {
|
|
12
|
+
constructor() {
|
|
13
|
+
this.platform = new Platform();
|
|
14
|
+
this.logger = new Logger();
|
|
15
|
+
this.commandsDir = path.join(this.platform.claudeDir, 'commands', 'zc');
|
|
16
|
+
this.sourceDir = path.join(__dirname, '..', '..', 'assets', 'commands', 'zc');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Check if commands are installed
|
|
21
|
+
*/
|
|
22
|
+
isInstalled() {
|
|
23
|
+
return fs.existsSync(this.commandsDir) &&
|
|
24
|
+
fs.existsSync(path.join(this.commandsDir, 'help.md'));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Install ZuppaClaude commands
|
|
29
|
+
*/
|
|
30
|
+
async install() {
|
|
31
|
+
this.logger.step('Installing ZuppaClaude Slash Commands');
|
|
32
|
+
|
|
33
|
+
try {
|
|
34
|
+
// Ensure commands directory exists
|
|
35
|
+
this.platform.ensureDir(this.commandsDir);
|
|
36
|
+
|
|
37
|
+
// Get list of command files
|
|
38
|
+
const files = fs.readdirSync(this.sourceDir);
|
|
39
|
+
|
|
40
|
+
let installed = 0;
|
|
41
|
+
for (const file of files) {
|
|
42
|
+
if (!file.endsWith('.md')) continue;
|
|
43
|
+
|
|
44
|
+
const srcPath = path.join(this.sourceDir, file);
|
|
45
|
+
const destPath = path.join(this.commandsDir, file);
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
fs.copyFileSync(srcPath, destPath);
|
|
49
|
+
installed++;
|
|
50
|
+
} catch (error) {
|
|
51
|
+
this.logger.warning(`Failed to install ${file}: ${error.message}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
this.logger.success(`Installed ${installed} slash commands`);
|
|
56
|
+
this.logger.info('Commands available: /zc:backup, /zc:restore, /zc:cloud, /zc:session, /zc:settings, /zc:hud, /zc:help');
|
|
57
|
+
|
|
58
|
+
return true;
|
|
59
|
+
} catch (error) {
|
|
60
|
+
this.logger.error(`Failed to install commands: ${error.message}`);
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Uninstall commands
|
|
67
|
+
*/
|
|
68
|
+
uninstall() {
|
|
69
|
+
if (!fs.existsSync(this.commandsDir)) {
|
|
70
|
+
this.logger.info('ZuppaClaude commands not found');
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
fs.rmSync(this.commandsDir, { recursive: true });
|
|
76
|
+
this.logger.success('ZuppaClaude commands removed');
|
|
77
|
+
return true;
|
|
78
|
+
} catch (error) {
|
|
79
|
+
this.logger.error(`Failed to remove commands: ${error.message}`);
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Verify installation
|
|
86
|
+
*/
|
|
87
|
+
verify() {
|
|
88
|
+
if (this.isInstalled()) {
|
|
89
|
+
this.logger.success('ZuppaClaude Commands: Installed');
|
|
90
|
+
|
|
91
|
+
// Count installed commands
|
|
92
|
+
try {
|
|
93
|
+
const files = fs.readdirSync(this.commandsDir)
|
|
94
|
+
.filter(f => f.endsWith('.md') && f !== 'README.md');
|
|
95
|
+
this.logger.info(`Available: /zc:${files.map(f => f.replace('.md', '')).join(', /zc:')}`);
|
|
96
|
+
} catch (e) {
|
|
97
|
+
// Ignore
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return true;
|
|
101
|
+
} else {
|
|
102
|
+
this.logger.warning('ZuppaClaude Commands: Not installed');
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* List available commands
|
|
109
|
+
*/
|
|
110
|
+
list() {
|
|
111
|
+
console.log('');
|
|
112
|
+
console.log('\x1b[35m═══════════════════════════════════════════════════════════════════\x1b[0m');
|
|
113
|
+
console.log('\x1b[35m ZuppaClaude Commands\x1b[0m');
|
|
114
|
+
console.log('\x1b[35m═══════════════════════════════════════════════════════════════════\x1b[0m');
|
|
115
|
+
console.log('');
|
|
116
|
+
|
|
117
|
+
const commands = [
|
|
118
|
+
{ cmd: '/zc:backup', desc: 'Full backup (sessions + settings + cloud)' },
|
|
119
|
+
{ cmd: '/zc:restore', desc: 'Restore from backup' },
|
|
120
|
+
{ cmd: '/zc:cloud', desc: 'Cloud backup management' },
|
|
121
|
+
{ cmd: '/zc:session', desc: 'Session management' },
|
|
122
|
+
{ cmd: '/zc:settings', desc: 'Settings management' },
|
|
123
|
+
{ cmd: '/zc:hud', desc: 'Claude HUD setup instructions' },
|
|
124
|
+
{ cmd: '/zc:help', desc: 'Show help' }
|
|
125
|
+
];
|
|
126
|
+
|
|
127
|
+
for (const { cmd, desc } of commands) {
|
|
128
|
+
console.log(` \x1b[36m${cmd.padEnd(18)}\x1b[0m ${desc}`);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
console.log('');
|
|
132
|
+
console.log('Usage:');
|
|
133
|
+
console.log(' Type the command in Claude Code chat, e.g., /zc:backup');
|
|
134
|
+
console.log('');
|
|
135
|
+
|
|
136
|
+
return commands;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
module.exports = { CommandsInstaller };
|
package/lib/components/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const { ClaudeHUDInstaller } = require('./claudehud');
|
|
|
10
10
|
const { SessionManager } = require('./session');
|
|
11
11
|
const { CloudManager } = require('./cloud');
|
|
12
12
|
const { BackupManager } = require('./backup');
|
|
13
|
+
const { CommandsInstaller } = require('./commands');
|
|
13
14
|
|
|
14
15
|
module.exports = {
|
|
15
16
|
SuperClaudeInstaller,
|
|
@@ -19,5 +20,6 @@ module.exports = {
|
|
|
19
20
|
ClaudeHUDInstaller,
|
|
20
21
|
SessionManager,
|
|
21
22
|
CloudManager,
|
|
22
|
-
BackupManager
|
|
23
|
+
BackupManager,
|
|
24
|
+
CommandsInstaller
|
|
23
25
|
};
|
package/lib/installer.js
CHANGED
|
@@ -11,7 +11,8 @@ const {
|
|
|
11
11
|
SpecKitInstaller,
|
|
12
12
|
ConfigInstaller,
|
|
13
13
|
ClaudeZInstaller,
|
|
14
|
-
ClaudeHUDInstaller
|
|
14
|
+
ClaudeHUDInstaller,
|
|
15
|
+
CommandsInstaller
|
|
15
16
|
} = require('./components');
|
|
16
17
|
|
|
17
18
|
class Installer {
|
|
@@ -27,6 +28,7 @@ class Installer {
|
|
|
27
28
|
this.config = new ConfigInstaller();
|
|
28
29
|
this.claudeZ = new ClaudeZInstaller();
|
|
29
30
|
this.claudeHUD = new ClaudeHUDInstaller();
|
|
31
|
+
this.commands = new CommandsInstaller();
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
/**
|
|
@@ -36,7 +38,7 @@ class Installer {
|
|
|
36
38
|
this.logger.banner();
|
|
37
39
|
|
|
38
40
|
// Step 1: Check dependencies
|
|
39
|
-
this.logger.step('Step 1/
|
|
41
|
+
this.logger.step('Step 1/8: Checking Dependencies');
|
|
40
42
|
const depsOk = await this.checkDependencies();
|
|
41
43
|
if (!depsOk) {
|
|
42
44
|
this.logger.error('Dependency check failed. Please install required dependencies.');
|
|
@@ -110,8 +112,12 @@ class Installer {
|
|
|
110
112
|
this.logger.info('Skipping Claude HUD installation');
|
|
111
113
|
}
|
|
112
114
|
|
|
113
|
-
// Step 7:
|
|
114
|
-
this.logger.step('Step 7/
|
|
115
|
+
// Step 7: Install ZuppaClaude Commands
|
|
116
|
+
this.logger.step('Step 7/8: Installing ZuppaClaude Slash Commands');
|
|
117
|
+
const cmdsInstalled = await this.commands.install();
|
|
118
|
+
|
|
119
|
+
// Step 8: Verification
|
|
120
|
+
this.logger.step('Step 8/8: Verifying Installation');
|
|
115
121
|
console.log('');
|
|
116
122
|
|
|
117
123
|
this.superClaude.verify();
|
|
@@ -119,6 +125,7 @@ class Installer {
|
|
|
119
125
|
this.config.verify();
|
|
120
126
|
if (installClaudeZ) this.claudeZ.verify();
|
|
121
127
|
if (installClaudeHUD) this.claudeHUD.verify();
|
|
128
|
+
this.commands.verify();
|
|
122
129
|
|
|
123
130
|
// Save settings
|
|
124
131
|
const newSettings = {
|
|
@@ -139,7 +146,8 @@ class Installer {
|
|
|
139
146
|
specKit: skInstalled,
|
|
140
147
|
config: cfgInstalled,
|
|
141
148
|
claudeZ: czInstalled,
|
|
142
|
-
claudeHUD: hudInstalled
|
|
149
|
+
claudeHUD: hudInstalled,
|
|
150
|
+
commands: cmdsInstalled
|
|
143
151
|
});
|
|
144
152
|
|
|
145
153
|
return true;
|
|
@@ -205,7 +213,8 @@ class Installer {
|
|
|
205
213
|
{ name: 'Spec Kit', installed: results.specKit },
|
|
206
214
|
{ name: 'CLAUDE.md', installed: results.config },
|
|
207
215
|
{ name: 'Claude-Z', installed: results.claudeZ },
|
|
208
|
-
{ name: 'Claude HUD', installed: results.claudeHUD }
|
|
216
|
+
{ name: 'Claude HUD', installed: results.claudeHUD },
|
|
217
|
+
{ name: 'ZC Commands', installed: results.commands }
|
|
209
218
|
];
|
|
210
219
|
|
|
211
220
|
let installed = 0;
|
|
@@ -223,7 +232,14 @@ class Installer {
|
|
|
223
232
|
console.log(' Next steps:');
|
|
224
233
|
console.log(' 1. Restart your terminal or run: source ~/.bashrc');
|
|
225
234
|
console.log(' 2. Start Claude Code: claude');
|
|
226
|
-
console.log(' 3. Try: /sc:help');
|
|
235
|
+
console.log(' 3. Try: /sc:help or /zc:help');
|
|
236
|
+
console.log('');
|
|
237
|
+
|
|
238
|
+
console.log(' ZuppaClaude commands:');
|
|
239
|
+
console.log(' /zc:backup - Full backup (sessions + settings)');
|
|
240
|
+
console.log(' /zc:restore - Restore from backup');
|
|
241
|
+
console.log(' /zc:cloud - Cloud backup management');
|
|
242
|
+
console.log(' /zc:help - Show all commands');
|
|
227
243
|
console.log('');
|
|
228
244
|
|
|
229
245
|
if (results.claudeZ) {
|
package/lib/uninstaller.js
CHANGED
|
@@ -10,7 +10,8 @@ const {
|
|
|
10
10
|
SpecKitInstaller,
|
|
11
11
|
ConfigInstaller,
|
|
12
12
|
ClaudeZInstaller,
|
|
13
|
-
ClaudeHUDInstaller
|
|
13
|
+
ClaudeHUDInstaller,
|
|
14
|
+
CommandsInstaller
|
|
14
15
|
} = require('./components');
|
|
15
16
|
|
|
16
17
|
class Uninstaller {
|
|
@@ -25,6 +26,7 @@ class Uninstaller {
|
|
|
25
26
|
this.config = new ConfigInstaller();
|
|
26
27
|
this.claudeZ = new ClaudeZInstaller();
|
|
27
28
|
this.claudeHUD = new ClaudeHUDInstaller();
|
|
29
|
+
this.commands = new CommandsInstaller();
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
/**
|
|
@@ -57,7 +59,8 @@ class Uninstaller {
|
|
|
57
59
|
specKit: this.specKit.uninstall(),
|
|
58
60
|
config: this.config.uninstall(),
|
|
59
61
|
claudeZ: this.claudeZ.uninstall(),
|
|
60
|
-
claudeHUD: this.claudeHUD.uninstall()
|
|
62
|
+
claudeHUD: this.claudeHUD.uninstall(),
|
|
63
|
+
commands: this.commands.uninstall()
|
|
61
64
|
};
|
|
62
65
|
|
|
63
66
|
// Handle settings
|
|
@@ -89,7 +92,8 @@ class Uninstaller {
|
|
|
89
92
|
{ name: 'Spec Kit', removed: results.specKit },
|
|
90
93
|
{ name: 'CLAUDE.md', removed: results.config },
|
|
91
94
|
{ name: 'Claude-Z', removed: results.claudeZ },
|
|
92
|
-
{ name: 'Claude HUD', removed: results.claudeHUD }
|
|
95
|
+
{ name: 'Claude HUD', removed: results.claudeHUD },
|
|
96
|
+
{ name: 'ZC Commands', removed: results.commands }
|
|
93
97
|
];
|
|
94
98
|
|
|
95
99
|
let removed = 0;
|