enscli (CLI)
enscli is the CLI entry point to ENS. It wraps enssdk and the Omnigraph so you can resolve names, look up records, search domains, and run ad-hoc GraphQL queries against any ENSNode instance — without writing a script first.
It is designed to feel natural whether you drive it yourself or let an AI agent drive it: predictable arguments, machine-readable output, runtime schema introspection, and loud, structured errors.
Quick start
Section titled “Quick start”No install step beyond npx:
# Namehash a Namenpx enscli namehash vitalik.eth
# Run a GraphQL query against the Omnigraph (default: mainnet)npx enscli ensnode omnigraph '{ domain(by: { name: "vitalik.eth" }) { owner { address } } }'Output contract
Section titled “Output contract”enscli is read-only and built for predictable parsing:
- JSON when piped, pretty in a TTY. When stdout is not a terminal (i.e. for agents), every command prints JSON; interactively you get a friendlier rendering. Force either with
--output jsonor--output pretty. - Structured errors. Failures print
{ "error": { "message": "…" } }to stderr and exit non-zero. - Input hardening. Names, labels, and hashes containing control characters or
?/#/%are rejected before any network call.
Selecting an ENSNode instance
Section titled “Selecting an ENSNode instance”Most ensnode commands talk to an ENSNode instance. The target URL is resolved with this precedence:
--ensnode-url flag → ENSNODE_URL env → .env → namespace default.
--namespace (alias -n, or the NAMESPACE env var) selects a NameHash-hosted instance:
| Namespace | Hosted default |
|---|---|
mainnet | https://api.alpha.ensnode.io |
sepolia | https://api.alpha-sepolia.ensnode.io |
sepolia-v2 | https://api.v2-sepolia.ensnode.io |
npx enscli ensnode indexing-status --namespace sepolianpx enscli ensnode indexing-status --ensnode-url http://localhost:4334ENSRainbow commands resolve their URL similarly via --ensrainbow-url / ENSRAINBOW_URL.
Commands
Section titled “Commands”ensnode omnigraph <query>
Section titled “ensnode omnigraph <query>”Send a raw GraphQL query — the string is the exact payload, so the schema doubles as your documentation.
npx enscli ensnode omnigraph 'query D($name: InterpretedName!) { domain(by: { name: $name }) { canonical { name { interpreted } } resolve { records { addresses(coinTypes: [60]) { address } } } }}' --variables '{"name":"vitalik.eth"}'GraphQL is naturally field-masked — select only the fields you need to keep responses small. Resolution lives in the graph: select Domain.resolve (records) and Account.resolve (primary names) inline rather than as separate calls.
ensnode omnigraph schema [Type[.field]]
Section titled “ensnode omnigraph schema [Type[.field]]”Explore the Omnigraph schema offline (it ships with the CLI — no network):
npx enscli ensnode omnigraph schema # root query fields + major typesnpx enscli ensnode omnigraph schema Domain # a type's fields, with descriptionsnpx enscli ensnode omnigraph schema Domain.canonical # a single fieldnpx enscli ensnode omnigraph schema --search primary # find types/fields by keywordensnode indexing-status
Section titled “ensnode indexing-status”npx enscli ensnode indexing-statusensrainbow heal <labelhash> / ensrainbow count
Section titled “ensrainbow heal <labelhash> / ensrainbow count”npx enscli ensrainbow heal 0xaf2caa1c2ca1d027f1ac823b529d0a67cd144264b2789fa2ea4d63a67c7103ccnpx enscli ensrainbow countnamehash <name> / labelhash <label>
Section titled “namehash <name> / labelhash <label>”npx enscli namehash vitalik.ethnpx enscli labelhash vitalikFor AI agents
Section titled “For AI agents”enscli is the runtime that ensskills drive on your agent’s behalf. The omnigraph skill teaches an agent to author queries and run them through enscli, with the schema available via omnigraph schema. See the ensskills docs to install them.