Skip to content

NEAR AI CLI

The NEAR AI CLI allows you to interact with NEAR AI's services to create agents or train and test models. Let's quickly review how to install it and login with your NEAR account.

Tip

Do you want to build an agent? Install the CLI, login, and then check our Agent Quickstart Guide.

Info

Remember that you can use NEAR AI from the Web Hub, the NEAR AI CLI is targeted at developers who want to build their own agents or train models on NEAR AI.


Installing NEAR AI CLI

python3 -m pip install nearai
git clone git@github.com:nearai/nearai.git
cd nearai
pip install -e .
Python Version

If you do not have python, or your version is not compatible, we recommend that you use miniconda or pyenv to manage your installations, as they both allow you to easily switch between python versions.

pyenv install 3.11
pyenv local 3.11 # or use global
conda create -n myenv python=3.11
conda activate myenv

Login to NEAR AI

To create a new agent, first login with a NEAR Account:

nearai login
Don't have a NEAR Account?

If you do not have a NEAR account, you can create one for free using wallets listed at wallet.near.org.

If you are unsure of which one to choose, try out Bitte or Meteor Wallet.

You'll be provided with a URL to login with your NEAR account.

Example:

$> nearai login

Please visit the following URL to complete the login process: https://auth.near.ai?message=Welcome+to+NEAR+AI&nonce=<xyzxyzxyzxyzx>&recipient=ai.near&callbackUrl=http%3A%2F%2Flocalhost%3A63130%2Fcapture

After successfully logging in, you will see a confirmation screen. Close it and return to your terminal.

alt text


Next Steps

That's it! You're now ready to create your first agent. Head over to the Agents Guide to get started.