Installation
- npm
- Cargo
- Mac and Linux (binaries)
- Windows (binaries)
Configuration file
The directory with access keys and available connection networks are defined in the configuration file (near-cli/config.toml), which is located depending on the operating system in the following places:
- macOS:
$HOME/Library/Application Support(e.g./Users/Alice/Library/Application Support) - Linux:
$XDG_CONFIG_HOMEor$HOME/.config(e.g./home/alice/.config) - Windows:
{FOLDERID_RoamingAppData}(e.g.C:\Users\Alice\AppData\Roaming)
Localnet configuration values
When setting up a localnet connection withnear config add-connection, several optional fields can be configured. Most of them can be skipped or set to placeholder URLs — they are only used for specific commands and are not required for basic localnet usage.
A minimal localnet connection requires only
rpc_url. The other values are only needed when using the specific commands listed above.
Interactive mode
To use thenear-cli simply run the following in your terminal.
enter or simply type out one of the available options to select an option.

We provide examples only of the most used commands. Such commands may have two versions — a full one and a short one. If you want to explore all options provided by
near-cli, use the interactive mode described above.Account
This option will allow you to manage, control, and retrieve information on your accounts.Summary
view-account-summary - view properties for an account.
- Full
- Short
Import
import-account - import existing account (a.k.a. “sign in”).
- Full
- Short
Export
export-account - export existing account.
Create
create-account - create a new account.
- Full
- Short
Delete
delete-account - delete an account.
- Full
- Short
Keys
Generating, showing, adding and removing account keys. NEAR keys can use any of the supported signature schemes:ed25519 (default), secp256k1, or the post-quantum ml-dsa-65.
Generate a key pair
generate-keypair - create a fresh key pair offline, without touching an account or the network. Use --signature-scheme to choose the scheme (defaults to ed25519).
- Ed25519
- ML-DSA-65 (post-quantum)
Run in an interactive terminal without
--signature-scheme and the CLI prompts you to pick a scheme; otherwise it defaults to ed25519. Unlike ed25519, ml-dsa-65 key pairs are generated randomly and have no seed phrase or implicit-account address — be sure to back up the saved key file.List keys
list-keys - view a list of keys for an account.
- Full
- Short
Add key
add-key - add an access key to an account.
- Full
- Short
autogenerate-new-keypair --signature-scheme <scheme>:
- Ed25519
- ML-DSA-65 (post-quantum)
The same
--signature-scheme flag is available on the account create-account fund-myself and sponsor-by-faucet-service autogenerate flows. You can also add an externally generated ml-dsa-65:<base58> key through the use-manually-provided-public-key flow shown above. An ml-dsa-65 key has no implicit-account form — you can’t derive a new implicit account from one — but you can add it to any existing account, named or implicit, just like any other key.Delete key
delete-keys - delete an access key from an account.
- Full
- Short
The interactive key picker only lists
ed25519 and secp256k1 keys. A post-quantum ml-dsa-65 key is stored on-chain only as a hash, so its full public key can’t be read back from the network — to delete one, pass the full ml-dsa-65:<base58> key explicitly to the public-keys argument of near account delete-keys (the full command form shown above).Gas keys
Gas keys are access keys with their own prepaid gas balance and up to 1,024 parallel nonces. Theadd-key command can create them through the grant-gas-key-full-access and grant-gas-key-function-call modes, and dedicated commands manage their balance and nonces.
A gas key is always created empty — fund it with fund-gas-key before using it:
--nonce-index to the signing option to choose which nonce lane to use (defaults to lane 0):
meta_transaction_relayer_url, set on the connection with near config add-connection). Signing such a transaction with --nonce-index then produces a DelegateV2 delegate action bound to that nonce lane, which the relayer wraps and pays for.
Deleting a gas key burns any balance left on it, and fails if the balance exceeds 1 NEAR — withdraw first with
withdraw-from-gas-key, then delete with the regular delete-keys command. Gas-key meta transactions are supported for all software signers; Ledger is the exception, since the device firmware cannot yet produce a DelegateV2 signature.Tokens
This will allow you to manage your token assets such as NEAR, FTs and NFTs.Send NEAR
send-near - transfers NEAR to a specified recipient in units of NEAR or yoctoNEAR.
- Full
- Short
Send FT
send-ft - transfer Fungible Tokens to a specified user.
Send NFT
send-nft - transfers NFTs between accounts.
View NEAR balance
view-near-balance - view the balance of NEAR tokens.
View FT balance
view-ft-balance - view the balance of Fungible Tokens.
View NFT balance
view-nft-assets - view the balance of NFT tokens.
Contract
This option allows you to manage and interact with your smart contracts.Call
call-function - execute function (contract method).
- Full
- Short
Deploy
deploy - add a new contract code.
- Full
- Short
Inspect
inspect - get a list of available function names.
- Full
- Short
Transaction
Operate transactions.View status
view-status - view a transaction status.
- Full
- Short
Config
Manage the connection parameters inside theconfig.toml file for near-cli.
This will allow you to change or modify the network connections for your CLI.
Show connections
show-connections - show a list of network connections.
Edit connection
edit-connection - edit a network connection.
We provide examples only of the most used commands. If you want to explore all options provided by
near-cli, use the interactive mode.Validators
You can use the following commands to interact with the blockchain and view validator stats. There are three reports used to monitor validator status:Validator extension
If you want to interact with NEAR Validators from command line, you can install the NEAR Validator CLI Extension:- npm
- Cargo
- Mac and Linux (binaries)
- Windows (binaries)