add

Add an artifact to your project from a source repository.

Usage

agpm add <source> [artifact[@version]]

Arguments

ArgumentDescription
sourceRepository containing the artifact (e.g., anthropics/skills)
artifactName of specific artifact to add, optionally with version

Source Formats

The <source> argument accepts multiple formats:

  • owner/repo - GitHub shorthand
  • owner/repo#subpath - With subpath for monorepos
  • https://github.com/owner/repo - Full URL

Version Pinning

Artifacts can be pinned to specific versions using @ref syntax:

agpm add anthropics/skills pdf@v1.0.0    # Pin to tag
agpm add anthropics/skills pdf@main       # Pin to branch
agpm add anthropics/skills pdf@abc123     # Pin to SHA

Without a version, artifacts track HEAD and update to the latest commit when you run agpm update.

Examples

Add a specific skill from a repository:

agpm add anthropics/skills pdf

Add with a version pin:

agpm add anthropics/skills pdf@v1.0.0

Add from a repository with a subpath:

agpm add owner/repo#packages/skills my-skill

What Happens

  1. Clones the repository to ~/.agpm/repos/ (if not cached)
  2. Discovers available artifacts in the repository
  3. Adds the specified artifact to your agpm.json

After adding, run agpm install to install the artifact to your target directories.

See Also

  • install - Install added artifacts
  • update - Update artifacts to latest versions
  • Sources - Learn about source formats
  • Discovery - How artifacts are discovered