stellar-cli 28.1.0.
Agent Ergonomics
Browser wallets are hard for agents. The CLI provides four key agent primitive enhancements:- Unified Asset Resolution: Interacts with native XLM, SAC (Stellar Asset Contracts), or SEP-41 tokens using consistent identifiers (
CODE:ISSUER, contract ID, or custom alias). - Self-Scaffolding Context: Running
stellar contract initautomatically generates anAGENTS.mdguide in local project directories, giving LLMs instant awareness of local commands and tool rules. Build and deploy a contract covers what it contains and how to customize it. - Structured JSON Outputs (
--output json): Thestellar tokencommands return typed JSON, including transaction hashes and a typed error envelope. Coverage elsewhere varies, andtx sendandtx newhave no--outputflag. Output and errors lists what each command supports. - Onchain Diagnostic Errors: When a transaction reverts, the CLI returns the contract’s diagnostic event trail inside the error envelope. Agents can read why a transaction failed.
Capability Surface
Beyond only using the Stellar CLI as a wallet, your agent can also use the full power of CLI to interact with, build, and deploy contracts. Humans can read the full Stellar CLI Manual.Safety Architecture
Giving an agent financial execution power requires hard guardrails. The first two below are enforced by the network or by a human signer, not by the agent following instructions. The third is a convention your agent has to follow:- Protocol Allowance Enforcement: Primary funds remain in your treasury account. Issue your agent a capped allowance using
stellar token approve. If the agent attempts to overspend, the Stellar ledger rejects the transaction. - Human Approval Workflows: Use
--build-onlyflags on sensitive transactions. Your agent formats the payload into a file, leaving final signing authority to a human or air-gapped machine. - Explicit Smallest-Unit Amounts:
token transferandtoken approvetake--amountin the token’s smallest unit and do no conversion. Readstellar token decimalsfirst and have the agent show its arithmetic before it sends.
Where to go next
- Skills covers
stellar skill, the built-in guide that teaches your agent the CLI’s conventions. - Delegate spending is the page to read before any real money is involved.
- Build and deploy a contract takes your agent from
stellar contract initto a deployed contract it can call. - Authority & Security Model is explicit about what the CLI does not protect you from.
- Architecture covers how the read and write paths differ, where state lives, and how to split building, signing, and submitting across machines.
- Output and errors covers which commands emit structured JSON your agent can branch on, because the coverage is not uniform.
- Troubleshooting for when something does not work.