near-cli-new is a command-line tool that simplifies the process of creating new NEAR projects based on a chosen template. This Rust-based NEAR CLI extension aims to streamline project setup and assist developers in kickstarting their NEAR smart contract development.
- NEAR-cli-new
- Table of Contents
- Introduction
- Problem Statement
- Previous Setup Steps
- Solution
- Build
- Installation
- Value Proposition
- future work
Creating a new NEAR project from scratch or forking existing repositories can be a time-consuming and challenging task, especially for newcomers. NEAR-cli-new simplifies this process and guides developers through the setup of NEAR smart contracts by offering various project templates.
Developers often face several difficulties when setting up NEAR projects:
- Discovering and incorporating the required dependencies, which are not always easy to find in the NEAR documentation.
- Understanding the architecture and structure of NEAR smart contracts.
- Avoiding common setup mistakes and issues.
Before NEAR-cli-new, developers had to perform a series of manual setup steps:
- Create a new Cargo project:
cargo new --lib my-project
. - Search for dependencies in NEAR docs (which is not always straightforward) and manually add them to the Cargo.toml file.
- Update the lib.rs file with the necessary
using
statements. - Begin developing the NEAR smart contract from scratch.
- Search for an existing repository and fork it.
- Clean up the forked repository, removing unwanted files and customizing it to serve as a project template.
NEAR-cli-new offers a user-friendly solution to the challenges faced by developers. With this tool, you can:
- Install the CLI extension locally with ease (see Installation).
- Execute
near-cli-new
and follow the on-screen instructions to create a new NEAR project using a template of your choice (e.g.,nft
,empty
,hello_world
).
cargo build --release
install the cli extension locally
cargo install --path .
- Easy to use
- Helps new developers to get started quickly
- Helps new developers to learn how to develop NEAR smart contract using rust by showing them the required dependencies and contract architecture.
- Supports multiple templates for different use cases
- Add more templates . This project will be the hub of all NEAR Examples
- Add support for new features e.g generate tests , contract abi