Skip to content

Improve install DX with one-line bootstrap#44

Merged
TechNickAI merged 2 commits intomainfrom
improve-install-dx
Mar 7, 2026
Merged

Improve install DX with one-line bootstrap#44
TechNickAI merged 2 commits intomainfrom
improve-install-dx

Conversation

@TechNickAI
Copy link
Owner

Summary

  • Bootstrap script auto-detects Claude Code CLI and runs claude plugin marketplace add + claude plugin install non-interactively — no more manually typing slash commands
  • README Quick Start simplified to one curl | bash for all tools, with manual install as fallback
  • Each slash command gets its own code block (individually copyable, no more bash language tag on non-bash commands)

What changed

scripts/bootstrap.sh:

  • Auto-detect claude on PATH → add marketplace + install plugin
  • Auto-detect Cursor via .cursor dir, cursor binary, or /Applications/Cursor.app
  • Proper error handling with fallback instructions instead of silent || true
  • Subshell for cd + git pull to avoid directory issues
  • Graceful exit when Claude setup succeeds but not in a git repo (skips Cursor setup)

README.md:

  • "One-line install" as primary path for everyone
  • "Manual install (Claude Code)" as fallback with individually copyable code blocks
  • No bash language tag on slash commands

AGENTS.md:

  • Commands section reordered to match new install flow

Test plan

  • Removed marketplace and plugin, ran bash scripts/bootstrap.sh — both reinstalled successfully
  • Verified known_marketplaces.json and installed_plugins.json updated correctly
  • Multi-agent code review (logic, error-handling, style) — all findings addressed

🤖 Generated with Claude Code

Bootstrap script now auto-detects Claude Code and Cursor, running
`claude plugin marketplace add` and `claude plugin install` automatically.
Users no longer need to manually type slash commands after curl | bash.

- Auto-detect claude CLI and run plugin setup non-interactively
- Auto-detect Cursor via .cursor dir, PATH, or /Applications/Cursor.app
- Proper error handling with fallback instructions on failure
- Use subshell for git pull to avoid cd/cd- issues
- README: separate code blocks for each slash command (individually copyable)
- README: no bash language tag on slash commands

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

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@claude
Copy link

claude bot commented Mar 7, 2026

Code Review

Overall this is a solid improvement — the auto-detection logic is well-structured and the README is much cleaner. A few things worth looking at:

Potential bug: skills argument dropped from plugin install

README.md, line ~50

Old: /plugin install ai-coding-config skills
New: /plugin install ai-coding-config

Was the skills argument intentionally removed? If it was required to install the skills component of the plugin, the manual install path is now incomplete. Worth double-checking this doesn't silently skip skill installation.


Minor bash safety issue: unquoted subshell in basename

scripts/bootstrap.sh, Cursor setup block

# Current (fragile with paths containing spaces):
echo "✓ In git repository: $(basename $(git rev-parse --show-toplevel))"

# Safer:
echo "✓ In git repository: $(basename "$(git rev-parse --show-toplevel)")"

The inner subshell needs quoting to handle repo paths with spaces.


Usability: plugin command output suppression

if ! claude plugin marketplace add https://github.com/TechNickAI/ai-coding-config > /dev/null 2>&1; then

Suppressing all output means users see nothing during what might be a slow operation, and the comment notes the exit code may not be reliable (> /dev/null 2>&1 with TUI tools often returns 0 regardless). Two thoughts:

  1. Consider printing a spinner/dots or at least "This may take a moment..." before each call.
  2. Since exit codes aren't reliable here, the if ! guard may give false negatives (showing the warning even on success). If that's the case, the warning text "may have failed" is a good hedge, but might cause unnecessary user anxiety. An alternative is to check for side effects (e.g., does the plugin file exist?) rather than the exit code.

Subtle logic: exit 0 in git repo check

scripts/bootstrap.sh ~line 80

if ! git rev-parse --git-dir > /dev/null 2>&1; then
    if [ "$HAS_CLAUDE" = true ]; then
        # Claude setup already succeeded above, just skip Cursor setup
        exit 0
    fi

This is correct but non-obvious. A brief inline comment explaining why we exit 0 here (Claude succeeded, Cursor needs a git repo, so we're done) would help future readers.


Minor: .cursor dir check for Cursor detection

if [ -d ".cursor" ] || command -v cursor &> /dev/null || [ -d "/Applications/Cursor.app" ]; then

The .cursor directory check looks at CWD, which could be a false positive if a non-Cursor project happens to have a .cursor directory for other reasons. The command -v cursor and app path checks are solid. Might consider moving the .cursor dir check lower in precedence or dropping it since the other two are more reliable.


What's working well

  • Subshell for git pull: (cd ~/.ai_coding_config && git pull) correctly avoids directory-state side effects — this is the right fix from the old version.
  • Error handling with fallbacks: || echo "⚠️ ..." patterns prevent set -e from killing the script on non-critical failures while still informing users.
  • Logic flow: The (HAS_CURSOR || !HAS_CLAUDE) condition for the file-based block correctly handles all four detection combinations.
  • README structure: Separating one-line vs manual install as distinct sections with individually copyable code blocks is a clear UX win.
  • AGENTS.md reordering: Putting the curl command first matches the promoted install path.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb2f5ca02a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +53 to +55
if ! claude plugin install ai-coding-config > /dev/null 2>&1; then
echo "⚠️ Plugin install may have failed. Try manually in Claude Code:"
echo " /plugin install ai-coding-config"

Choose a reason for hiding this comment

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

P2 Badge Propagate Claude install failures as script errors

When claude plugin install ai-coding-config fails (for example, unauthenticated Claude CLI or transient CLI/network errors), this branch only prints a warning and continues, so the script can still report completion and exit with status 0. In the Claude-only path (HAS_CLAUDE=true, HAS_CURSOR=false), that leaves users without a working install signal and without the file-based fallback setup, which can silently break bootstrap automation.

Useful? React with 👍 / 👎.

Copy link
Owner Author

Choose a reason for hiding this comment

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

The claude plugin CLI uses a terminal UI renderer that makes exit codes unreliable when run non-interactively. Hard-failing the script on an uncertain exit code would be worse UX — users would see an error even on success. The warning with fallback manual instructions is intentional: it tells users what to do if setup didn't work, without falsely blocking on an unreliable signal.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

else
echo "📥 Updating ~/.ai_coding_config..."
(cd ~/.ai_coding_config && git pull) || echo "⚠️ Update failed. Continuing with existing version."
echo "✓ Updated to latest version"
Copy link

Choose a reason for hiding this comment

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

Success message prints even when git pull fails

Low Severity

When git pull fails on line 100, the || branch prints the warning, but execution unconditionally continues to line 101, which prints "✓ Updated to latest version". The user sees both the failure warning and the success checkmark, which is contradictory and misleading. The success echo needs to be conditional on the pull actually succeeding.

Fix in Cursor Fix in Web


# Add marketplace (claude plugin commands use terminal UI that suppresses output)
echo " Adding marketplace..."
if ! claude plugin marketplace add https://github.com/TechNickAI/ai-coding-config > /dev/null 2>&1; then
Copy link

Choose a reason for hiding this comment

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

Missing stdin redirect breaks curl-pipe execution

Medium Severity

The claude plugin marketplace add and claude plugin install commands redirect stdout/stderr but not stdin. The primary install method is curl | bash, where bash reads the script from stdin (the pipe). These claude commands inherit that stdin, and if they attempt to read from it (the comment on line 42 notes they "use terminal UI"), they'd consume bytes from the pipe, corrupting the rest of the script execution. Adding < /dev/null to both invocations prevents this.

Additional Locations (1)

Fix in Cursor Fix in Web

- Quote inner subshell in basename call (handles paths with spaces)
- Remove .cursor dir detection (CWD-dependent, causes false positives)
  Cursor detection now relies on PATH and /Applications/Cursor.app only
- Add comment explaining why exit 0 when Claude succeeded but no git repo

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TechNickAI
Copy link
Owner Author

Re: skills argument — Intentional removal. skills was never a valid argument; the marketplace has one plugin named ai-coding-config. It was a stale artifact in the old README.

Re: unquoted basename subshell — Fixed in c71a87f.

Re: exit 0 comment — Added clarifying comment in c71a87f.

Re: .cursor dir check — Removed in c71a87f. Detection now relies on PATH and /Applications/Cursor.app only.

@TechNickAI TechNickAI merged commit 67638dc into main Mar 7, 2026
4 checks passed
@TechNickAI TechNickAI deleted the improve-install-dx branch March 7, 2026 15:12
@claude
Copy link

claude bot commented Mar 7, 2026

Code Review

Nice improvement to the install DX overall. The restructured bootstrap flow is much cleaner. A few observations:

Potential Issues

1. .cursor dir detection mentioned in PR description but not implemented

The PR summary says "Auto-detect Cursor via .cursor dir, cursor binary, or /Applications/Cursor.app" — but the actual script only checks command -v cursor and /Applications/Cursor.app. The .cursor directory heuristic is missing. This matters because many Cursor users on Linux won't have the binary on PATH or an /Applications/ dir. Consider adding:

if command -v cursor &> /dev/null || [ -d "/Applications/Cursor.app" ] || [ -d "$HOME/.cursor" ]; then

2. Suppressed output makes error detection unreliable

if ! claude plugin marketplace add https://... > /dev/null 2>&1; then

The comment acknowledges the TUI suppression issue, but swallowing stderr entirely means the exit code may not reliably reflect success/failure. If the claude CLI returns 0 even on failure (common with interactive TUI wrappers), users get a false "✓ Marketplace configured" message. Consider capturing stderr to a temp file and checking for known failure strings, or at minimum warning users to verify manually.

3. skills argument dropped silently

The old README had /plugin install ai-coding-config skills — the new script and manual install section both use /plugin install ai-coding-config (no skills). If the plugin installer requires that argument to install the skills component, this is a silent regression. Is skills no longer a valid/required argument, or was it intentionally removed?

What Works Well

  • Subshell for git pull: (cd ~/.ai_coding_config && git pull) avoids the directory-change bug from the original — good fix.
  • Proper quoting: basename "$(git rev-parse --show-toplevel)" — the original had an unquoted command substitution.
  • Graceful fallback logic: The || [ "$HAS_CLAUDE" = false ] condition for Cursor/file-copy setup is a reasonable "no tool detected" fallback.
  • Error messages: Replacing silent || true with explicit ⚠️ messages with manual instructions is a meaningful UX improvement.
  • README structure: Splitting slash commands into separate code blocks makes them individually copyable — good catch.

Minor

  • The # ─── ... ─── section separators in the script are a nice readability touch, consistent style.
  • AGENTS.md reordering matches the new install priority — makes sense.

Overall this is a solid improvement. The .cursor detection gap and the skills argument change are worth clarifying before merge.

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