Pants plugin for installing Claude Code plugins into projects
Project description
pants-claude-plugins
A Pants plugin for installing Claude Code plugins into your projects.
Define claude_plugin targets in your BUILD files, then run pants claude-install :: to install them all.
Installation
From PyPI
# pants.toml
[GLOBAL]
plugins = ["jaymd96-pants-claude-plugins==0.1.0"]
backend_packages = ["pants_claude_plugins"]
From Source (in-repo)
# pants.toml
[GLOBAL]
pythonpath = ["%(buildroot)s/pants-plugins/pants-claude-plugins/src"]
backend_packages = ["pants_claude_plugins"]
Quick Start
-
Add a marketplace (if not using the official one):
claude /plugin marketplace add anthropics/claude-code
-
Define plugins in BUILD files:
# tools/claude/BUILD claude_plugin( name="github-integration", plugin="github", marketplace="claude-plugins-official", scope="project", description="GitHub integration for PR workflows", ) claude_plugin( name="commit-commands", plugin="commit-commands", marketplace="anthropics-claude-code", scope="project", tags=["workflow"], )
-
Install all plugins:
pants claude-install ::
Target Reference
claude_plugin
Defines a Claude Code plugin to be installed.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
plugin |
string | ✓ | - | Plugin name (e.g., "github", "commit-commands") |
marketplace |
string | ✓ | - | Marketplace identifier (e.g., "claude-plugins-official") |
scope |
string | subsystem default | Installation scope: "project", "user", or "local" | |
enabled |
bool | True |
Whether to install this plugin | |
description |
string | Human-readable description | ||
tags |
list[string] | Tags for filtering |
Installation Scopes
- project: Install for all collaborators (adds to
.claude/settings.json) - user: Install for the current user across all projects
- local: Install for yourself in this repository only
Configuration
Configure the plugin in pants.toml:
[claude-plugins]
# Default scope when not specified per-target
default_scope = "project"
# Path to claude binary (or leave as "claude" to use $PATH)
claude_binary = "claude"
# Skip installation entirely (useful for CI without Claude)
skip = false
# Fail the build if any plugin installation fails
fail_on_error = true
# Preview what would be installed without installing
dry_run = false
Usage Examples
Install All Plugins
pants claude-install ::
Install Plugins in a Directory
pants claude-install tools/claude:
Install Specific Plugin
pants claude-install tools/claude:github-integration
Dry Run (Preview)
pants claude-install --dry-run ::
Skip in CI
# In CI where Claude isn't installed
pants claude-install --skip ::
Filter by Tags
pants --tag=required claude-install ::
Example Project Structure
my-project/
├── pants.toml
├── tools/
│ └── claude/
│ └── BUILD
├── src/
│ └── ...
└── .claude/
└── settings.json # Updated by claude-install
Example BUILD File
# tools/claude/BUILD
# Official Anthropic plugins
claude_plugin(
name="github",
plugin="github",
marketplace="claude-plugins-official",
scope="project",
description="GitHub integration for issues and PRs",
)
claude_plugin(
name="typescript-lsp",
plugin="typescript-lsp",
marketplace="claude-plugins-official",
scope="project",
description="TypeScript language server for code intelligence",
)
# Demo marketplace plugins
claude_plugin(
name="commit-commands",
plugin="commit-commands",
marketplace="anthropics-claude-code",
scope="project",
tags=["workflow"],
)
# Disabled plugin (kept for documentation)
claude_plugin(
name="experimental",
plugin="some-experimental-plugin",
marketplace="my-org-marketplace",
enabled=False,
description="Not ready for team use yet",
)
Requirements
- Pants 2.18.0 or later
- Python 3.11+
- Claude Code CLI installed and available in
$PATH
Contributing
- Clone the repository
- Install development dependencies:
hatch env create - Run tests:
hatch run test - Format code:
hatch run fmt - Check linting:
hatch run lint
License
MIT License - see LICENSE for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jaymd96_pants_claude_plugins-0.1.0.tar.gz.
File metadata
- Download URL: jaymd96_pants_claude_plugins-0.1.0.tar.gz
- Upload date:
- Size: 9.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.13.0 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93eb3e46a038683bb0c2e5a3e1ef0d94a5b58cfad9d404259cbaf46e79051c9f
|
|
| MD5 |
f08d1c6e920d013204cc2538aa522a6e
|
|
| BLAKE2b-256 |
dfeae3634b0bc61be9d5f34c1640dad68b60379ebfa89178b3890c492cbd86d3
|
File details
Details for the file jaymd96_pants_claude_plugins-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jaymd96_pants_claude_plugins-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.13.0 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c36478bb50bec236018d1a5d0f8820416a9716b0efc8c0d33eef7c2783e7b14
|
|
| MD5 |
8b3825db52f98b82656e99a6facfcc58
|
|
| BLAKE2b-256 |
070d8bd949bfefaebab239d34e40b8141ae83a7a983ebd920dec40e4c697a0b8
|