Skip to content

An npm-based CLI tool manager that supports installing, updating, and uninstalling various programming tools through an interactive menu.

Notifications You must be signed in to change notification settings

BinaryRisker/clibundle

Repository files navigation

CLI Bundle

An npm-based CLI tool manager that supports installing, updating, and uninstalling various programming tools through an interactive menu.

Features

  • πŸ”§ Manage installation, updates, and uninstallation of multiple CLI tools
  • πŸ“¦ npm-based package management
  • 🎯 Interactive command-line interface
  • πŸ“ User configuration files stored in ~/.clibundle directory
  • πŸš€ Support for batch operations
  • πŸ€– AI profiles and model switching with reusable multi-tool mappings

Installation

npm install -g clibundle

Usage

Initialize Configuration

Before first use, you need to initialize the configuration file:

clibundle init

This will create a .clibundle directory and a default tools.json configuration file in your home directory.

Launch Manager

Run the command directly to start the interactive menu:

clibundle

Command Line Options

# Show help information
clibundle --help

# Show version number
clibundle --version

# Initialize configuration file
clibundle init

# List all available tools with their installation status
clibundle list

# Install a specific tool
clibundle install <tool-name>

# Install all available tools
clibundle install --all

# Update a specific tool
clibundle update <tool-name>

# Update all installed tools
clibundle update --all

# Uninstall a specific tool
clibundle uninstall <tool-name>

# Uninstall all installed tools
clibundle uninstall --all

AI Model & Tools

Initialize AI configuration (creates ~/.clibundle/ai.json with defaults):

clibundle ai:init

List AI profiles and configured targets:

clibundle ai:list

Switch active AI profile:

clibundle ai:switch <profile-name>

Apply active/selected profile values (api base, model, etc.) to target config files:

# apply active profile to all targets
clibundle ai:apply

# apply a specific profile
clibundle ai:apply --profile anthopic-claude-3-5-sonnet

# apply to a single target by name/toolId
clibundle ai:apply --target openai-node-sdk

Configuration File

The configuration file is located at ~/.clibundle/tools.json with the following format:

{
  "version": "1.0.0",
  "description": "CLI Bundle tools configuration file",
  "tools": [
    {
      "id": "claude-code",
      "name": "Claude Code",
      "command": "claude",
      "installType": "npm",
      "packageName": "@anthropic-ai/claude-code",
      "description": "Anthropic official Claude CLI tool",
      "enabled": true
    },
    {
      "id": "iflow-cli",
      "name": "iFlow CLI",
      "command": "iflow",
      "installType": "npm",
      "packageName": "@iflow-ai/iflow-cli",
      "description": "iFlow AI CLI tool",
      "enabled": true
    },
    {
      "id": "openai-codex",
      "name": "OpenAI Codex",
      "command": "codex",
      "installType": "npm",
      "packageName": "@openai/codex",
      "description": "OpenAI Codex CLI tool for code generation",
      "enabled": true
    },
    {
      "id": "google-gemini",
      "name": "Google Gemini CLI",
      "command": "gemini",
      "installType": "npm",
      "packageName": "@google/gemini-cli",
      "description": "Google Gemini AI CLI tool",
      "enabled": true
    }
  ]
}

Configuration Field Descriptions

  • id: Unique identifier for the tool
  • name: Display name of the tool
  • command: Command-line command name
  • installType: Installation type (currently supports "npm")
  • packageName: npm package name
  • description: Tool description
  • enabled: Whether the tool is enabled

AI Configuration (ai.json)

Location: ~/.clibundle/ai.json

Simplified Configuration (v2.0)

Just configure providers and the active one:

{
  "version": "2.0.0",
  "providers": [
    {
      "name": "OpenAI Official",
      "type": "openai",
      "apiKey": "${OPENAI_API_KEY}",
      "baseUrl": "https://api.openai.com/v1",
      "model": "gpt-4o-mini"
    },
    {
      "name": "Anthropic Official",
      "type": "anthropic",
      "apiKey": "${ANTHROPIC_API_KEY}",
      "baseUrl": "https://api.anthropic.com",
      "model": "claude-3-5-sonnet-latest"
    },
    {
      "name": "Google Gemini",
      "type": "google",
      "apiKey": "${GEMINI_API_KEY}",
      "model": "gemini-1.5-pro"
    },
    {
      "name": "iFlow Official",
      "type": "iflow",
      "apiKey": "${IFLOW_API_KEY}",
      "baseUrl": "https://api.iflow.cn/v1",
      "model": "iflow-default"
    }
  ],
  "active": "OpenAI Official"
}

Configuration Fields

  • providers: List of AI providers, each contains:
    • name: Provider name (custom)
    • type: Provider type (openai/anthropic/google/iflow)
    • apiKey: API key, supports ${ENV_VAR} syntax
    • baseUrl: API base URL
    • model: Model name
  • active: Currently active provider name

Built-in Adapters

The tool automatically configures corresponding CLI tools based on provider.type:

  • openai β†’ Auto-configure ~/.codex/auth.json and ~/.codex/config.toml
  • anthropic β†’ Auto-configure ~/.claude/settings.json
  • google β†’ Auto-configure ~/.gemini/settings.json
  • iflow β†’ Auto-configure ~/.iflow/settings.json

Quick Start (3 Steps)

  1. Set environment variable (Windows PowerShell):
$env:OPENAI_API_KEY = "sk-..."
  1. Switch provider:
clibundle ai:switch "OpenAI Official"
  1. Apply configuration:
clibundle ai:apply

Supported Tools

Automatically writes to these configuration files:

Advanced: Custom Mappings (Optional)

To add custom mappings or support other tools, add customTargets field:

{
  "customTargets": [
    {
      "type": "json",
      "path": "~/custom/path/config.json",
      "mapping": {
        "apiKey": "auth.key",
        "baseUrl": "api.endpoint"
      }
    }
  ]
}

Development

Local Installation

# Clone repository
git clone <repository-url>
cd clibundle

# Install dependencies
npm install

# Link to global
npm link

# Run
clibundle

Project Structure

clibundle/
β”œβ”€β”€ bin/
β”‚   └── clibundle.js          # CLI entry file
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ config.js             # Configuration file handling
β”‚   β”œβ”€β”€ init.js               # Initialization management
β”‚   β”œβ”€β”€ package-manager.js    # Package manager operations
β”‚   β”œβ”€β”€ ui.js                 # User interface
β”‚   └── utils.js              # Utility functions
β”œβ”€β”€ config/
β”‚   └── tools.json            # Default tools configuration file
β”œβ”€β”€ package.json              # Project configuration
└── README.md                 # Project documentation

License

MIT

About

An npm-based CLI tool manager that supports installing, updating, and uninstalling various programming tools through an interactive menu.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published