Skip to content

fix(tui): slash command double-run and --gui repo detection#23

Merged
Junaid2005 merged 1 commit into
mainfrom
fix/slash-command-double-run-and-gui-detection
Apr 7, 2026
Merged

fix(tui): slash command double-run and --gui repo detection#23
Junaid2005 merged 1 commit into
mainfrom
fix/slash-command-double-run-and-gui-detection

Conversation

@Junaid2005

@Junaid2005 Junaid2005 commented Apr 7, 2026

Copy link
Copy Markdown
Owner

Two bugs fixed in scripts/ccrewind-tui.ts.

1. /ccrewind and /ccrewind-ui ran twice

Slash command markdown files had inline bash blocks. Claude Code auto-executes those blocks and captures output in <local-command-stdout> (hidden, collapsed). The Superpowers skill then also ran the command via Bash
tool (visible in conversation). Result: two executions, one hidden.

Fix: removed the bash blocks from both generated slash command files. The skill handles the single visible run.

2. --gui failed with "Couldn't find any pages or app directory"

When installed via npx ccrewind --setup, the config.json was written pointing to the npx cache directory (~/.npm/_npx/.../node_modules/ccrewind). That directory has a valid package.json with next in
devDependencies, so the repo check passed — but the npx package has no src/app/, causing Next.js to fail.

Two root causes fixed:

  • Repo validity check now also verifies src/app/ exists on disk
  • Both the setup config-write and isValidRepoRoot() now check devDependencies.next, not just dependencies.next (next has always been a devDep in this repo)

Test

npm run build:tui
node dist/ccrewind-tui.mjs --setup
# config.json should now point to the repo root, not npx cache
cat ~/.local/share/ccrewind/config.json

# /ccrewind-ui should start the dev server without "Couldn't find app dir"
node ~/.local/share/ccrewind/ccrewind-tui.mjs --gui

Remove bash blocks from /ccrewind and /ccrewind-ui slash commands so
Claude Code does not auto-execute them alongside the skill, preventing
the report from running twice.

Fix --gui repo detection to check for src/app directory in addition to
package.json, so the npx cache is not mistaken for a valid repo clone.
Also check devDependencies for next, not just dependencies.
@Junaid2005
Junaid2005 requested a review from AbdulAaqib as a code owner April 7, 2026 21:53
@vercel

vercel Bot commented Apr 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ccrewind Ready Ready Preview, Comment Apr 7, 2026 9:53pm

@Junaid2005
Junaid2005 merged commit 53954b1 into main Apr 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant