Nodit CLI

Key Features

One Command for Nodit APIs

Call RPC API (JSON-RPC, REST), Data API, Webhook, and Stream with a single nodit command. The CLI builds the endpoint for each chain and network and attaches the API Key header.

Output Built for Scripts and AI Agents

Success goes to data on stdout and failure to error on stderr in a consistent structure, in YAML, JSON, JSONL, or TOON. A non-interactive mode runs commands without prompts.

Secure Credential Handling

Log in through the browser and link an API Key of your project. API Keys and tokens are kept in the OS credential store and never appear in output or the config file.


Nodit CLI

Nodit CLI is a command-line tool for calling Nodit APIs from the terminal. It covers RPC API (JSON-RPC, REST), Data API, Webhook, and Stream through a single nodit command, and also provides account management for projects, API Keys, allowlists, and Compute Unit usage.

Calling an API directly with curl means looking up the endpoint for each chain and network, then building the X-API-KEY header and JSON body for every request. With Nodit CLI, the same request needs only a network ID and a method. The CLI selects the endpoint, attaches the API Key, and formats the response.

Nodit CLI suits scripts and AI agents for the following reasons.

  • Consistent output structure: A successful response is written to data on standard output (stdout), and a failure is written to error on standard error (stderr) with a code and a message. The same parsing logic works for every command.
  • Machine-readable formats: Output is available in YAML (default), JSON, JSONL, and TOON. TOON represents the same data more compactly than JSON.
  • Non-interactive execution: With --no-interactive, the CLI returns an error instead of opening a browser login or a prompt, so CI pipelines and agents can run commands without human input.
  • Built-in network catalog: The CLI includes the list of supported networks and the products each one carries (Node, Data API, Webhook, Stream), so availability can be checked before a call.

Installation

Nodit CLI supports macOS (Apple Silicon, Intel), Linux (amd64), and Windows (amd64). Run the command for your operating system in a terminal.

macOS and Linux

curl -fsSL https://raw.githubusercontent.com/noditlabs/nodit-cli/main/scripts/install.sh | sh

wget can be used instead of curl.

wget -qO- https://raw.githubusercontent.com/noditlabs/nodit-cli/main/scripts/install.sh | sh

The install script downloads the binary for your platform, verifies it against the release checksums, installs it in $HOME/.local/bin, and adds that directory to PATH in your shell startup file. When the installation completes, the installed version and path are printed.

Windows

Run the following command in PowerShell. The binary is installed in %LOCALAPPDATA%\Nodit\bin and added to the user PATH.

irm https://raw.githubusercontent.com/noditlabs/nodit-cli/main/scripts/install.ps1 | iex

Go

With a Go toolchain, the CLI can be built from source and installed. The binary is placed in $(go env GOBIN), or in $(go env GOPATH)/bin when that value is empty.

go install github.com/noditlabs/nodit-cli/cmd/nodit@latest

Verify the Installation

Open a new terminal so the updated PATH applies, then run the following command.

nodit version

The installation is complete when the installed version is printed without an error.

If a command not found error appears, check that a new terminal was opened and that the install directory ($HOME/.local/bin) is in PATH. Running the same install command again updates the CLI to the latest version.


Authentication

Nodit CLI uses two authentication methods depending on the API being called: logging in and linking a project, or specifying an API Key.

auth login opens a browser to log in with your Nodit account. After logging in, project select stores an active API Key of the selected project in the OS credential store, and Product API commands use it automatically. No environment variable is needed.

nodit auth login
nodit project list
nodit project select <PROJECT_ID>

If the project has more than one active API Key, project select lists them and stops, so that you decide which key the usage is billed against. Specify the key with --key-id.

nodit project select <PROJECT_ID> --key-id <KEY_ID>

auth status shows where each credential in use comes from. The API Key and token values themselves are never printed.

nodit auth status

Login tokens and API Keys are never stored in plain text in the config file. The CLI uses the OS credential store (Keychain, libsecret, Credential Manager), and falls back to an AES-256-GCM encrypted file when the store is not available.

Set the API Key with an Environment Variable

To use only the Product APIs without logging in, or in CI and script environments that cannot open a browser, set the API Key in an environment variable. The API Key is available in your project in the Nodit Console.

export NODIT_API_KEY=<YOUR_API_KEY>

In PowerShell, set it as follows.

$env:NODIT_API_KEY = '<YOUR_API_KEY>'

The API Key is resolved in this order: the --api-key option, the NODIT_API_KEY environment variable, then the API Key linked by project select. An environment variable therefore takes precedence over the key linked by project select. The --api-key option leaves the key in the shell history, so the environment variable is recommended.


Basic Settings

Check Networks

Nodit CLI identifies a network with an ID in the {chain}-{network} format, such as ethereum-mainnet or base-sepolia. network list shows the supported networks and the products each one carries. The --product option filters the list to networks that support node, data, webhook, or stream.

nodit network list
nodit network list --product stream
nodit network get ethereum-mainnet
data:
  chain: "ethereum"
  id: "ethereum-mainnet"
  network: "mainnet"
  products:
    - "node"
    - "data"
    - "webhook"
    - "stream"

Set the Default Network and Output Format

Instead of passing --network (or -n) to every command, a default can be saved. The network is resolved in this order: the --network option, the NODIT_NETWORK environment variable, then the saved default.

nodit config set network ethereum-mainnet
nodit config set output json
nodit config list

The output format is resolved in this order: the --output (or -o) option, the saved default, then YAML. Available formats are yaml, json, jsonl, and toon.


Commands

Nodit CLI provides the following commands. Run nodit <command> --help for the full list of options.

CommandDescriptionCredential
networkList supported networks and the products each one carriesNot required
configSet the default network and output formatNot required
dataQuery Data API (blocks, transactions, native tokens, tokens, NFTs, events, multichain entities)API Key
rpcCall RPC API (JSON-RPC) methodsAPI Key
restCall Node REST APIs for Aptos, Cosmos SDK, CometBFT, and TronAPI Key
webhookCreate, read, update, and delete Webhooks and Flexible WebhooksAPI Key
streamReceive Stream subscription events in real timeAPI Key
authLog in, log out, and check credential status-
project, apikey, allowlist, usageManage projects, API Keys, allowlists, and CU usageLogin

The examples below assume that authentication is set up.

data: Data API

The data command queries on-chain data indexed by Data API. Its subcommands are block, transaction, native, token, nft, event, and entity.

# Get the native token balance of an account
nodit data native balance \
  --address 0x000000000000000000000000000000000000dEaD \
  -n ethereum-mainnet

# List the tokens held by an account (10 per page)
nodit data token balances \
  --address 0x000000000000000000000000000000000000dEaD \
  --rpp 10 -n ethereum-mainnet

# Get a transaction by its hash
nodit data transaction get \
  --id 0x2f1c5c2b44f771e942a8506148e256f94f1a464babc938ae0690c6e34cd79190 \
  -n ethereum-mainnet

List commands return one page per call. To get the next page, pass --page, or pass the cursor value from the previous response with --cursor. The two options cannot be used together.

data entity lookup checks on which of several networks an address or a transaction hash exists. This command does not use the default network, so specify the target networks with --networks.

nodit data entity lookup 0x000000000000000000000000000000000000dEaD \
  --networks ethereum-mainnet,base-mainnet

rpc: RPC API (JSON-RPC)

The rpc command calls JSON-RPC methods on EVM, Solana, Sui, Cosmos, Bitcoin, Tron, and XRPL networks. Enter the parameters in order after the method name. Valid JSON values keep their types, and other values are sent as strings.

# Get the latest block number
nodit rpc eth_blockNumber -n ethereum-mainnet

# Get the balance of an account
nodit rpc eth_getBalance 0x000000000000000000000000000000000000dEaD latest -n ethereum-mainnet

For complex parameters, such as those that include objects, pass the complete JSON array with --params, or point to a JSON file with --params-file.

nodit rpc eth_call \
  --params '[{"to":"0xdAC17F958D2ee523a2206206994597C13D831ec7","data":"0x18160ddd"},"latest"]' \
  -n ethereum-mainnet

The JSON-RPC response is printed unchanged, with no unit conversion or automatic retry. Methods that change blockchain state, such as eth_sendRawTransaction, are also executed as given, so use them with care. For Aptos, use the rest command instead of rpc.

rest: Node REST API

The rest command calls REST endpoints for Aptos, Cosmos SDK, CometBFT, and Tron. Specify the HTTP method and path, pass query parameters with --query, and pass the request body with --body or --body-file.

# Get Aptos account resources (paths are relative to /v1)
nodit rest GET /accounts/0x1/resources -n aptos-mainnet --query limit=1

# Get the latest Cosmos block (CometBFT)
nodit rest GET /block -n cosmos-mainnet

# Get the latest Tron block
nodit rest POST /wallet/getnowblock -n tron-mainnet --body '{}'
ChainPath format
AptosPath after /v1 (e.g., /accounts/0x1)
Cosmos SDKStarts with /cosmos/ (Initia also uses /initia/)
CometBFT/status, /block, /tx, and others
TronStarts with /wallet/ or /walletsolidity/

webhook: Webhook and Flexible Webhook

The webhook command manages Webhooks (classic) and Flexible Webhooks (flexible). Both take the request body as JSON in --body when creating or updating, and accept a JSON file in the @path form.

For a Webhook, check the condition fields of the event type before creating it. The schema command prints the condition fields and supported networks, along with an example request body (exampleBody).

# List event types and check the condition fields of ADDRESS_ACTIVITY
nodit webhook classic event-types
nodit webhook classic schema ADDRESS_ACTIVITY

# Create an ADDRESS_ACTIVITY Webhook
nodit webhook classic create -n ethereum-mainnet --body '{
  "eventType": "ADDRESS_ACTIVITY",
  "description": "my hook",
  "notification": {"webhookUrl": "https://example.com/hook"},
  "condition": {"addresses": ["0x000000000000000000000000000000000000dEaD"]}
}'

# List the Webhooks on a network
nodit webhook classic list -n ethereum-mainnet

Manage the watched addresses of an ADDRESS_ACTIVITY Webhook with webhook classic addresses, and query the delivery history with webhook classic history.

A Flexible Webhook selects a stream and sets its condition with a CEL (Common Expression Language) filter expression. Use streams to find the stream ID and schema to see the fields available for the filter.

nodit webhook flexible streams -n ethereum-mainnet
nodit webhook flexible schema <STREAM_ID> -n ethereum-mainnet

# Create a Flexible Webhook that receives blocks with more than 300 transactions
nodit webhook flexible create -n ethereum-mainnet --body '{
  "name": "busy blocks",
  "streamId": "75",
  "filterExpression": "transaction_count > 300",
  "destination": "https://example.com/hook"
}'

stream: Stream

stream watch connects to Stream, subscribes to one event type, and prints the received events in the terminal. Use -o jsonl or YAML, which can represent continuous output. Without --messages to limit the number of events, the command keeps receiving until it is interrupted (Ctrl+C).

nodit stream watch -n ethereum-mainnet \
  --event-type ADDRESS_ACTIVITY \
  --condition '{"addresses":["0x000000000000000000000000000000000000dEaD"]}' \
  --messages 5 -o jsonl

The CLI does not reconnect automatically when the connection drops, and events from the disconnected period are not redelivered.

Account Management Commands

After logging in, you can view or change the projects, API Keys, allowlists, and Compute Unit usage of your account.

nodit project list                     # List projects
nodit apikey list                      # List API Keys (values are masked)
nodit allowlist list -p <PROJECT_ID>   # Get the IP and domain restrictions of a project
nodit usage summary --period 7d        # Summarize Compute Unit usage for the last 7 days

Usage figures from the usage command are for reference and can differ from the billing statement because aggregation is not immediate. Dedicated Cluster traffic is not included.


Responses and Errors

A successful response is printed to standard output under the data key, and a failure is printed to standard error under the error key. The output format is the same whether the output goes to a terminal, a pipe, or a redirect.

error:
  code: "INVALID_ARGUMENT"
  message: "Unknown command entity. Run nodit --help."

The following settings are recommended when running the CLI from scripts or AI agents.

  • Pass the API Key through the NODIT_API_KEY environment variable.
  • Add --no-interactive so the CLI returns an error instead of opening a browser login or a prompt.
  • Use -o json (or -o jsonl) for output that is easy to parse.
nodit rpc eth_blockNumber -n ethereum-mainnet --no-interactive -o json

Management API commands require a browser login, so only Product API commands can run in unattended environments.