Skip to content

fix: remove stale setup-wizard.sh references#198

Merged
jlia0 merged 1 commit intomainfrom
jlia0/fix-missing-setup-wizard
Mar 12, 2026
Merged

fix: remove stale setup-wizard.sh references#198
jlia0 merged 1 commit intomainfrom
jlia0/fix-missing-setup-wizard

Conversation

@jlia0
Copy link
Copy Markdown
Collaborator

@jlia0 jlia0 commented Mar 12, 2026

Summary

Fixes #197 — first-time install fails because lib/setup-wizard.sh no longer exists (it was migrated to TypeScript).

  • scripts/remote-install.sh: Removed chmod +x lib/setup-wizard.sh which broke fresh installs
  • lib/daemon.sh: Updated to call node .../setup-wizard.js instead of the removed shell script

Test plan

  • Run remote-install.sh on a clean machine — step 6/6 should no longer error
  • Start daemon with no settings.json — setup wizard should launch via Node.js

🤖 Generated with Claude Code

The shell-based setup-wizard.sh was migrated to TypeScript
(packages/cli/src/setup-wizard.ts) but two references were left behind:

- scripts/remote-install.sh: chmod on non-existent lib/setup-wizard.sh
  caused first-time installs to fail
- lib/daemon.sh: called the removed shell script instead of the Node.js
  replacement when no configuration is found

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Mar 12, 2026

Greptile Summary

This PR fixes the broken first-time install flow by removing the stale chmod +x lib/setup-wizard.sh reference in remote-install.sh and updating lib/daemon.sh to invoke the TypeScript-compiled packages/cli/dist/setup-wizard.js via Node.js instead of the now-deleted shell script.

  • scripts/remote-install.sh: Simple, correct removal of the defunct chmod +x lib/setup-wizard.sh line that caused step 6/6 to fail on clean installs.
  • lib/daemon.sh: The replacement invocation path is functionally correct, but hardcodes "$SCRIPT_DIR/packages/cli/dist/setup-wizard.js" rather than using the $CLI variable already defined in tinyclaw.sh (line 29), which is the canonical reference used everywhere else (e.g., tinyclaw setup, tinyclaw update). Additionally, the pre-flight build check loop (for pkg in core teams server channels main) does not include cli, so a missing or stale packages/cli/dist directory would not trigger a rebuild before the wizard is invoked.

Confidence Score: 4/5

  • Safe to merge — the fix is correct and unblocks fresh installs, with minor consistency concerns in daemon.sh that don't affect the happy path.
  • The core fix (removing the stale chmod reference and calling the JS wizard) is correct and directly addresses the reported bug. Two minor issues exist in lib/daemon.sh: the CLI path is hardcoded rather than using the existing $CLI variable, and the cli package is missing from the build-check loop. Neither will break normal operation (the root tsc --build always includes cli), but they reduce maintainability and could cause confusing failures in edge cases.
  • lib/daemon.sh — hardcoded CLI path and incomplete build check loop

Important Files Changed

Filename Overview
lib/daemon.sh Replaces old shell-script setup wizard invocation with node .../setup-wizard.js, but hardcodes the CLI dist path instead of using the existing $CLI variable, and the package build-check loop doesn't include cli, leaving a gap where a missing CLI build won't be caught before invocation.
scripts/remote-install.sh Cleanly removes the stale chmod +x lib/setup-wizard.sh line that was breaking fresh installs; no other issues found.

Sequence Diagram

sequenceDiagram
    participant User
    participant remote-install.sh
    participant daemon.sh
    participant node as Node.js
    participant setup-wizard.js as packages/cli/dist/setup-wizard.js

    User->>remote-install.sh: curl | bash (fresh install)
    remote-install.sh->>remote-install.sh: chmod +x bin/tinyclaw, tinyclaw.sh, scripts/install.sh, etc.
    Note over remote-install.sh: ❌ chmod +x lib/setup-wizard.sh (REMOVED — file no longer exists)
    remote-install.sh->>remote-install.sh: scripts/install.sh (symlink + PATH)

    User->>daemon.sh: tinyclaw start (no settings.json)
    daemon.sh->>daemon.sh: load_settings → rc ≠ 0
    daemon.sh->>node: node $SCRIPT_DIR/packages/cli/dist/setup-wizard.js
    node->>setup-wizard.js: Execute setup wizard (TypeScript compiled)
    setup-wizard.js-->>User: Interactive setup prompts
    setup-wizard.js-->>daemon.sh: settings.json written
    daemon.sh->>daemon.sh: load_settings (success)
    daemon.sh->>daemon.sh: Start tmux session + channel processes
Loading

Comments Outside Diff (1)

  1. lib/daemon.sh, line 23-28 (link)

    cli package not included in build check

    The build check loop on line 23 iterates over core teams server channels main, but does not include cli. Now that start_daemon directly invokes packages/cli/dist/setup-wizard.js, a missing cli build will cause setup wizard invocations to fail with a confusing MODULE_NOT_FOUND error rather than triggering a rebuild.

    The cli package IS included in the root tsconfig.json references and will be built by npm run build, but the pre-flight check here won't detect a missing packages/cli/dist directory and trigger a build proactively.

Last reviewed commit: 226cbf8

Comment thread lib/daemon.sh
echo -e "${YELLOW}No configuration found. Running setup wizard...${NC}"
echo ""
"$SCRIPT_DIR/lib/setup-wizard.sh"
node "$SCRIPT_DIR/packages/cli/dist/setup-wizard.js"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use existing $CLI variable instead of hardcoded path

tinyclaw.sh defines CLI="$SCRIPT_DIR/packages/cli/dist" at line 29, and since daemon.sh is sourced from tinyclaw.sh (line 26 of tinyclaw.sh), the $CLI variable is available here. The existing setup command in tinyclaw.sh already calls node "$CLI/setup-wizard.js" using this variable.

Hardcoding the full path creates a discrepancy — if the CLI dist path ever changes, this line would need to be updated separately from the canonical definition in tinyclaw.sh.

Suggested change
node "$SCRIPT_DIR/packages/cli/dist/setup-wizard.js"
node "$CLI/setup-wizard.js"

@jlia0 jlia0 merged commit 161bb5d into main Mar 12, 2026
1 check passed
@jlia0 jlia0 deleted the jlia0/fix-missing-setup-wizard branch March 12, 2026 13:14
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.

[Bug]: 0.0.10 is missing setup-wizard.sh

1 participant