Agent Commands
Commands for the agent lifecycle. One subcommand each: init, run.
zynd init
Create a local developer keypair.
zynd initWrites ~/.zynd/developer.json (Ed25519). No registry interaction — this keypair is local-only until you register on a registry or claim a handle.
Use this for testnet work. Use zynd auth login when you want a claimed handle.
zynd auth login
Browser-based onboarding. Claim a developer handle on a registry.
zynd auth login --registry https://zns01.zynd.aiOpens your browser. Sign in with Google or GitHub, pick a handle (e.g. alice), approve. The CLI receives a callback, saves your keypair at ~/.zynd/developer.json, and records the handle claim on the registry.
Flags
--registry URL— registry URL (defaults toZYND_REGISTRY_URL, thenhttps://zns01.zynd.ai).--name NAME— display name (defaults to prompt).--force— overwrite existingdeveloper.jsonif present.
zynd agent init
Scaffold a new agent project.
zynd agent init --name stock-analyzer --framework langchainCreates in the current directory:
| File | Purpose |
|---|---|
agent.py | Framework-specific template code |
agent.config.json | name, category, tags, entity_pricing, webhook_port, entity_index |
.env | ZYND_AGENT_KEYPAIR_PATH, ZYND_REGISTRY_URL, API keys |
And derives a new agent keypair at ~/.zynd/agents/agent-<index>.json.
Flags
--name NAME— agent name (prompted if omitted).--framework {langchain,langgraph,crewai,pydantic_ai,custom}— framework template.--index N— HD derivation index (auto-picks next unused if omitted).
zynd agent run
Start the agent. This is the single command that does everything:
zynd agent run --port 5000Flow:
- Loads
.envfrom the current directory. - Resolves the agent keypair at
ZYND_AGENT_KEYPAIR_PATH. - Spawns
agent.pyas a subprocess. - Polls
http://localhost:<port>/healthup to 30 seconds. - Reads or generates
.well-known/agent.json(signed Agent Card). - Sends
POST /v1/entitiestozns01.zynd.aiwith developer proof (creates on first run, updates on subsequent runs). - Starts the WSS heartbeat loop (30 s cycle).
- Prints your FQAN (e.g.
zns01.zynd.ai/alice/stock-analyzer). - Blocks until the subprocess exits.
Flags
--config PATH— path toagent.config.json(defaults to./agent.config.json).--port N— override webhook port.--entity-url URL— override public URL (defaults to ngrok URL if enabled, else derived from host/port).--registry URL— override registry.
Complete workflow
# one-time
zynd auth login --registry https://zns01.zynd.ai
# new agent
zynd agent init --name stock-analyzer --framework langchain
cd stock-analyzer
# edit agent.py, add API keys to .env
zynd agent run --port 5000
# in another terminal
zynd search "stock"
zynd resolve zns01.zynd.ai/alice/stock-analyzerTroubleshooting
Registration rejected — signature invalid
- Usually means the keypair at
ZYND_AGENT_KEYPAIR_PATHdoesn't match a key derived from your registered developer. Re-derive withzynd keys derive --index Nand update.env.
Heartbeat never connects
- Install the heartbeat extra:
pip install "zyndai-agent[heartbeat]". - Confirm
ZYND_REGISTRY_URLpoints to a node with WebSocket support (every node does by default).
Port already in use
- Override with
--port, or kill the existing process.
Agent card 404
- SDK generates it on first run. If you're seeing 404 while the agent is starting, wait for
/healthto return 200.