Skip to content

Conversation

@rblalock
Copy link
Member

@rblalock rblalock commented Sep 24, 2025

image image

Summary by CodeRabbit

  • New Features
    • Displays an onboarding banner with next steps after successful login and signup.
  • Improvements
    • Installer now provides clearer success messaging with actionable next steps and a help prompt (including a docs link).
    • Enhanced handling for zsh completions with graceful, non-fatal messaging when zsh or directories are unavailable.
    • More explicit confirmation when adding to PATH, including the displayed install location.
    • Refined wording throughout installation for a more positive, guided experience.

…arn to ohai so it doesn't look like installation failed.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 24, 2025

Walkthrough

Adds onboarding UX: a new showAuthNextSteps function displays a post-auth banner linking to docs; it’s invoked after successful login and signup. The install script’s completion and post-install messages are revised, with added zsh checks and expanded next-step guidance. No exported API changes.

Changes

Cohort / File(s) Summary
Auth flow hooks
cmd/auth.go
Calls showAuthNextSteps() after successful login and signup, following existing success messages; no changes to error handling or earlier control flow.
Onboarding UI
cmd/onboarding.go
New file implementing showAuthNextSteps using github.com/agentuity/go-common/tui to render a banner with commands, links, and guidance; defines onboardingDocsURL constant.
Installer messaging and completion
install.sh
Adjusts user-facing messages (warn→ohai), adds explicit zsh presence and site-functions checks, keeps non-fatal behavior on missing/writable dirs, and expands post-install next steps/help text including a docs link.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant CLI
  participant AuthService as Auth Service
  participant TUI as Onboarding UI

  rect rgba(230,245,255,0.6)
  User ->> CLI: agentuity auth login/signup
  CLI ->> AuthService: Authenticate (credentials / device flow)
  AuthService -->> CLI: Success / token
  CLI ->> User: "Successfully logged in/signed up"
  end

  rect rgba(235,255,235,0.6)
  note over CLI,TUI: New step
  CLI ->> TUI: showAuthNextSteps()
  TUI -->> User: Display banner with next commands and docs link
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant Installer as install.sh
  participant Shell as bash/zsh env

  User ->> Installer: Run installer
  Installer ->> Shell: Place binary, update PATH
  alt zsh installed and writable
    Installer ->> Shell: Install zsh completions
    Installer ->> User: Success + next steps (expanded)
  else zsh missing/dir not writable
    Installer ->> User: Non-fatal note (ohai/debug), skip zsh completion
  end
  Installer ->> User: Help prompt and docs link
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jhaynie

Poem

A rabbit taps Return with glee,
“You’re in!” it squeaks—then points to see:
Next steps glow bright, commands in tow,
From install cheer to auth’s warm glow.
Hop to docs, explore the land—
Build burrows fast with steady hand. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The pull request title is two sentences rather than a concise single phrase and includes multiple changes, making it verbose and not following the guideline of a clear, short summary of the main change. Please revise the title into a single concise sentence summarizing the main change, for example “Add onboarding next-step nudges and convert shell completion failures to ohai messaging.”
Linked Issues Check ⚠️ Warning The changes implement guided next steps after installation and authentication by displaying onboarding nudges and links to documentation, but they do not address the agentuity create first-time experience, kitchen sink flag, or auto-start project creation required by AGENT-699. Please extend the pull request to include enhancements to the “agentuity create” first-time flow with an auto-start and kitchen-sink option flag as specified in AGENT-699.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Out of Scope Changes Check ✅ Passed All modifications relate to guided onboarding messaging and shell completion messaging adjustments that align with the linked issue’s focus on improving post-install and authentication flows, with no unrelated changes detected.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch AGENT-699-CLI-onboard

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Comment @coderabbitai help to get the list of available commands and usage tips.

@rblalock rblalock requested review from jhaynie and pec1985 September 24, 2025 20:51
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
install.sh (1)

365-368: Fix: fish shell PATH update writes invalid syntax

Writing export PATH into config.fish breaks fish. Use fish syntax.

Apply this diff:

-  if ! grep -q "$INSTALL_PATH" "$SHELL_CONFIG"; then
-    printf "export PATH=\"\$PATH:%s\"\n" "$INSTALL_PATH" >> "$SHELL_CONFIG"
-    ohai "Added $INSTALL_PATH to PATH in $SHELL_CONFIG"
-  fi
+  if ! grep -q "$INSTALL_PATH" "$SHELL_CONFIG"; then
+    if echo "$SHELL" | grep -q "fish"; then
+      printf 'set -gx PATH $PATH "%s"\n' "$INSTALL_PATH" >> "$SHELL_CONFIG"
+    else
+      printf 'export PATH="$PATH:%s"\n' "$INSTALL_PATH" >> "$SHELL_CONFIG"
+    fi
+    ohai "Added $INSTALL_PATH to PATH in $SHELL_CONFIG"
+  fi

Optional follow-up: tailor the post-install “source …rc” hint by shell (bash/zsh/fish) to avoid confusing fish users.

🧹 Nitpick comments (1)
install.sh (1)

384-401: Good: demoting completion write issues from warn→ohai. Add Homebrew prefix paths and Mac manual steps

On Apple Silicon, completion dirs are usually under /opt/homebrew. Also mirror the helpful manual instructions you provided on Linux for macOS.

Apply this diff to handle both Homebrew prefixes and add Mac manual instructions:

-        if [ -d "/usr/local/etc/bash_completion.d" ]; then
-          BASH_COMPLETION_DIR="/usr/local/etc/bash_completion.d"
-          if [ -w "$BASH_COMPLETION_DIR" ]; then
-            ohai "Generating bash completion script..."
-            "$INSTALL_PATH/agentuity" completion bash > "$BASH_COMPLETION_DIR/agentuity"
-            ohai "Bash completion installed to $BASH_COMPLETION_DIR/agentuity"
-          else
-            ohai "No write permission to $BASH_COMPLETION_DIR. Skipping bash completion installation."
-          fi
-        fi
+        for BASH_COMPLETION_DIR in "/opt/homebrew/etc/bash_completion.d" "/usr/local/etc/bash_completion.d"; do
+          [ -d "$BASH_COMPLETION_DIR" ] || continue
+          if [ -w "$BASH_COMPLETION_DIR" ]; then
+            ohai "Generating bash completion script..."
+            "$INSTALL_PATH/agentuity" completion bash > "$BASH_COMPLETION_DIR/agentuity"
+            ohai "Bash completion installed to $BASH_COMPLETION_DIR/agentuity"
+          else
+            ohai "No write permission to $BASH_COMPLETION_DIR. Skipping bash completion installation."
+            ohai "You can manually install bash completion with:"
+            echo "  $INSTALL_PATH/agentuity completion bash > ~/.bash_completion"
+          fi
+        done
@@
-        if command -v zsh >/dev/null 2>&1 && [ -d "/usr/local/share/zsh/site-functions" ]; then
-          ZSH_COMPLETION_DIR="/usr/local/share/zsh/site-functions"
-          if [ -w "$ZSH_COMPLETION_DIR" ]; then
-            ohai "Generating zsh completion script..."
-            "$INSTALL_PATH/agentuity" completion zsh > "$ZSH_COMPLETION_DIR/_agentuity"
-            ohai "Zsh completion installed to $ZSH_COMPLETION_DIR/_agentuity"
-          else
-            ohai "No write permission to $ZSH_COMPLETION_DIR. Skipping zsh completion installation."
-          fi
-        elif ! command -v zsh >/dev/null 2>&1; then
-          # Only skip silently if zsh is not installed (avoid unnecessary warnings)
-          debug "Zsh not found, skipping zsh completion installation"
-        fi
+        if command -v zsh >/dev/null 2>&1; then
+          for ZSH_COMPLETION_DIR in "/opt/homebrew/share/zsh/site-functions" "/usr/local/share/zsh/site-functions"; do
+            [ -d "$ZSH_COMPLETION_DIR" ] || continue
+            if [ -w "$ZSH_COMPLETION_DIR" ]; then
+              ohai "Generating zsh completion script..."
+              "$INSTALL_PATH/agentuity" completion zsh > "$ZSH_COMPLETION_DIR/_agentuity"
+              ohai "Zsh completion installed to $ZSH_COMPLETION_DIR/_agentuity"
+            else
+              ohai "No write permission to $ZSH_COMPLETION_DIR. Skipping zsh completion installation."
+              ohai "You can manually install zsh completion with:"
+              echo "  mkdir -p ~/.zsh/completion"
+              echo "  $INSTALL_PATH/agentuity completion zsh > ~/.zsh/completion/_agentuity"
+              echo "  echo 'fpath=(~/.zsh/completion \$fpath)' >> ~/.zshrc"
+              echo "  echo 'autoload -U compinit && compinit' >> ~/.zshrc"
+            fi
+          done
+        else
+          # Only skip silently if zsh is not installed (avoid unnecessary warnings)
+          debug "Zsh not found, skipping zsh completion installation"
+        fi

Also applies to: 412-436

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e0b744 and 7db29a2.

📒 Files selected for processing (3)
  • cmd/auth.go (2 hunks)
  • cmd/onboarding.go (1 hunks)
  • install.sh (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build and Test (macos-latest)
  • GitHub Check: Analyze (go)
🔇 Additional comments (2)
cmd/auth.go (1)

115-116: LGTM: Showing next steps right after success improves onboarding flow

The placement after the success banner is good and non-intrusive.

Please confirm we also show these steps after any future auth paths (e.g., SSO) for consistency.

Also applies to: 223-224

install.sh (1)

442-450: LGTM: Clear “Next steps” matches the onboarding banner

Concise, actionable, and consistent with the new auth flow.

@rblalock rblalock merged commit 34edbc4 into main Sep 24, 2025
14 checks passed
@rblalock rblalock deleted the AGENT-699-CLI-onboard branch September 24, 2025 21:03
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.

3 participants