Skip to content

Conversation

@itzlambda
Copy link
Collaborator

@itzlambda itzlambda commented Dec 15, 2025

Adds a shorter bs alias for the basilica CLI, making it faster to type commands.

Summary by CodeRabbit

  • New Features
    • Installer and upgrade flow now create a short "bs" alias for the main command, letting you run either "basilica" or "bs".
    • Upgrade completion now suggests verifying the installation with both the main command and the "bs" alias.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 15, 2025

Walkthrough

Creates and uses a bs symlink alongside the main executable during installation and upgrade, ensuring the short bs command is available as an alternative to basilica.

Changes

Cohort / File(s) Summary
Add 'bs' alias symlink feature
crates/basilica-cli/src/cli/handlers/upgrade.rs, scripts/web/install.sh
Introduced ensure_alias_symlink called in the upgrade flow; Unix implementation creates a relative bs symlink pointing to the current executable, non-Unix is a no-op. Install script now creates the bs symlink after binary installation. Upgrade/install messages updated to mention verifying via both basilica --version and bs --version.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify Unix symlink creation logic and relative path correctness in upgrade.rs
  • Confirm non-Unix no-op behavior is appropriate
  • Check install script idempotency and error handling around existing bs files/symlinks
  • Validate upgrade success messaging changes

Poem

🐰
I hopped along the filesystem trail,
and left a tiny bs braid to hail.
Three letters now, so quick to run,
same old tool, but shorter fun.
A rabbit's wink — the job is done!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feat(cli): add 'bs' shorthand alias for basilica command' directly and clearly summarizes the main change: adding a 'bs' alias for the basilica CLI tool.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cli-bs-alias

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dabcd90 and ee6016b.

📒 Files selected for processing (2)
  • crates/basilica-cli/src/cli/handlers/upgrade.rs (2 hunks)
  • scripts/web/install.sh (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/web/install.sh
  • crates/basilica-cli/src/cli/handlers/upgrade.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@itzlambda itzlambda marked this pull request as ready for review December 15, 2025 07:57
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: 0

🧹 Nitpick comments (2)
scripts/web/install.sh (1)

530-532: Consider adding error handling for symlink creation.

The script prints "Creating 'bs' alias..." but doesn't verify whether the symlink creation succeeds. If ln fails, users won't be notified.

Apply this diff to add basic error handling:

-    # Create 'bs' alias symlink
-    print_step "Creating 'bs' alias..."
-    ln -sf "$INSTALL_DIR/$BINARY_NAME" "$INSTALL_DIR/bs"
+    # Create 'bs' alias symlink
+    print_step "Creating 'bs' alias..."
+    if ln -sf "$INSTALL_DIR/$BINARY_NAME" "$INSTALL_DIR/bs" 2>/dev/null; then
+        print_info "'bs' alias created successfully"
+    else
+        print_warning "Failed to create 'bs' alias"
+    fi
crates/basilica-cli/src/cli/handlers/upgrade.rs (1)

134-156: Consider using a relative symlink for better portability.

The current implementation creates an absolute symlink (pointing to the full path of the executable). If the binary is moved, the symlink will break. A relative symlink would be more robust.

Apply this diff to use a relative symlink:

 #[cfg(unix)]
 fn ensure_alias_symlink() {
     use std::os::unix::fs::symlink;
 
     let Ok(current_exe) = std::env::current_exe() else {
         return;
     };
     let Some(parent) = current_exe.parent() else {
         return;
     };
+    let Some(binary_name) = current_exe.file_name() else {
+        return;
+    };
 
     let alias_path = parent.join("bs");
 
     // Remove existing symlink/file if present (ignore errors)
     let _ = std::fs::remove_file(&alias_path);
 
     // Create new symlink
-    match symlink(&current_exe, &alias_path) {
+    match symlink(binary_name, &alias_path) {
         Ok(_) => println!("Created 'bs' alias"),
         Err(e) => eprintln!("Failed to create 'bs' alias: {}", e),
     }
 }

This creates a relative symlink bs -> basilica instead of bs -> /usr/local/bin/basilica, making it resilient to directory moves.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c263b0c and dabcd90.

📒 Files selected for processing (2)
  • crates/basilica-cli/src/cli/handlers/upgrade.rs (2 hunks)
  • scripts/web/install.sh (2 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: lint-complex
  • GitHub Check: build-cli (stable)
🔇 Additional comments (4)
scripts/web/install.sh (1)

618-618: LGTM!

The completion message clearly informs users about both invocation options.

crates/basilica-cli/src/cli/handlers/upgrade.rs (3)

44-45: LGTM!

Good placement to ensure the alias exists even when no update is available. The comment clearly explains the intent.


123-127: LGTM!

The success message appropriately mentions both command options, consistent with the install script.


158-162: LGTM!

The no-op implementation for non-Unix platforms is appropriate given the current scope, and the comment clearly explains why.

@itzlambda itzlambda merged commit a324006 into main Dec 15, 2025
14 checks passed
@itzlambda itzlambda deleted the cli-bs-alias branch December 15, 2025 08:47
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.

2 participants