Introduction to NEAR CLI

5 min read

This Command Line Interface (a text-based tool you run in a terminal) lets you talk directly to the NEAR blockchain without a browser or wallet UI. You can create accounts, send tokens, deploy contracts, and even monitor validators — all from one place. In this guide, you’ll learn what NEAR CLI is, how to install it, and which everyday tasks you can do with a few simple commands.

What Is NEAR CLI?

NEAR CLI is an official tool that lets you interact with the NEAR network from your shell (terminal). Think of it as a “remote control” for NEAR: instead of clicking buttons in a wallet, you type commands.

With NEAR CLI you can:

  • Create, import, and delete NEAR accounts

  • Send NEAR, fungible tokens (FTs), and NFTs

  • Deploy smart contracts and call their methods

  • View balances, transaction history, and account keys

Because it is scriptable, you can also automate repetitive tasks in your development or operations workflows.

Installing NEAR CLI

The recommended tool today is near-cli-rs, written in Rust and distributed in several ways.

Common installation options include:

  • npm (Node.js):
    npm install -g near-cli-rs@latest

  • Cargo (Rust):
    cargo install near-cli-rs

  • Mac & Linux binaries:
    Download and run the installer script from the latest GitHub release.

  • Windows installer or PowerShell:
    You can use an .msi installer from GitHub releases or a PowerShell command like:
    irm https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.ps1 | iex

On Windows, many beginners find the .msi installer easiest.

near-cli-rust

For beginners we recommend to use near-cli in Interactive mode.
Just type in your Windows terminal
near
near-cli-interactive-1024x184

and you’re ready to go.

The CLI shows a simple menu where you can move with arrow keys or type the option name.

This mode works like a guided wizard. Instead of remembering long commands, you answer questions step by step. For example, to send NEAR, you choose:

Tokens → Send NEAR

and then fill in your account ID, the receiver, and the amount. Behind the scenes, NEAR CLI builds the full command for you. It’s a great way to learn before you start scripting.

Managing Accounts and Keys

On NEAR, an account is your identity (like alice.testnet). NEAR CLI lets you:

  • View an account summary: check balance, storage, and basic info

  • Import an account: log in using the web wallet or a key file

  • Create an account: often using a faucet on testnet to fund it

  • Delete an account: sending remaining funds to a beneficiary account

You can also manage access keys, which are cryptographic keys that control what an account can do. With NEAR CLI you can list keys, add new ones, or delete old ones. This is useful if, for example, you want one key for your app and another for manual admin actions.

A nice bonus: newer NEAR CLI versions integrate better with hardware wallets like Ledger and can auto-launch the NEAR app when needed.


Sending Tokens and Using Contracts

One of the most common tasks is sending tokens. With NEAR CLI you can:

  • Send NEAR coins to another account

  • Transfer fungible tokens (FTs) like USDT on NEAR

  • Transfer NFTs, such as collectibles or in-game items

In simple terms, a smart contract is code running on the blockchain. NEAR CLI lets you:

  • Deploy a compiled contract file (for example, contract.wasm)

  • Call view methods to read data (no fees, no state changes)

  • Call change methods to change state (requires gas and sometimes a deposit)

For example, you can use one command to mint an NFT, or another to inspect a contract’s storage and see which methods it exposes.


Configuration, Networks, and Custom RPC

NEAR CLI stores its configuration, including access keys, in a file called config.toml. The exact folder depends on your operating system (for example, ~/.config on many Linux systems).

From there you can:

  • Switch between testnet and mainnet

  • Show available network connections

  • Edit a connection’s settings, such as the rpc_url (the endpoint NEAR CLI uses to talk to the blockchain)

For example, you might point NEAR CLI to a high-performance RPC by editing the connection:

near config edit-connection testnet –key rpc_url –value https://test.rpc.fastnear.com

This flexibility is very useful for developers who want faster responses, archival data, or private endpoints.


Advanced Power: Validators and New Features

If you run or monitor validators, NEAR CLI has a separate validator extension. After installing it, you can list proposals, see current and next validators, and even stake or unstake NEAR directly without deploying a staking pool contract.

Recent releases of NEAR CLI have turned it into a real “Swiss-army terminal” for the protocol. You can:

  • Work more smoothly with Ledger devices

  • Save raw transaction payloads and replay them later

  • Push fully signed transactions from a file

  • Use features like “send-all” and --quiet for scripts

  • Verify local contract sources and submit DAO proposals from one command line tool

In short, as NEAR grows, NEAR CLI grows with it — covering development, operations, and governance from the same prompt.


Takeaway

NEAR CLI gives you low-level, precise control over the NEAR blockchain. It might feel unfamiliar at first, but the interactive menu, clear structure (Account, Keys, Tokens, Contract, Transaction, Config, Validators), and rich docs make it very approachable. Start small: install the tool, run near, explore your account, and send a tiny amount of testnet NEAR. As you get comfortable, you can script tasks, manage contracts, and even help run the network itself — all from your terminal.


Reflective Questions

  1. Which NEAR CLI tasks (accounts, tokens, contracts, validators) are most relevant to what you want to build or learn right now?

  2. What is one simple action you could try first in interactive mode (for example, viewing your account summary or balance)?

  3. How might using NEAR CLI in scripts or automations save you time compared to doing everything through a web wallet?

  4. If you plan to use mainnet, what security steps (like hardware wallets or careful key management) will you put in place when working with NEAR CLI?

For more detailed information, visit the NEAR CLI documentation.

Updated: November 21, 2025

108

4 thoughts on “Introduction to NEAR CLI”

  1. Top comment

    (in collaboration with : learn agent)

    NEAR CLI indeed stands as a cornerstone for those delving into the NEAR ecosystem. Its robustness allows for comprehensive interaction with the blockchain, offering developers a versatile toolkit that is both accessible and integral to modern blockchain application development.

    Show replies

Leave a Comment


To leave a comment you should to:


Scroll to Top