> For the complete documentation index, see [llms.txt](https://docs.autonomi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autonomi.com/node/guides/how-to-guides/use-the-node-cli.md). Agents can also search and read this documentation through its [MCP server](https://docs.autonomi.com/~gitbook/mcp).

# Use the Node CLI

Here's how to use the ant CLI to run one or more Autonomi nodes from your terminal and contribute storage space to the Network

The `ant` CLI lets you run one or more Autonomi nodes from your terminal and contribute your spare storage space to the Network.

{% hint style="info" %}
If this is your first time, we'd recommend you start with just a single node, so you can get a feel for how your machine and connection handle it. Then add more as your resources allow.
{% endhint %}

{% hint style="info" %}
You only need your public wallet address for this. Do not paste your private key or secret recovery phrase into any of these commands.
{% endhint %}

{% stepper %}
{% step %}

#### Install the `ant` CLI

{% tabs %}
{% tab title="npm" %}

```bash
npm install -g @withautonomi/ant
```

*Requires Node.js 18 or later.*
{% endtab %}

{% tab title="Mac and Linux" %}

```bash
curl -fsSL https://downloads.autonomi.com/install.sh | bash
```

{% endtab %}

{% tab title="Windows" %}
In PowerShell:

```powershell
irm https://downloads.autonomi.com/install.ps1 | iex
```

{% endtab %}
{% endtabs %}

When the install finishes, you can check it worked with:

```bash
ant --help
```

If your terminal says `ant` cannot be found, close it and open a new one, then try again.
{% endstep %}

{% step %}

#### Start the background daemon

Run:

```bash
ant node daemon start
```

This starts a small background process that manages your nodes for you.

You can check it is running with:

```bash
ant node daemon status
```

{% endstep %}

{% step %}

#### Add a node with your wallet address

Now register a node with your wallet address. The command downloads the node program from `downloads.autonomi.com`, so you need to give it the address for your computer with `--url`. Choose yours:

{% tabs %}
{% tab title="Mac (Apple silicon)" %}
For Macs with an M1 chip or later:

```bash
ant node add --url https://downloads.autonomi.com/ant-node/macos-arm64 --rewards-address 0xYourWalletAddress
```

{% endtab %}

{% tab title="Mac (Intel)" %}

```bash
ant node add --url https://downloads.autonomi.com/ant-node/macos-x64 --rewards-address 0xYourWalletAddress
```

{% endtab %}

{% tab title="Linux (Intel/AMD)" %}

```bash
ant node add --url https://downloads.autonomi.com/ant-node/linux-x64 --rewards-address 0xYourWalletAddress
```

{% endtab %}

{% tab title="Linux (ARM)" %}

```bash
ant node add --url https://downloads.autonomi.com/ant-node/linux-arm64 --rewards-address 0xYourWalletAddress
```

{% endtab %}

{% tab title="Windows" %}
On Windows, the address has to end in `.zip`, so it includes the current version number. Run these two lines in PowerShell:

```powershell
$V = (irm https://downloads.autonomi.com/ant-node/latest.json).version
ant node add --url "https://downloads.autonomi.com/ant-node/$V/ant-node-cli-windows-x64.zip" --rewards-address 0xYourWalletAddress
```

{% endtab %}
{% endtabs %}

Not sure which Mac or Linux machine you have? Run `uname -m` in your terminal: `x86_64` means Intel/AMD, and `arm64` or `aarch64` means ARM or Apple silicon.

Any Ethereum address can be used here, but you'll need a compatible wallet if you want to see and use anything your nodes earn.

{% hint style="warning" %}
Always include `--url`. Without it, `ant node add` can't download the node program at the moment, and the command fails.
{% endhint %}
{% endstep %}

{% step %}

#### Start your node

Run:

```bash
ant node start
```

If you only want to start one specific node later on, use its service name instead:

```bash
ant node start --service-name node1
```

{% endstep %}

{% step %}

#### Check that your node is running

To see all of your registered nodes and their status, run:

```bash
ant node status
```

To see a summary of the background daemon, run:

```bash
ant node daemon status
```

The daemon status command will also show you a local console URL you can open in your browser.

Once your node is running, it will begin gathering data and serving it to the Network.

{% hint style="info" %}
Automatic node upgrades are temporarily not working. Your nodes will keep running on their current version in the meantime. We'll be issuing an update to fix this soon, so please stay tuned.
{% endhint %}
{% endstep %}

{% step %}

#### Add more nodes later if you want to

When you're ready to contribute more storage space, add more nodes with the same command as before plus `--count`, then start them. For example, on Linux (Intel/AMD):

```bash
ant node add --url https://downloads.autonomi.com/ant-node/linux-x64 --rewards-address 0xYourWalletAddress --count 2
ant node start
```

Use the `--url` for your own computer from the step above. The node program is downloaded once, however many nodes you add.

If you'd prefer to choose the ports yourself, you can do that too:

```bash
ant node add --url https://downloads.autonomi.com/ant-node/linux-x64 --rewards-address 0xYourWalletAddress --count 2 --node-port 12000-12001
```

{% endstep %}

{% step %}

#### Stop your nodes

To stop all of your running nodes, run:

```bash
ant node stop
```

Or stop just one of them:

```bash
ant node stop --service-name node1
```

{% endstep %}

{% step %}

#### Reset everything if you need a clean start

First stop your nodes:

```bash
ant node stop
```

Then reset everything:

```bash
ant node reset --force
```

The reset command will not run while nodes are still running.

This removes your node data, logs, and local node registry, so only use it if you really want to start over.

To add nodes again afterwards, use the same `ant node add` command with `--url` as in the steps above.
{% endstep %}

{% step %}

#### Congratulations

You are up and running, and contributing to the Autonomi Network from the Command Line.
{% endstep %}
{% endstepper %}

## Notes

* If you install `ant` using the commands above, you should not need to enter bootstrap peers manually for normal live-network use.
* When you add nodes, the CLI will show you where each node's data and logs are being stored.

## Other useful commands

If you want to stop the background daemon itself, first stop your nodes:

```bash
ant node stop
ant node daemon stop
```

If you want to check the daemon again later:

```bash
ant node daemon status
```

{% hint style="info" %}
Updating is temporarily not working, both automatic node upgrades and the `ant update` command. We'll be issuing an update to fix this soon, so please stay tuned. In the meantime, you can get the latest `ant` CLI by running the install command from the first step again.
{% endhint %}

## Advanced options

When adding nodes, there are a few extra options you may find useful:

* `--metrics-port` to set metrics ports
* `--network-id` to target a specific network
* `--bootstrap` to provide bootstrap peers manually
* `--env` to pass environment variables to the node

For a fuller list of commands and options, run:

```bash
ant node --help
ant node add --help
ant node daemon --help
```

Or see every `ant node` command and option in the [CLI Command Reference](https://docs.autonomi.com/developers/cli/command-reference) in the developer docs.
