Skip to content

apkg init

The init command creates an apkg.json manifest in the current directory through a series of interactive prompts. This is the first step when building a new package.

Terminal window
apkg init [--force]
OptionDescription
--forceOverwrite an existing apkg.json if present

Without --force, the command exits with an error if apkg.json already exists in the current directory.

The command walks you through each field:

PromptDefaultValidation
Package name (@scope/name)@<username>/<directory>Must be scoped, lowercase alphanumeric with hyphens, max 214 characters
Version0.1.0Must be valid semver
Package typeskillSelect from list (see below)
Description(empty)Free text
LicenseMITFree text
Keywords(empty)Comma-separated list

If you are logged in, the default package name uses your username as the scope (e.g. @alice/my-tool). Otherwise it defaults to @scope/<directory>.

TypeDescription
skillA reusable skill for AI assistants
agentAn autonomous agent package
mcp-serverA Model Context Protocol server
promptA prompt template
configA configuration package
libraryA shared library
compositeA bundle of multiple package types

The package name must:

  • Start with a scope: @username/name or @org/name
  • Use only lowercase letters, numbers, hyphens, dots, and underscores
  • Start and end with a letter or number (after the scope prefix)
  • Be 214 characters or fewer

After answering the prompts, the command writes apkg.json. A readme field is automatically included if a README.md file exists in the current directory. For a complete reference of all manifest fields, including type-specific options and dependency fields, see the apkg.json Schema Reference.

{
"name": "@alice/my-skill",
"version": "0.1.0",
"type": "skill",
"description": "A useful skill that does things",
"license": "MIT",
"readme": "README.md",
"keywords": ["example", "skill"]
}

Create a new package in the current directory:

Terminal window
mkdir my-skill && cd my-skill
apkg init

Reinitialize an existing package (overwrites apkg.json):

Terminal window
apkg init --force
CommandDescription
loginAuthenticate to set default scope
addAdd dependencies to the manifest
publishPack and upload the package to the registry