A simple command-line tool for testing APort agent verification and passport management. Perfect for developers who want to quickly test APort functionality without building a full integration.
- Node.js 18+
- APort API key (optional for verification commands, required for passport management)
# Clone the repository
git clone https://github.com/aporthq/aport-integrations.git
cd aport-integrations/examples/developer-tools/cli
# Install dependencies
npm install
# Optional: Set up environment for passport management
cp env.example .env
# Edit .env with your APort API key (only needed for create-passport, get-passport)# Run the demo (uses sample agent IDs) - NO API KEY NEEDED!
npm start demo
# Interactive verification - NO API KEY NEEDED!
npm start verify -- --interactive
# Direct verification with real agent IDs - NO API KEY NEEDED!
npm start verify ap_a2d10232c6534523812423eec8a1425c finance.payment.refund.v1 '{"amount":50}'
# Or using options
npm start verify -a ap_a2d10232c6534523812423eec8a1425c -p finance.payment.refund.v1 -c '{"amount":50}'
# Get passport information - NO API KEY NEEDED!
npm start get-passport -- --interactive
# Create a new passport (requires API key)
npm start create-passport -- --interactive# Interactive mode
aport verify --interactive
# Direct mode (positional arguments)
aport verify agt_inst_refund_bot_123 finance.payment.refund.v1 '{"amount":50}'
# Direct mode (options)
aport verify -a agt_inst_refund_bot_123 -p finance.payment.refund.v1 -c '{"amount":50}'aport policy -a agt_inst_data_exporter_456 -p data.export.v1 -c '{"rows":1000}'# Interactive mode
aport create-passport --interactive
# Default mode (creates test passport)
aport create-passport# Interactive mode (no API key needed!)
aport get-passport --interactive
# Direct mode (no API key needed!)
aport get-passport -a ap_a2d10232c6534523812423eec8a1425caport demoaport helpThe CLI includes pre-configured sample agent IDs for testing:
| Agent | ID | Description |
|---|---|---|
refund-bot |
agt_inst_refund_bot_123 |
Handles refund processing |
data-exporter |
agt_inst_data_exporter_456 |
Exports data with limits |
pr-merger |
agt_inst_pr_merger_789 |
Merges pull requests |
Test against these policy packs:
finance.payment.refund.v1- Refund processing policiesdata.export.v1- Data export policiescode.repository.merge.v1- Repository operation policiesadmin.access.v1- Admin access policies
# Optional - Only needed for create-passport command
APORT_API_KEY=your_api_key_here
# Optional - Override default API endpoint
APORT_BASE_URL=https://aport.ioNote: Most commands (verify, policy, get-passport, demo) work without an API key! Only create-passport requires authentication.
The CLI uses a simple API client that handles:
- β
Agent verification (
/api/verify) - β
Policy verification (
/api/verify/policy/{policy}) - β
Passport creation (
/api/issue) - β
Passport retrieval (
/api/passports/{id}) - β
Passport suspension (
/api/suspend) - β
Policy pack listing (
/api/policies)
# Run tests
npm test
# Run demo
npm start demoaport verify -a agt_inst_refund_bot_123 -p finance.payment.refund.v1 -c '{"amount":50,"currency":"USD"}'aport create-passport --interactiveaport policy -a agt_inst_data_exporter_456 -p data.export.v1 -c '{"rows":5000,"dataset":"users"}'aport get-passport -a agt_inst_admin_bot_101- Interactive Mode: Easy-to-use prompts for all operations
- Sample Data: Pre-configured agent IDs for quick testing
- Error Handling: Clear error messages and validation
- Colored Output: Beautiful terminal output with chalk
- Spinner: Loading indicators for API calls
- Demo Mode: Complete walkthrough of all features
src/
βββ index.js # CLI commands and interface
βββ client.js # APort API client
βββ ...
package.json # Dependencies and scripts
env.example # Environment variables template
README.md # This file
- Add command to
program.command()insrc/index.js - Implement the command logic
- Add corresponding API method to
src/client.jsif needed - Update this README
verify(policy, agentId, context)- Verify agentverifyPolicy(policy, agentId, context)- Verify specific policycreatePassport(passportData)- Create passportgetPassport(agentId)- Get passportsuspendPassport(agentId, reason)- Suspend passportgetPolicyPack(policyId)- Get policy packlistPolicyPacks()- List all policy packs
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT
π‘οΈ Secure your AI agents. Trust but verify.
Made with β€οΈ by the APort community