Skip to content

CLI Reference Overview

Buddy provides a comprehensive command-line interface for dependency management, package analysis, and workflow automation.

Installation & Setup

bash
# Install Buddy globally
bun add -g buddy-bot

# Or use with bunx (no installation required)
bunx buddy-bot --help

Command Structure

bash
buddy-bot <command> [options] [arguments]

Available Commands

🚀 Setup & Configuration

CommandDescription
setupInteractive setup for automated dependency updates
open-settingsOpen GitHub repository and organization settings

🔍 Scanning & Analysis

CommandDescription
scanScan for dependency updates
checkCheck specific packages for updates

⬆️ Updates & Pull Requests

CommandDescription
updateUpdate dependencies and create PRs
rebaseRebase/retry a pull request
check-rebaseAuto-detect and rebase PRs with checked boxes

📦 Package Information

CommandDescription
infoShow detailed package information
versionsShow all available versions of a package
latestGet the latest version of a package
existsCheck if a package exists in the registry
depsShow package dependencies
compareCompare two versions of a package
searchSearch for packages in the registry

⏰ Automation & Scheduling

CommandDescription
scheduleRun automated updates on schedule

Global Options

All commands support these global options:

bash
--verbose, -v    Enable verbose logging
--help, -h       Show help information
--version        Show version information

Examples

Quick Start

bash
# Interactive setup (recommended for new projects)
buddy-bot setup

# Scan for available updates
buddy-bot scan --verbose

# Apply updates and create PRs
buddy-bot update

Package Analysis

bash
# Get information about a package
buddy-bot info react

# Check available versions
buddy-bot versions typescript --latest 5

# Search for packages
buddy-bot search "test framework"

PR Management

bash
# Rebase a specific PR
buddy-bot rebase 17

# Check all PRs for rebase requests
buddy-bot check-rebase

# Force rebase even if up to date
buddy-bot rebase 17 --force

Configuration File

Most commands use settings from buddy-bot.config.ts:

typescript
import type { BuddyBotConfig } from 'buddy-bot'

export default {
  verbose: true,
  repository: {
    provider: 'github',
    owner: 'your-org',
    name: 'your-repo',
  },
  packages: {
    strategy: 'patch',
    ignore: ['@types/node'],
  },
  pullRequest: {
    reviewers: ['team-lead'],
    assignees: ['maintainer'],
    labels: ['dependencies'],
  }
} satisfies BuddyBotConfig

Environment Variables

Buddy uses these environment variables:

bash
# Required for GitHub operations
GITHUB_TOKEN=ghp_xxxxxxxxxxxx

# Optional: Explicitly set GitHub token
GH_TOKEN=ghp_xxxxxxxxxxxx

# Optional: Configure Bun
BUN_CONFIG_DIR=/path/to/config

Exit Codes

Buddy uses standard exit codes:

  • 0: Success
  • 1: General error (configuration, network, etc.)
  • 2: Command not found or invalid arguments

Debugging

Verbose Mode

Enable detailed logging for any command:

bash
buddy-bot <command> --verbose

Common Issues

Command not found:

bash
# Check installation
which buddy-bot

# Or use bunx
bunx buddy-bot --version

GitHub token issues:

bash
# Test token
gh auth status

# Login if needed
gh auth login

Permission errors:

bash
# Check repository permissions
buddy-bot open-settings

Integration Examples

CI/CD Pipeline

yaml
# .github/workflows/dependencies.yml
- name: Update dependencies
  run: |
    bunx buddy-bot scan --verbose
    bunx buddy-bot update --strategy patch

NPM Scripts

json
{
  "scripts": {
    "deps:scan": "buddy-bot scan --verbose",
    "deps:update": "buddy-bot update",
    "deps:check": "buddy-bot check react typescript",
    "deps:info": "buddy-bot info"
  }
}

Monorepo Usage

bash
# Update specific workspace
cd packages/frontend
buddy-bot update --strategy minor

# Check all workspaces
for dir in packages/*/; do
  echo "Checking $dir"
  cd "$dir" && buddy-bot scan
  cd ../..
done

Performance Tips

  1. Use specific strategies: --strategy patch is faster than all
  2. Filter packages: Use --packages for targeted updates
  3. Enable caching: Set BUN_CONFIG_NO_CACHE=false
  4. Parallel execution: Run multiple commands in parallel for monorepos

Getting Help

Built-in Help

bash
# General help
buddy-bot --help

# Command-specific help
buddy-bot scan --help
buddy-bot update --help

Documentation

Community

Released under the MIT License.