Local State
Run
stellar doctor to view resolved configuration and data paths for your OS (macOS, Linux, Windows). Override the default config directory using --config-dir or XDG_CONFIG_HOME.
Identity files are saved in unencrypted plaintext unless created with --secure-store. Treat ~/.config/stellar/ as sensitive storage.
stellar network use and stellar keys use update global defaults in config.toml. These modifications apply machine-wide rather than scoping to a shell session, project directory, or sub-process.
Configuration Precedence
Precedence order (highest to lowest):- Command-line flags
- Environment variables
- Saved configuration defaults (
config.toml) - Implicit fallbacks
STELLAR_* environment variable. Configuring an agent exclusively via environment variables isolates execution state to the active process without modifying global disk configuration.
STELLAR_NO_CACHE and --no-cache bypass simulation and transaction caches. Account balances are never cached; read operations always query live network state.
Run stellar env to view resolved configuration values (sensitive values are masked; pass --reveal to unmask).
Network Fallback Warning
On an unconfigured directory, commands silently fall back totestnet, even though stellar env reports ⚠️ No defaults or environment variables set. If a global default is subsequently set on the machine (stellar network use mainnet), unflagged executions immediately resolve to mainnet. Explicitly pass --network in scripts and agent invocations to guarantee deterministic targeting.
Invocation Model
Every command invocation parsesargv as a stateless, single-shot execution. The CLI maintains no REPL or background daemon.
To edit transaction envelopes interactively, run stellar tx edit to load the target payload into $EDITOR.
Because each command is self-contained, stateless, and carries complete context in its arguments, the CLI is naturally suited for agent orchestration.
Read Path
Reads execute as network simulations. The CLI sends the request to the RPC endpoint, where the network evaluates state without committing a transaction. Requirements: None (no keypair, funded account, signature, or fee required).Mainnet Read Configuration
The pre-installedmainnet entry is a placeholder URL. Configure a functional mainnet RPC endpoint before executing reads against mainnet:
https://mainnet.sorobanrpc.com requires no API key.
Write Path
State-modifying commands execute in five sequential stages:- Simulate: Send transaction payload to RPC to estimate footprint and fees.
- Authorize: Sign Soroban authorization entries (prompts for interactive approval unless
--auto-signis passed). - Sign: Sign the complete transaction envelope with secret key.
- Submit: Broadcast payload to RPC endpoint.
- Poll: Query network until transaction reaches finality.
"trustline entry is missing for account") alongside contract host error codes (e.g., Error(Contract, #13)).
Composition & Piping
Three architectural features enable unix-style transaction piping:--build-only: Available on everytx new <OPERATION>and on thecontractcommands that submit a transaction (deploy,upload,invoke,extend,restore,asset deploy). Read-only commands such ascontract id assetdo not take it. Generates unsigned, base64-encoded XDR tostdoutwithout signing or submitting. Requires RPC connectivity and a funded account to query the current sequence number. (Note:stellar token transferandstellar token approvelack--build-only; usestellar tx new payment --build-onlyinstead).stdinParsing:tx sign,tx send,tx hash,tx simulate,tx decode,tx encode,tx edit,tx op add, andtx updateread an envelope from standard input when positional arguments are omitted.tx newbuilds from flags andtx fetchtakes--hash; neither reads stdin.- Offline Signing:
stellar tx signandstellar tx hashoperate entirely offline without network or RPC access.
--network directly to stellar tx sign. Transaction signatures commit to the target network passphrase; omitting this parameter causes the sign command to fall back to global defaults, resulting in TxBadAuth errors at submission.
This composition allows execution across air-gapped environments (Build online → Sign offline → Submit online) or human review workflows.
Token Resolution
The--id flag across stellar token commands uses a single resolver that accepts four identifier formats:
native(Native XLM)CODE:ISSUER(Classic Stellar Asset)C...(Soroban Contract Address)- Saved contract alias
CODE:ISSUER) automatically resolve to their corresponding Stellar Asset Contract (SAC). If the SAC is not yet deployed onchain, the CLI returns sac_not_deployed and prompts deployment via stellar contract asset deploy.
Dynamic Contract Interface Generation
Passing-- --help to a contract invocation fetches the target contract’s onchain metadata schema and dynamically generates typed CLI documentation:
-- are validated by the generated interface, allowing agents to inspect and invoke arbitrary contract ABIs dynamically without local binding files.
Agent Integration Tools
- Raven MCP Server: Hosted Model Context Protocol endpoint (
[https://raven.stellar.buzz/mcp](https://raven.stellar.buzz/mcp)). Provides documentation search, network graph data, and ecosystem queries acrossstellarDocs,scout, andlumenloopnamespaces. Read-only research endpoint requiring OAuth browser authentication; cannot sign or submit transactions. stellar skill: Outputs built-in CLI usage documentation directly from the compiled binary. See Skills.AGENTS.md: Standard workspace template emitted bystellar contract init(v28.0.0+) providing build and test directives for contract development agents.