Near Learn

CLI & build tools

The NEAR command-line toolkit: near-cli-rs (the near command), cargo-near for building and reproducible deploys, and create-near-app for full-stack starters.

Beginner4 min read3-question check

Three command-line tools cover the whole loop. cargo-near scaffolds, builds and deploys Rust contracts. near-cli-rs (installed as near) manages accounts and keys and calls contracts. create-near-app scaffolds a full project with a contract and a Next.js front end.

ToolLanguageWhat it’s forLink
near-cli-rs (near)Rust binary (also via npm / Homebrew)Accounts (create via faucet, import, keys), tokens, contract calls and views, deploys, transactions, staking. Run near with no arguments for an interactive menu that prints the equivalent one-line command. Also accepts the legacy short forms (near view, near call, near deploy) on a best-effort basis.near/near-cli-rs · docs
cargo-nearCargo extensioncargo near new (template with tests and CI workflows), cargo near build (Wasm + embedded ABI), cargo near deploy, cargo near abi, cargo near check. The reproducible-wasm variant builds in a pinned Docker image so anyone can verify the deployed code hash, and records NEP-330 build metadata.near/cargo-near
create-near-appNode.js (npx)Interactive scaffolder: contract in Rust or JS, front end in Next.js (App or Pages router) or none, with sandbox tests. Non-interactive: --frontend / --contract / --install flags.near/create-near-app
Install, scaffold, build, deploy and call (testnet)
Shell
# install the two Rust tools (macOS / Linux)
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/latest/download/near-cli-rs-installer.sh | sh
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/latest/download/cargo-near-installer.sh | sh

# scaffold, test, build
cargo near new hello-near && cd hello-near
cargo test
cargo near build non-reproducible-wasm   # fast dev build -> target/near/hello_near.wasm

# account + deploy (legacy short form, translated by near-cli-rs)
near create-account my-hello.testnet --useFaucet
near deploy my-hello.testnet ./target/near/hello_near.wasm

# the same kind of view call in the full near-cli-rs syntax
near contract call-function as-read-only my-hello.testnet get_greeting \
  json-args '{}' network-config testnet now

# production: Docker-based reproducible build, then deploy (interactive)
cargo near deploy build-reproducible-wasm

Check yourself

3 questions · progress saved in this browser

  1. 1.You are about to deploy a contract to mainnet and want anyone to be able to verify the Wasm matches your source. Which command?
  2. 2.A tutorial says npm install -g near-cli. What should you install instead?
  3. 3.You want a new project with a Rust contract and a Next.js App Router front end, wired up in one step. Which tool?