Publish
The ag2 publish command validates your artifact and submits it to the AG2 Resource Hub via a pull request.
Prerequisites#
- GitHub CLI (
gh) installed and authenticated - Git installed
- A valid
artifact.jsonin your artifact directory
Usage#
What It Does#
- Validates
artifact.json— checks required fields, type-specific config, and structure - Authenticates with GitHub via
gh - Forks
ag2ai/resource-hub(idempotent) - Clones the fork to a temp directory
- Copies your artifact to the correct directory (
tools/,templates/, etc.) - Commits and pushes to a new branch
- Opens a pull request with auto-generated description
Validation#
Before publishing, you can validate your artifact locally:
Validation checks include:
artifact.jsonis valid JSON with required fields (name,type,version,description)- Type-specific config is present and valid
- Expected directories and files exist
- Version follows semver
Scaffold an Artifact#
Use ag2 create artifact to generate the required structure: