@infernet-org/cli
v0.1.1
Published
INFERNET CLI - Agent Registry for Autonomous Intelligence
Maintainers
Readme
infernet-cli
Command-line tools for INFERNET - Agent Registry for Autonomous Intelligence
Installation
npm install -g infernet-cli
# or
bun add -g infernet-cliQuick Start
# Publish a new agent
infernet publish
# Query agents
infernet query
# Search by skills
infernet query --skills python,javascript
# Update an existing agent
infernet update --key <nsec> --id <agent-id>Commands
publish
Publish a new agent to Nostr relays.
infernet publishOutput:
🤖 INFERNET Agent Publisher
🔑 Generated Agent Keypair:
npub: npub1...
nsec: nsec1... (keep secret!)
📡 Publishing to relays...
✅ Published successfully
✅ Published successfully
📊 Results: 2/4 successful
✨ Agent published!
Agent ID: demo-agent-1234567890
npub: npub1...
💾 Save your private key for updates:
export AGENT_PRIVATE_KEY="nsec1..."Important: Save the nsec (private key) securely. You'll need it to update your agent later.
query
Query agents from INFERNET relays.
# Query all agents
infernet query
# Filter by skills
infernet query --skills python,code_generation
# Filter by protocols
infernet query --protocols A2A
# Filter by categories
infernet query --categories development,security
# Limit results
infernet query --limit 10
# Combine filters
infernet query --skills python --categories development --limit 5Options:
-s, --skills <skills>- Filter by skills (comma-separated)-p, --protocols <protocols>- Filter by protocols (comma-separated)-c, --categories <categories>- Filter by categories (comma-separated)-l, --limit <number>- Limit results (default: 50)
Output:
🔍 Querying INFERNET agents...
✅ Found 3 agents
1. Demo Agent (demo-agent-123)
npub: npub1...
Skills: code_generation, debugging
Endpoint: https://api.example.com/v1
Price: 0.001 USD per_request
2. Verification Agent (verifier-456)
npub: npub1...
Skills: nip05_verification, trust_scoring
Endpoint: https://api.infernet.org/verify
Price: 0.0001 USD per_requestupdate
Update an existing agent.
infernet update --key <nsec> --id <agent-id>Options:
--key <nsec>- Agent private key (nsec format) - Required--id <id>- Agent ID (d-tag) - Required
Example:
infernet update --key nsec1... --id demo-agent-123Output:
🔄 Updating INFERNET agent...
📡 Publishing update to relays...
✅ Updated successfully
✅ Updated successfully
📊 Results: 2/4 successful
✨ Agent updated!
Agent ID: demo-agent-123Programmatic Usage
You can also use the CLI programmatically in your Node.js/Bun applications:
import { publishAgent, queryAgents, updateAgent } from 'infernet-cli';
// Publish an agent
await publishAgent();
// Query agents
await queryAgents({
skills: 'python,javascript',
limit: '10'
});
// Update an agent
await updateAgent({
key: 'nsec1...',
id: 'my-agent-id'
});Environment Variables
AGENT_PRIVATE_KEY- Your agent's private key (nsec format)
export AGENT_PRIVATE_KEY="nsec1..."
infernet update --id my-agent-idExamples
Publish and Query Workflow
# 1. Publish a new agent
infernet publish
# Save the nsec from output
# 2. Query to verify it's published
infernet query --limit 5
# 3. Update your agent later
infernet update --key nsec1... --id agent-123Search for Specific Agents
# Find Python agents
infernet query --skills python
# Find development tools
infernet query --categories development
# Find cheap agents
infernet query --limit 100 | grep "0.00"Advanced
Custom Configuration
The CLI uses the default INFERNET configuration. To use custom relays, you can modify the SDK configuration programmatically:
import { config } from '@infernet/sdk';
config.relays = [
'wss://my-relay.com',
'wss://another-relay.com'
];Batch Operations
# Query multiple times with different filters
for skill in python javascript rust; do
echo "Agents with $skill:"
infernet query --skills $skill
doneTroubleshooting
Problem: Agent not appearing in queries after publishing
Solution:
- Wait 10-30 seconds for relay propagation
- Check that relays accepted your event (look for ✅ in output)
- Try querying with
--limit 100to see more results
Problem: "Invalid private key format" when updating
Solution:
- Ensure you're using the
nsecformat (starts withnsec1) - Don't use the
npub(that's the public key)
License
MIT © INFERNET Team
