Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Commit 73bfdd7

Browse files
greynewellclaude
andcommitted
feat: show help menu after hook installation
Update 'uncompact install' to display the full help menu upon successful completion (or if hooks are already present). This ensures the user always receives guidance on next steps regardless of whether they install via npm, npx, or manually. Co-Authored-By: Grey Newell <greyshipscode@gmail.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a4dbec0 commit 73bfdd7

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

cmd/install.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ func installHandler(cmd *cobra.Command, args []string) error {
5050

5151
if result.AlreadySet {
5252
fmt.Println("✓ Uncompact hooks are already installed.")
53+
fmt.Println()
54+
fmt.Println("---")
55+
fmt.Println()
56+
_ = rootCmd.Help()
5357
return nil
5458
}
5559

@@ -94,7 +98,12 @@ func installHandler(cmd *cobra.Command, args []string) error {
9498
fmt.Println(" Stop hook: reinjects context after Claude Code compaction")
9599
fmt.Println(" UserPromptSubmit hook: replays context bomb into AI context on your next message")
96100
fmt.Println()
97-
fmt.Println("Test it: uncompact run --debug")
101+
fmt.Println("---")
102+
fmt.Println()
103+
104+
// Show help output to guide the user
105+
_ = rootCmd.Help()
106+
98107
return nil
99108
}
100109

npm/install.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,19 +189,18 @@ async function main() {
189189
// Automatically install Claude Code hooks
190190
log("[uncompact] Configuring Claude Code hooks...\n");
191191
try {
192+
// The 'install' command now automatically shows the help menu upon completion
192193
execFileSync(destPath, ["install", "--yes"], { stdio: "inherit" });
193194
} catch (err) {
194195
log("[uncompact] Note: Automatic hook configuration skipped or failed. Run manually if needed:\n");
195196
log(" uncompact install\n");
197+
198+
// Fallback: Show help if the install command failed
199+
try {
200+
execFileSync(destPath, [], { stdio: "inherit" });
201+
} catch (e) {}
196202
}
197203
log("\n");
198-
199-
// Show help output after install
200-
try {
201-
execFileSync(destPath, [], { stdio: "inherit" });
202-
} catch (err) {
203-
// Ignore errors from running the binary itself
204-
}
205204
}
206205

207206
main().catch((err) => {

0 commit comments

Comments
 (0)