apkg add
The add command downloads a package from the registry, extracts it into your project, and records it as a dependency in apkg.json. It also updates apkg-lock.json to pin the resolved version and integrity hash.
An apkg.json manifest must already exist in the current directory. Run apkg init first if you haven’t already.
Synopsis
Section titled “Synopsis”apkg add <package> [--setup <tool>] [--no-setup]The <package> argument accepts several formats:
| Format | Example | Behavior |
|---|---|---|
@scope/name | @acme/code-reviewer | Installs the latest tagged version |
@scope/name@<version> | @acme/[email protected] | Installs an exact version |
@scope/name@<tag> | @acme/code-reviewer@beta | Installs the version behind a dist-tag |
Options
Section titled “Options”| Option | Description |
|---|---|
--setup <tool> | Generate configuration for a specific tool (e.g. claude-code) |
--no-setup | Skip post-install tool setup entirely |
Version resolution
Section titled “Version resolution”When no version is specified, apkg resolves the latest dist-tag. If no latest tag exists, it falls back to the highest published semver version.
The resolved version is saved in apkg.json as a caret range (e.g. ^1.2.0), allowing compatible updates via apkg update.
Tool setup
Section titled “Tool setup”After installing a package of type skill or agent, apkg can automatically generate configuration files for your AI coding tools. Use --setup claude-code to target a specific tool, or --no-setup to skip setup entirely. See Tool Setup Explained for how detection, precedence, and file generation work.
Examples
Section titled “Examples”Add a package:
apkg add @acme/code-reviewerAdd a specific version:
Add a package and set up Claude Code configuration:
apkg add @acme/code-reviewer --setup claude-codeAdd a package without running tool setup:
apkg add @acme/code-reviewer --no-setupRelated commands
Section titled “Related commands”| Command | Description |
|---|---|
init | Create an apkg.json manifest |
config | Set defaultSetup to control automatic tool setup |
remove | Remove a package from your dependencies |
install | Install all dependencies from apkg.json |
update | Update packages to latest compatible versions |