Understanding the OpenClaw Near CLI Tools Skill
The OpenClaw Near CLI Tools skill is a ready‑to‑use knowledge module that
explains how to install, configure, and work with the NEAR Protocol
command‑line interface, specifically the near-cli-rs binary. When a user
asks about setting up NEAR CLI, importing accounts, deploying contracts, or
checking balances, the skill provides step‑by‑step instructions,
troubleshooting tips, and best‑practice recommendations. By following the
guidance in this skill, developers and blockchain enthusiasts can get a
functional NEAR CLI environment on Linux, macOS, Windows, or any system that
supports Node.js, Rust, or a simple shell script.
What the Skill Covers
The skill is organized into clear sections that mirror the typical workflow of
a NEAR developer. It begins with an overview of why the NEAR CLI is essential,
then presents four distinct installation methods: a portable shell script,
npm/npx for JavaScript developers, a Windows MSI installer, and a Cargo‑based
Rust installation. Each method includes prerequisites, exact commands, and
notes on adding the binary to the system PATH. After installation, the skill
shows how to verify the binary, view configuration locations, explore
available command groups, and perform first‑time actions such as viewing an
account summary, importing an existing account, or creating a new one.
Beyond the basics, the skill contains a troubleshooting table that addresses
common errors like "command not found," permission problems, missing installer
files, and slow downloads. It also points to additional resources such as the
official GitHub repository, NEAR documentation, Stack Overflow tags, and the
NEAR Discord community. Finally, a quick‑reference cheat sheet condenses the
most useful commands into a compact format for rapid recall.
Installation Method 1: Portable Shell Script
The shell script method is recommended for most Linux and macOS users, as well
as those working inside Windows Subsystem for Linux (WSL). The script
downloads the latest release of near-cli-rs from GitHub and executes it in
one line. Because the script installs the binary into $HOME/.cargo/bin,
users must ensure that this directory is part of their PATH. The skill
explains how to temporarily add the path for the current session with export and how to make the change permanent by
PATH="$HOME/.cargo/bin:$PATH"
appending the same line to ~/.bashrc or ~/.zshrc. If the binary is not
found after installation, the skill advises using which near or whereis to locate the absolute path before running any NEAR command.
near
Installation Method 2: npm/npx
For developers who already work with Node.js, the skill shows how to use npx
to run near-cli-rs without a global install, or how to install it globally
with npm install -g near-cli-rs. The npm approach works on any platform that
supports Node.js, making it a convenient option for Windows users who prefer
not to deal with Rust or shell scripts. After a global npm install, the skill
reminds users to verify that the npm bin directory (typically $(npm config) is in the PATH, and provides the appropriate export command
get prefix)/bin
to add it if necessary.
Installation Method 3: Windows MSI Installer
Windows users who do not have Node.js or Rust installed can take advantage of
the pre‑built MSI installer available on the NEAR CLI‑RS releases page. The
skill walks through downloading the latest near-cli-rs-installer-x64.msi,
double‑clicking the file, and following the wizard. The installer
automatically adds the NEAR CLI binary to the system PATH, so no manual
configuration is required. After installation, users can open a new Command
Prompt or PowerShell window and run near --version to confirm success.
Installation Method 4: Cargo (Rust)
Rust enthusiasts can install near-cli-rs directly with Cargo, either from
crates.io or from the Git repository. The skill lists the prerequisite of
having Rust installed via rustup.rs and notes that
certain Linux distributions may need the libudev-dev or libudev-devel
package for USB device support. The installation command is cargo install or, to track the latest master branch,
near-cli-rscargo install --git. As with the other methods, the skill
https://github.com/near/near-cli-rs
emphasizes checking that $HOME/.cargo/bin is in the PATH and reloading the
shell configuration if needed.
Verification
Once the installation method of choice has been completed, the skill instructs
users to run near --version. The expected output shows something like near- (or a newer version). If the command is not found, the skill
cli-rs 0.23.6
provides a checklist: confirm the installation directory, verify that the
directory is in PATH, and, if necessary, export the path manually. The skill
also shows how to inspect the PATH variable with echo $PATH and grep for
cargo or the npm prefix to ensure the binary location is present.
Configuration and Help
The NEAR CLI stores its configuration in a TOML file located by default at
~/.config/near-cli/config.toml. Users can view this path by running near, which also prints a summary of all available command groups. The
--help
skill breaks down each group: account for account management, tokens for
fungible and non‑fungible tokens, staking for validator operations,
contract for deploying and calling smart contracts, transaction for raw
transaction handling, and config for managing network endpoints. By invoking
near --help (e.g., near account --help), users can see the specific
subcommands and options available for each area.
First Steps with the CLI
After verification, the skill guides users through common introductory tasks.
To view an existing account’s summary, the command is near account view-. The skill explains that the
account-summary network-config mainnet now
network-config flag selects the target network (mainnet, testnet, or a
custom RPC) and that now requests the latest block data. Importing an
account from a seed phrase or key pair is done with near account import-, which launches an interactive prompts flow. Creating a brand‑new
account
account requires an existing funded account to pay for the new account’s
creation; the skill walks through the near account create-account command
and notes the need to provide a creator account ID and optionally a reference
to a faucet or funder.
Troubleshooting Common Issues
The skill includes a dedicated troubleshooting section that maps symptoms to
causes and solutions. For the classic "near: command not found" error, the
remedy is to locate the binary with which near or whereis near and then
add its directory to PATH, either temporarily or permanently. If a "Permission
denied" message appears when running the shell script installer, the skill
advises making the script executable with chmod +x near-cli-rs-installer.sh
before executing it. When the installer file seems missing, the skill suggests
checking the GitHub releases page manually and using the API to fetch the
exact download URL for the installer script. For slow or hanging downloads,
the recommendation is to add timeout flags to curl, such as --connect-timeout, to avoid indefinite waiting.
30 --max-time 300
Additional Resources
To deepen understanding, the skill points learners to the official NEAR CLI‑RS
GitHub repository (github.com/near/near-cli-rs) where they can read the source code, inspect release notes, and
contribute issues. The NEAR Protocol documentation
(docs.near.org) offers comprehensive guides on
accounts, smart contracts, and token standards. For community‑driven help, the
NEAR Stack Overflow tag
(stackoverflow.com/questions/tagged/nearprotocol)
and the NEAR Discord (discord.gg/near) are
highlighted as places to ask questions, share experiences, and stay up‑to‑date
with ecosystem news.
Quick Reference Cheat Sheet
- Install via shell script:
curl https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.sh | sh - Install via npm:
npm install -g near-cli-rs - Run without install:
npx near-cli-rs - Verify:
near --version - View account:
near account view-account-summary network-config mainnet now - Import account:
near account import-account - Create account:
near account create-account - Help:
near --helpandnear --help
Conclusion
The OpenClaw Near CLI Tools skill consolidates everything a developer needs to
get started with the NEAR Protocol command‑line interface. By presenting
multiple installation pathways, clear verification steps, detailed command
groups, and practical first‑time actions, the skill reduces the friction
associated with setting up a blockchain development environment. Whether you
prefer a simple shell script, the familiarity of npm, the convenience of a
Windows installer, or the control of Cargo, the skill provides the exact
commands and explanations required. With the troubleshooting tips and
quick‑reference cheat sheet, users can quickly resolve issues and continue
building on NEAR with confidence.
Skill can be found at:
tools/SKILL.md>
Top comments (0)