Skip to content

elvish-ishaan/agentpkg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AgentPKG

npm for AI agents - A package manager and registry for sharing, discovering, and managing AI agents and skills

License: MIT Version

AgentPKG is a comprehensive platform for publishing, discovering, and managing AI agents and skills. Just like npm revolutionized JavaScript package management, AgentPKG makes it effortless to share and reuse AI agent configurations across projects and teams.

Features

  • 🚀 CLI Tool: Publish and install agents/skills with simple commands (agentpkg publish agent, agentpkg add agent @org/agent)
  • 🔒 Private by Default: All agents and skills are private to your organization unless explicitly made public
  • 🏢 Organizations: Create organizations and invite team members to collaborate
  • 📦 Versioning: Semantic versioning support with version history tracking
  • 🔐 Access Control: Choose between private (org-only) or public access for each agent/skill
  • 🌐 Web UI: Browse, search, and manage agents/skills through a modern web interface
  • Integrity Checking: SHA-256 checksums verify file integrity during installation
  • Fast: Built with Bun runtime for maximum performance

What's Inside?

This is a Turborepo monorepo containing:

Apps

  • apps/cli: Command-line tool for publishing and installing agents/skills (CLI Documentation)
  • apps/api: Backend REST API with authentication, storage, and access control (API Documentation)
  • apps/web: Next.js web application for browsing and managing agents/skills (Web Documentation)

Packages

  • packages/eslint-config: Shared ESLint configurations
  • packages/typescript-config: Shared TypeScript configurations

Each package/app is 100% TypeScript.

Tech Stack

Quick Start

For Users: Installing the CLI

# Install Bun runtime
curl -fsSL https://bun.sh/install | bash

# Install AgentPKG CLI globally
bun install -g @agentpkg/cli

# Login (create account via web UI first at https://agentpkg.com)
agentpkg login

# Install an agent
agentpkg add agent @acme/my-agent

# Publish your agent
agentpkg publish agent

See CLI Documentation for complete usage guide.

For Developers: Setting Up the Platform

# Clone the repository
git clone https://github.com/elvish-ishaan/agentpkg.git
cd agentpkg

# Install dependencies
bun install

# Set up environment variables (see Environment Variables section)
cp apps/api/.env.example apps/api/.env
cp apps/web/.env.example apps/web/.env

# Set up database
cd apps/api
bun prisma migrate dev
bun prisma generate

# Start development servers
cd ../..
bun dev

This starts:

  • API server at http://localhost:4000
  • Web app at http://localhost:3000
  • CLI can connect to local API via AGENTPKG_API_URL=http://localhost:4000

Project Structure

agentpkg/
├── apps/
│   ├── api/                    # Backend REST API
│   │   ├── src/
│   │   │   ├── routes/         # API endpoints
│   │   │   ├── middleware/     # Auth, validation, error handling
│   │   │   ├── services/       # Business logic (GCS, email)
│   │   │   └── index.ts        # Express app entry point
│   │   ├── prisma/
│   │   │   ├── schema.prisma   # Database schema
│   │   │   └── migrations/     # Database migrations
│   │   └── package.json
│   │
│   ├── cli/                    # Command-line tool
│   │   ├── src/
│   │   │   ├── commands/       # CLI commands (login, publish, add, etc.)
│   │   │   ├── utils/          # Helpers (API client, validation, file I/O)
│   │   │   └── config/         # Configuration paths
│   │   ├── index.ts            # CLI entry point
│   │   └── package.json
│   │
│   └── web/                    # Web application
│       ├── app/                # Next.js app directory
│       ├── components/         # React components
│       ├── lib/                # Utilities and API client
│       └── package.json
│
├── packages/
│   ├── eslint-config/          # Shared ESLint config
│   └── typescript-config/      # Shared TypeScript config
│
├── turbo.json                  # Turborepo configuration
├── DESIGN.md                   # Architecture and design decisions
├── CHANGELOG.md                # Project changelog
└── README.md                   # This file

Development

Build All Apps and Packages

# Build everything
bun run build

# Build a specific app
bun run build --filter=cli
bun run build --filter=api
bun run build --filter=web

Development Mode

# Run all dev servers
bun dev

# Run specific app
bun dev --filter=api
bun dev --filter=web

Linting and Formatting

# Lint all packages
bun run lint

# Lint specific package
bun run lint --filter=cli

Documentation

Architecture

Authentication Flow

  1. User registers via web UI (creates user + default org)
  2. User logs in via CLI or web
  3. JWT token issued and stored locally (~/.agentpkg/config.json for CLI)
  4. Token included in API requests for authentication

Publishing Flow

  1. User creates agent.agent.md or SKILL.md file
  2. Runs agentpkg publish agent or agentpkg publish skill
  3. CLI validates file, prompts for metadata (org, version, access level)
  4. File uploaded to GCS with SHA-256 checksum
  5. Metadata stored in PostgreSQL with version tracking
  6. Default access: Private (org members only)

Access Control

  • Private (default): Only organization members can view and install
  • Public: Anyone can view and install
  • Ownership: Only org owners can change access levels
  • Filtering: API automatically filters results based on user membership

Installation Flow

  1. User runs agentpkg add agent @org/agent or agentpkg add skill @org/skill
  2. CLI requests agent/skill metadata from API
  3. API checks user permissions (public access OR user is org member)
  4. CLI downloads file from GCS
  5. Verifies checksum matches
  6. Saves to .github/agents/ or .github/skills/ directory

Deployment

API Deployment

# Build for production
cd apps/api
bun install --production
bun run build

# Run migrations
bun prisma migrate deploy

# Start server
bun run start

Environment: Node.js/Bun-compatible platform (e.g., Railway, Render, Fly.io)

Web Deployment

# Build for production
cd apps/web
bun run build

# Start server
bun run start

Recommended: Deploy to Vercel for optimal Next.js performance

CLI Publishing

# Publish to npm
cd apps/cli
bun run build  # If needed
npm publish

See CLI PUBLISHING.md for detailed npm publishing instructions.

Environment Variables

API (apps/api/.env)

# Database
DATABASE_URL="postgresql://user:password@localhost:5432/agentpkg"

# JWT Secret (generate with: openssl rand -base64 32)
JWT_SECRET="your-secret-key"

# Google Cloud Storage
GCS_PROJECT_ID="your-project-id"
GCS_BUCKET_NAME="agentpkg-storage"
GCS_KEY_FILE="path/to/service-account-key.json"

# Email (optional, for invitations)
SMTP_HOST="smtp.gmail.com"
SMTP_PORT="587"
SMTP_USER="your-email@gmail.com"
SMTP_PASS="your-app-password"
SMTP_FROM="AgentPKG <noreply@agentpkg.com>"

# Server
PORT="4000"

Web (apps/web/.env)

# API URL
NEXT_PUBLIC_API_URL="http://localhost:4000"

# Or for production
NEXT_PUBLIC_API_URL="https://api.agentpkg.com"

CLI (for users)

# Set API URL (default: https://api.agentpkg.com)
export AGENTPKG_API_URL="http://localhost:4000"  # For local development

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Versioning

This project uses Semantic Versioning:

  • Current Version: 0.2.0
  • Major.Minor.Patch (e.g., 1.2.3)
  • See CHANGELOG.md for version history

License

MIT License - see LICENSE file for details

Support


Built with ❤️ by Elvish Ishaan

About

AgentPkg is a cutting-edge platform designed to streamline the development, deployment, and management of AI agents.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages