CLI Reference Overview

On this page 28

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

Installation & Setup

# Install Buddy globally
bun add -g @buddysh/buddy

# Interactive setup (recommended first step)
buddy setup

# Or use with bunx (no installation required)
bunx @buddysh/buddy setup

🚀 Start with setup - The setup command provides a complete Renovate-like configuration experience that automatically configures workflows, tokens, and repository settings.

Command Structure

buddy <command> [options] [arguments]

Available Commands

🚀 Setup & Configuration

CommandDescription
setupInteractive/Non-interactive setup wizard - Complete Renovate-like experience
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
update-checkAuto-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:

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

Examples

Quick Start

# Interactive setup (recommended for new projects)
buddy setup

# Non-interactive setup with defaults
buddy setup --non-interactive

# Non-interactive setup with specific preset
buddy setup --non-interactive --preset testing --verbose

# Scan for available updates
buddy scan --verbose

# Apply updates and create PRs
buddy update

Package Analysis

# Get information about a package
buddy info react

# Check available versions
buddy versions typescript --latest 5

# Search for packages
buddy search "test framework"

PR Management

# Rebase a specific PR
buddy rebase 17

# Check all PRs for rebase requests
buddy update-check

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

Configuration File

Most commands use settings from buddy.config.ts:

import type { BuddyConfig } from '@buddysh/buddy'

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 BuddyConfig

Environment Variables

Buddy uses these environment variables:

# 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:

buddy <command> --verbose

Common Issues

Command not found:

# Check installation
which buddy

# Or use bunx
bunx @buddysh/buddy --version

GitHub token issues:

# Test token
gh auth status

# Login if needed
gh auth login

Permission errors:

# Check repository permissions
buddy open-settings

Integration Examples

CI/CD Pipeline

# .github/workflows/dependencies.yml

- name: Update dependencies

  run: |
    bunx @buddysh/buddy scan --verbose
    bunx @buddysh/buddy update --strategy patch

NPM Scripts

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

Monorepo Usage

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

# Check all workspaces
for dir in packages/*/; do
  echo "Checking $dir"
  cd "$dir" && buddy 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

# General help
buddy --help

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

Documentation

Community

Suggest a change to this page

Last updated:

Released under the MIT License.