Skip to main content

Batch Component Installation

Batch installation allows you to install multiple components across different types in a single command. This is ideal for setting up new projects, sharing team configurations, or deploying standardized development environments.

Why Batch Install?

Speed

Install 10 components in one command instead of running 10 separate commands

Consistency

Ensure all team members have the same components installed

Automation

Script entire project setups in CI/CD pipelines

Discovery

Share component bundles with colleagues via single command

Basic Batch Installation

Combine multiple component flags in a single command:
npx claude-code-templates@latest \
  --agent security-auditor \
  --agent frontend-developer \
  --command setup-testing \
  --mcp filesystem \
  --setting enable-telemetry
Flag Order: Component flags can appear in any order. The CLI installs them sequentially.

Multi-Type Installation

1
Install Agents and Commands
2
npx claude-code-templates@latest \
  --agent backend-developer \
  --agent database-expert \
  --command docker-setup \
  --command git-setup
3
Installs:
4
  • .claude/agents/backend-developer.md
  • .claude/agents/database-expert.md
  • .claude/commands/docker-setup.md
  • .claude/commands/git-setup.md
  • 5
    Add MCPs and Settings
    6
    npx claude-code-templates@latest \
      --agent security-auditor \
      --mcp web-fetch \
      --mcp filesystem \
      --setting read-only-mode
    
    7
    Installs:
    8
  • .claude/agents/security-auditor.md
  • Merges MCP configs into .mcp.json
  • Prompts for settings installation location
  • 9
    Include Hooks
    10
    npx claude-code-templates@latest \
      --agent code-reviewer \
      --command lint-code \
      --hook git/prevent-force-push \
      --setting use-sonnet
    
    11
    Installs:
    12
  • Agent and command files
  • Hook configuration in settings
  • Model preference setting
  • Comma-Separated Values

    You can use comma-separated values for the same component type:
    npx claude-code-templates@latest \
      --agent "security-auditor,frontend-developer,backend-developer" \
      --command "docker-setup,git-setup,setup-testing"
    
    Quoting Required: When using commas, wrap the entire value in quotes to prevent shell interpretation.

    Batch with Directory Target

    Install all components to a specific project:
    npx claude-code-templates@latest \
      --agent security-auditor \
      --agent performance-optimizer \
      --command security-scan \
      --directory ./my-project
    

    Batch with Auto-Confirm

    Skip all prompts using --yes:
    npx claude-code-templates@latest \
      --agent security-auditor \
      --mcp web-fetch \
      --setting enable-telemetry \
      --yes
    
    The --yes flag:
    • Uses default installation locations for settings/hooks (local settings)
    • Auto-confirms all merge operations
    • Skips interactive prompts
    • Ideal for CI/CD and scripted installations

    Settings and Hooks Location

    When batch installing settings or hooks, you can pre-specify the installation location:

    Method 1: Interactive (Default)

    npx claude-code-templates@latest \
      --setting enable-telemetry \
      --hook git/pre-commit-lint
    
    You’ll be prompted once for where to install ALL settings and hooks:
    ? Where would you like to install these components?
     User settings (~/.claude/settings.json)
     Project settings (.claude/settings.json)
     Local settings (.claude/settings.local.json)
    

    Method 2: Auto with —yes

    npx claude-code-templates@latest \
      --setting enable-telemetry \
      --hook git/pre-commit-lint \
      --yes
    
    Automatically installs to local settings (.claude/settings.local.json).

    Use Cases

    New Project Setup

    Complete development environment in one command:
    npx claude-code-templates@latest \
      --agent frontend-developer \
      --agent backend-developer \
      --agent database-expert \
      --command docker-setup \
      --command setup-testing \
      --mcp filesystem \
      --mcp web-fetch \
      --setting use-sonnet \
      --directory ./new-project
    

    Team Standardization

    Ensure all team members have consistent tooling:
    # Add to README.md or onboarding script
    npx claude-code-templates@latest \
      --agent code-reviewer \
      --agent documentation-writer \
      --command lint-code \
      --command generate-tests \
      --hook git/pre-commit-lint \
      --hook automation/simple-notifications \
      --yes
    

    CI/CD Pipeline

    Script component installation in your CI pipeline:
    name: Setup Claude Code
    on: [push]
    
    jobs:
      setup:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v3
          
          - name: Install Claude Code Components
            run: |
              npx claude-code-templates@latest \
                --agent code-reviewer \
                --command lint-code \
                --command security-scan \
                --yes
    

    Docker Container Setup

    Include in your Dockerfile:
    FROM node:20-alpine
    
    WORKDIR /app
    
    # Install Claude Code components
    RUN npx claude-code-templates@latest \
      --agent backend-developer \
      --command docker-setup \
      --mcp filesystem \
      --yes
    
    COPY . .
    
    CMD ["npm", "start"]
    

    Component Discovery for Batch Installation

    1
    Use the Shopping Cart
    2
  • Visit aitmpl.com
  • Browse and add components to cart
  • Click “View Cart”
  • Copy the generated batch command
  • 3
    # Example generated command
    npx claude-code-templates@latest \
      --agent security-auditor \
      --agent frontend-developer \
      --command setup-testing \
      --mcp web-fetch
    
    4
    Share Cart URLs
    5
    The cart URL contains all selected components:
    6
    https://aitmpl.com/?cart=agent:security-auditor,agent:frontend-developer,command:setup-testing
    
    7
    Share this URL with teammates to install the same component set.
    8
    Export from Interactive Mode
    9
    Run interactive mode and export your selection:
    10
    npx claude-code-templates@latest
    
    11
  • Select “Project Setup”
  • Choose components interactively
  • At the end, get the equivalent batch command
  • Batch Installation Output

    The CLI provides detailed progress for batch installations:
    $ npx claude-code-templates@latest \
        --agent security-auditor \
        --command security-scan \
        --mcp web-fetch
    
    🤖 Installing agent: security-auditor
    📥 Downloading from GitHub (main branch)...
     Agent "security-auditor" installed successfully!
    📁 Installed to: .claude/agents/security-auditor.md
    
     Installing command: security-scan
    📥 Downloading from GitHub (main branch)...
     Command "security-scan" installed successfully!
    📁 Installed to: .claude/commands/security-scan.md
    
    🔌 Installing MCP: web-fetch
    📥 Downloading from GitHub (main branch)...
    📝 Existing .mcp.json found, merging configurations...
     MCP "web-fetch" installed successfully!
    📁 Configuration merged into: .mcp.json
    
    🎉 Batch installation complete! Installed 3 components.
    

    Error Handling

    Batch installations handle errors gracefully:

    Partial Success

    If one component fails, others continue:
     Agent "security-auditor" installed successfully!
     Command "non-existent-command" not found
     MCP "web-fetch" installed successfully!
    
    ⚠️ Batch installation completed with errors.
       Successful: 2/3 components
       Failed: 1/3 components
    

    Rollback Not Supported

    No Automatic Rollback: If a component fails, previously installed components are NOT automatically removed. This is intentional to prevent data loss.
    To undo:
    # Manually remove installed components
    rm .claude/agents/security-auditor.md
    rm .claude/commands/security-scan.md
    

    Best Practices

    1. Group by Purpose

    Organize batch commands by project type:
    # Save as scripts/setup-frontend.sh
    npx claude-code-templates@latest \
      --agent frontend-developer \
      --agent ui-ux-designer \
      --command setup-react \
      --command setup-testing \
      --mcp web-fetch \
      --yes
    

    2. Document in README

    Add setup instructions to your project:
    ## Claude Code Setup
    
    Install required components:
    
    \`\`\`bash
    npx claude-code-templates@latest \
      --agent backend-developer \
      --command docker-setup \
      --mcp database \
      --yes
    \`\`\`
    

    3. Use Version Pinning

    For reproducibility, pin to a specific version:
    npx claude-code-templates@1.2.3 \
      --agent security-auditor \
      --command security-scan
    

    4. Separate Concerns

    Split personal vs. team components:
    # Team setup (in repo docs)
    npx claude-code-templates@latest \
      --agent code-reviewer \
      --command lint-code \
      --yes
    
    # Personal setup (in private notes)
    npx claude-code-templates@latest \
      --agent ai-assistant \
      --setting theme-dark \
      --yes
    

    Combining with Workflows

    You can combine batch installation with workflow YAML:
    # Install components and apply workflow
    npx claude-code-templates@latest \
      --agent security-auditor \
      --command security-scan \
      --workflow "$(cat workflow.yaml | base64)"
    
    See Workflows Guide for details.

    Troubleshooting

    Command Too Long

    If your batch command is very long: Solution 1: Use a Script
    #!/bin/bash
    # setup-components.sh
    
    npx claude-code-templates@latest \
      --agent security-auditor \
      --agent frontend-developer \
      --agent backend-developer \
      --command docker-setup \
      --command setup-testing \
      --mcp filesystem \
      --mcp web-fetch \
      --yes
    
    chmod +x setup-components.sh
    ./setup-components.sh
    
    Solution 2: Use Workflow Hashes Create a workflow at aitmpl.com/workflows and use the short hash:
    npx claude-code-templates@latest --workflow:#abc123def456
    

    Permission Issues

    If batch install fails on specific components:
     Agent installed
     Failed to write settings: Permission denied
     MCP installed
    
    Solution: Install settings to user directory:
    npx claude-code-templates@latest \
      --setting enable-telemetry \
      --yes  # Auto-installs to local settings
    

    Network Timeouts

    Large batch installs may timeout:
     Error: Request timeout after 30s
    
    Solution: Split into smaller batches:
    # Batch 1: Agents
    npx claude-code-templates@latest \
      --agent security-auditor \
      --agent frontend-developer \
      --yes
    
    # Batch 2: Commands and MCPs
    npx claude-code-templates@latest \
      --command docker-setup \
      --mcp filesystem \
      --yes
    

    Next Steps

    Interactive Mode

    Use the visual component selector

    Workflows

    Create reusable installation workflows

    Global Agents

    Create globally accessible agents

    Component Browser

    Browse all available components