Skip to content

Commit daaa7a8

Browse files
committed
fix(cli): bin shim no longer overrides bare \enchanter\ to showcase
This was the load-bearing bug behind "demo data still showing": the npm-shim at bin/enchanter.mjs was intercepting bare \`enchanter\` and rewriting argv to \`['live', '--script', <path>]\` whenever scripts/ live.ts existed in the repo, regardless of whether Claude Code hooks were installed. The Rust binary's default_command (which prefers tail-of-real-hooks) never even got a chance to fire — argv arrived with explicit \`live\` already set. Two rounds of fixes to default_command in lib.rs were no-ops because the shim was masking them. The fix is one-line: drop the isCockpitDefault → live override. The Rust binary's default_command is now the single source of truth for what bare \`enchanter\` does. \`enchanter live\` (explicit) still works and still gets the absolute script-path injection so monorepo-dev users can verify the runtime end-to-end.
1 parent 4356854 commit daaa7a8

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

bin/enchanter.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ if (isCockpitDefault || isCockpitSubcommand) {
7878

7979
let cockpitArgs = argv;
8080

81-
if (isCockpitDefault) {
82-
// Bare `enchanter`: prefer live with absolute script path; if the
83-
// script is missing (standalone-binary install) the Rust binary's
84-
// own fallback handles the rest.
85-
if (liveScriptExists) {
86-
cockpitArgs = ['live', '--script', liveScript];
87-
}
88-
} else if (first === 'live' && !argv.includes('--script')) {
81+
// Bare `enchanter` is NO LONGER auto-routed to live mode. The Rust
82+
// binary's default_command picks tail-of-real-Claude-hooks when hooks
83+
// are installed (the right default for real users) and prints a help
84+
// message when not. Forcing `live --script` here would mask that logic
85+
// and put users into the showcase loop, defeating the real-data wire-up.
86+
// Users who explicitly want the showcase: `enchanter live` (we still
87+
// inject the absolute script path below).
88+
if (first === 'live' && !argv.includes('--script')) {
8989
// Explicit `enchanter live` without --script: inject the package-resolved
9090
// absolute path so it works from any cwd.
9191
if (liveScriptExists) {

0 commit comments

Comments
 (0)