claude-code-sounds 1.3.0 → 1.4.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 +7 -15
- package/bin/cli.js +45 -3
- package/images/social-preview.png +0 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ npx claude-code-sounds
|
|
|
22
22
|
|
|
23
23
|
The interactive installer checks dependencies, lets you pick a theme, and optionally customize which sounds map to each hook — all in the terminal.
|
|
24
24
|
|
|
25
|
-
Requires macOS (uses `afplay`) and Node.js
|
|
25
|
+
Requires macOS (uses `afplay`) and Node.js 20+.
|
|
26
26
|
|
|
27
27
|
For scripted or CI usage, skip all prompts with `--yes`:
|
|
28
28
|
|
|
@@ -85,38 +85,30 @@ Each theme maps sounds across all 11 Claude Code lifecycle events. Preview insta
|
|
|
85
85
|
|
|
86
86
|
## Creating a Theme
|
|
87
87
|
|
|
88
|
-
Themes live in `themes/<name>/` with two
|
|
88
|
+
Themes live in `themes/<name>/` with two items:
|
|
89
89
|
|
|
90
90
|
### `theme.json`
|
|
91
91
|
|
|
92
|
-
Defines metadata and maps
|
|
92
|
+
Defines metadata and maps sound files to hook categories:
|
|
93
93
|
|
|
94
94
|
```json
|
|
95
95
|
{
|
|
96
96
|
"name": "My Theme",
|
|
97
97
|
"description": "A short description",
|
|
98
|
-
"srcBase": "MyTheme",
|
|
99
98
|
"sounds": {
|
|
100
99
|
"start": {
|
|
101
100
|
"description": "Session starting",
|
|
102
101
|
"files": [
|
|
103
|
-
{ "
|
|
102
|
+
{ "name": "descriptive-name.wav" }
|
|
104
103
|
]
|
|
105
104
|
}
|
|
106
105
|
}
|
|
107
106
|
}
|
|
108
107
|
```
|
|
109
108
|
|
|
110
|
-
|
|
111
|
-
- **`src`** — path relative to `$2/<srcBase>/` where the file is found after download
|
|
109
|
+
### `sounds/`
|
|
112
110
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
Downloads the sound files. Receives two arguments:
|
|
116
|
-
- `$1` — target sounds directory (`~/.claude/sounds`)
|
|
117
|
-
- `$2` — temp directory for downloads
|
|
118
|
-
|
|
119
|
-
The script should download and extract files so they're accessible at `$2/<srcBase>/<src path>` (matching the `srcBase` and `src` values in `theme.json`).
|
|
111
|
+
Place audio files (`.wav` or `.mp3`) in `themes/<name>/sounds/` with filenames matching the `name` field in `theme.json`.
|
|
120
112
|
|
|
121
113
|
## How It Works
|
|
122
114
|
|
|
@@ -148,4 +140,4 @@ This removes all sound files, the hook script, and the hooks config from `settin
|
|
|
148
140
|
|
|
149
141
|
## Disclaimer
|
|
150
142
|
|
|
151
|
-
|
|
143
|
+
All game audio is property of its respective owners: Blizzard Entertainment (Warcraft), Nintendo (Zelda, Mario, Pokemon), Lucasfilm/Disney (Star Wars), Konami (Metal Gear Solid), and Valve (Portal).
|
package/bin/cli.js
CHANGED
|
@@ -501,15 +501,17 @@ function showHelp() {
|
|
|
501
501
|
|
|
502
502
|
Usage:
|
|
503
503
|
npx claude-code-sounds Interactive install
|
|
504
|
+
npx claude-code-sounds --theme mgs Install a specific theme directly
|
|
504
505
|
npx claude-code-sounds --yes Install defaults, skip prompts
|
|
505
506
|
npx claude-code-sounds --list List available themes
|
|
506
507
|
npx claude-code-sounds --uninstall Remove all sounds and hooks
|
|
507
508
|
npx claude-code-sounds --help Show this help
|
|
508
509
|
|
|
509
510
|
Flags:
|
|
510
|
-
-
|
|
511
|
-
-
|
|
512
|
-
-
|
|
511
|
+
-t, --theme <name> Install a specific theme by name
|
|
512
|
+
-y, --yes Skip all prompts, use defaults
|
|
513
|
+
-l, --list List available themes
|
|
514
|
+
-h, --help Show this help
|
|
513
515
|
`);
|
|
514
516
|
}
|
|
515
517
|
|
|
@@ -934,10 +936,50 @@ const args = process.argv.slice(2);
|
|
|
934
936
|
const flags = new Set(args);
|
|
935
937
|
const autoYes = flags.has("--yes") || flags.has("-y");
|
|
936
938
|
|
|
939
|
+
// Parse --theme <name> or --theme=<name> or -t <name>
|
|
940
|
+
let themeArg = null;
|
|
941
|
+
for (let i = 0; i < args.length; i++) {
|
|
942
|
+
if ((args[i] === "--theme" || args[i] === "-t") && args[i + 1]) {
|
|
943
|
+
themeArg = args[i + 1];
|
|
944
|
+
break;
|
|
945
|
+
}
|
|
946
|
+
if (args[i].startsWith("--theme=")) {
|
|
947
|
+
themeArg = args[i].slice("--theme=".length);
|
|
948
|
+
break;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
937
952
|
if (flags.has("--help") || flags.has("-h")) {
|
|
938
953
|
showHelp();
|
|
939
954
|
} else if (flags.has("--list") || flags.has("-l")) {
|
|
940
955
|
showList();
|
|
956
|
+
} else if (themeArg) {
|
|
957
|
+
(async () => {
|
|
958
|
+
p.intro(color.bold("claude-code-sounds"));
|
|
959
|
+
checkDependencies();
|
|
960
|
+
|
|
961
|
+
const themes = listThemes();
|
|
962
|
+
// Try exact match first, then case-insensitive
|
|
963
|
+
let theme = themes.find((t) => t.name === themeArg);
|
|
964
|
+
if (!theme) {
|
|
965
|
+
const lower = themeArg.toLowerCase();
|
|
966
|
+
theme = themes.find((t) => t.name.toLowerCase() === lower);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
if (!theme) {
|
|
970
|
+
p.cancel(
|
|
971
|
+
`Theme "${themeArg}" not found.\n${color.gray(p.S_BAR)}\n${color.gray(p.S_BAR)} Available: ${themes.map((t) => t.name).join(", ")}`
|
|
972
|
+
);
|
|
973
|
+
process.exit(1);
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
await quickInstall(theme);
|
|
977
|
+
p.outro("Start a new Claude Code session to hear it.");
|
|
978
|
+
})().catch((err) => {
|
|
979
|
+
killPreview();
|
|
980
|
+
p.cancel(err.message);
|
|
981
|
+
process.exit(1);
|
|
982
|
+
});
|
|
941
983
|
} else if (flags.has("--uninstall") || flags.has("--remove")) {
|
|
942
984
|
p.intro(color.bold("claude-code-sounds"));
|
|
943
985
|
uninstallAll();
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-code-sounds",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Sound themes for Claude Code lifecycle hooks",
|
|
5
5
|
"bin": {
|
|
6
6
|
"claude-code-sounds": "bin/cli.js"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"images/"
|
|
28
28
|
],
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": ">=
|
|
30
|
+
"node": ">=20"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@clack/core": "^1.0.1",
|