Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Suggest CLI install per project #3267

Merged
merged 3 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/docs/dev_docs/cli/cli-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,18 @@ Here you will find a reference to the commands available in the Aztec CLI.

### NPM

This command will install the Aztec CLI.
This command will install the Aztec CLI as a dev dependency in your npm project.

```bash
npm install -g @aztec/cli
npm install --save-dev @aztec/cli
```

:::info

You can install the CLI globally, but it is recommended that you install the CLI as a local dependency in your project. This will make it easier to keep the CLI version in sync with the sandbox version.

:::

### Docker

The CLI will be installed automatically via Docker if it is not already found locally, by running the command to install and start the sandbox, [instructions here](./sandbox-reference.md#with-docker).
Expand Down
10 changes: 2 additions & 8 deletions docs/docs/dev_docs/getting_started/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ To install the latest Sandbox version, run:

This will attempt to run the Sandbox on ` localhost:8080`, so you will have to make sure nothing else is running on that port or change the port defined in `./.aztec/docker-compose.yml`. Running the command again will overwrite any changes made to the `docker-compose.yml`.

Alternatively, you can [run the sandbox as an npm package](../cli/sandbox-reference.md#with-npm).

## Install the CLI

To interact with the Sandbox now that it's running locally, install the [Aztec CLI](https://www.npmjs.com/package/@aztec/cli):
This command will also install the CLI if a node package version of the CLI isn't found locally.

```bash
npm install -g @aztec/cli
```
Alternatively, you can [run the sandbox as an npm package](../cli/sandbox-reference.md#with-npm).

## Deploy a contract using the CLI

Expand Down
33 changes: 27 additions & 6 deletions docs/docs/dev_docs/updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,38 @@ title: Updating
---

## TL;DR
1. **Updating the sandbox:**

1. **Updating the sandbox:**

- If you installed sandbox via docker, run:

```shell
/bin/bash -c "$(curl -fsSL 'https://sandbox.aztec.network')"
```

- If you have installed via an npm package then step 3 handles the update.

2. **Updating Aztec-CLI:**

- The above command also downloads the aztec-cli if a node package version of the CLI isn't found locally.
- If you have globally installed the CLI previously, then run:

```shell
npm install -g @aztec/aztec-cli
npm install -g @aztec/cli
```

(replace with `yarn` or your node package version manager tool).

- If you have aztec-cli listed as a local dependency in your project's `package.json`, then step 3 handles the update.

3. **Updating aztec-nr and individual @aztec dependencies:**
:::info

You can install the CLI globally, but it is recommended that you install the CLI as a local dependency in your project. This will make it easier to keep the CLI version in sync with the sandbox version.

:::

1. **Updating aztec-nr and individual @aztec dependencies:**

Inside your project run:

```shell
Expand Down Expand Up @@ -53,22 +68,28 @@ This will also update the CLI if a node package version of the CLI isn't found l

### npm

:::info

You can install the CLI globally, but it is recommended that you install the CLI as a local dependency in your project. This will make it easier to keep the CLI version in sync with the sandbox version.

:::

If the latest version was used when updating the sandbox then we can simply run the following command to update the CLI:

```shell
npm install -g @aztec/cli
npm install --save-dev @aztec/cli
```

If a specific version was set for the sandbox then we need to install the CLI with the same version:

```shell
npm install -g @aztec/cli@$SANDBOX_VERSION
npm install --save-dev @aztec/cli@$SANDBOX_VERSION
```

E.g.:

```shell
npm install -g @aztec/cli@#include_aztec_short_version
npm install --save-dev @aztec/cli@#include_aztec_short_version
```

### Docker
Expand Down