Skip to content

Kavirubc/wso2-amp-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

32 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ WSO2 AMP CLI

Release Go Version License

A powerful command-line interface for managing the WSO2 AI Agent Management Platform.

Note: This is a community-maintained CLI tool that provides terminal-based access to the WSO2 Agent Management Platform. It is aligned with Agent Manager v0.4.0.

๐Ÿ“‹ Table of Contents

โœจ Features

  • Full Platform Coverage - Manage organizations, projects, agents, builds, deployments, and more
  • Distributed Tracing - View and export traces with span tree visualization
  • Real-time Monitoring - Access runtime logs and resource metrics
  • Repository Integration - Query GitHub branches and commits
  • Multiple Output Formats - Table and JSON output for scripting
  • Interactive Mode - REPL-style interface for quick commands
  • Shell Completion - Bash, Zsh, and Fish autocompletion support
  • CI/CD Ready - Easily integrate into automation pipelines

๐Ÿ“ฆ Installation

From Source (requires Go 1.21+)

git clone https://github.com/Kavirubc/wso2-amp-cli.git
cd wso2-amp-cli
go build -o amp ./cmd/amp

Using go install

go install github.com/Kavirubc/wso2-amp-cli/cmd/amp@latest

Pre-built Binaries

Download from the Releases page.

๐Ÿš€ Quick Start

# 1. Run the setup wizard
amp login

# 2. List your agents
amp agents list

# 3. View agent details
amp agents get my-agent

# 4. Deploy an agent
amp deploy --agent my-agent --image build-123

๐Ÿ“š Command Overview

Category Commands Description
Auth login, logout Authentication and configuration
Organizations orgs list, orgs get, orgs create Manage organizations
Projects projects list, projects get, projects create, projects delete Manage projects
Agents agents list, agents get, agents create, agents delete Manage agents
Agent Ops agents token, agents logs, agents metrics, agents config Agent operations
Builds builds list, builds get, builds trigger, builds logs Build management
Deployments deploy, deployments list, deployments endpoints Deploy and manage
Traces traces list, traces get, traces export Distributed tracing
Repositories repos branches, repos commits GitHub repository queries
Utilities utils name Helper utilities
Infrastructure environments list, dataplanes list, pipelines list Platform resources
Config config set, config get, config list CLI configuration

For detailed command documentation, see docs/COMMANDS.md.

โš™๏ธ Configuration

Using Login Command (Recommended)

amp login

This interactive wizard guides you through:

  • Setting the API server URL
  • Authenticating with your token
  • Selecting default organization and project

Manual Configuration

# Set API server URL
amp config set api_url https://your-server.com/api/v1

# Set authentication
amp config set api_key_header Authorization
amp config set api_key "Bearer your-token"

# Set defaults for convenience
amp config set default_org your-org
amp config set default_project your-project

# View current configuration
amp config list

Configuration File

Settings are stored in ~/.amp/config.yaml:

Key Description
api_url API server URL
api_key_header Authentication header name
api_key Authentication token
default_org Default organization
default_project Default project

๐Ÿ“– Documentation

Document Description
docs/COMMANDS.md Complete command reference with all flags and examples
docs/api-spec.yaml API endpoint mapping and type definitions

๐Ÿ’ก Examples

Deploy a New Agent

# 1. Create the agent
amp agents create \
  --display-name "My API Agent" \
  --provisioning internal \
  --repo-url https://github.com/user/my-agent \
  --branch main \
  --language python \
  --language-version 3.11 \
  --subtype custom-api

# 2. Wait for build to complete
amp builds list --agent my-api-agent

# 3. Deploy to development
amp deploy --agent my-api-agent --image build-xyz

# 4. Check deployment status
amp deployments list --agent my-api-agent

# 5. Get the endpoint URL
amp deployments endpoints --agent my-api-agent --env development

Monitor an Agent

# View resource metrics
amp agents metrics --agent my-agent --env development

# View runtime logs
amp agents logs --agent my-agent --env development --level ERROR,WARN

# List recent traces
amp traces list --agent my-agent --env development --since 1h

# Export traces for analysis
amp traces export --agent my-agent --env dev --file traces.json

Generate Agent Token

# Generate token for OTEL trace ingestion
amp agents token --agent my-agent --expires-in 7d

# Use in scripts
export AGENT_TOKEN=$(amp agents token --agent my-agent --output json | jq -r .token)

Query Repository Information

# List branches
amp repos branches --owner wso2 --repo agent-manager

# List commits with filters
amp repos commits --url https://github.com/wso2/agent-manager --branch main --limit 20

# Generate resource name from display name
amp utils name --display-name "My New Agent" --type agent --project-name myproject

Interactive Mode

Run amp without arguments:

$ amp
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚                    WSO2 AMP CLI                         โ”‚
โ”‚          AI Agent Management Platform                   โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

amp> orgs list
amp> agents list
amp> exit

๐Ÿ”ง Global Flags

Flag Short Description
--org -o Organization name
--project -p Project name
--output Output format: table or json
--limit Maximum results to return
--offset Pagination offset
--verbose -v Enable debug output
--help -h Show help

๐Ÿ› ๏ธ Development

# Run without building
go run ./cmd/amp agents list

# Build
go build -o amp ./cmd/amp

# Run tests
go test ./...

# Vet
go vet ./...

Project Structure

wso2-amp-cli/
โ”œโ”€โ”€ cmd/
โ”‚   โ”œโ”€โ”€ amp/          # Main entry point
โ”‚   โ”œโ”€โ”€ agents.go     # Agent commands
โ”‚   โ”œโ”€โ”€ builds.go     # Build commands
โ”‚   โ”œโ”€โ”€ repos.go      # Repository commands
โ”‚   โ”œโ”€โ”€ utils.go      # Utility commands
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ internal/
โ”‚   โ”œโ”€โ”€ api/          # API client
โ”‚   โ”œโ”€โ”€ config/       # Configuration management
โ”‚   โ””โ”€โ”€ ui/           # Terminal UI components
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ COMMANDS.md   # Command reference
โ”‚   โ””โ”€โ”€ api-spec.yaml # API specifications
โ””โ”€โ”€ README.md

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

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

๐Ÿ“„ License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.


Related Links:

About

A CLI tool for managing the WSO2 AI Agent Management Platform.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages