> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tenderly.co/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI Cheatsheet

> Follow a step-by-step guide and a cheat sheet of CLI commands for initializing, building, and deploying Web3 Actions.

This guide shows the commands you need to initialize, build, and deploy a Web3 Action project using Tenderly CLI.

**Step 1: Install the Tenderly CLI**

Use the `curl` command to download and install the Tenderly CLI binary on your local machine.

Install on macOS:

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
curl https://raw.githubusercontent.com/Tenderly/tenderly-cli/master/scripts/install-macos.sh | sh
```

Install on Linux:

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
curl https://raw.githubusercontent.com/Tenderly/tenderly-cli/master/scripts/install-linux.sh | sh
```

**Step 2: Log in to Tenderly via the CLI**

Log into the Tenderly CLI with your credentials by running this command:

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
tenderly login
```

**Step 3: Initialize a Web3 Actions project**

To initialize a Web3 Action project, run this command:

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
tenderly actions init
```

You can change the default initialization settings with two flags: change the name of the root Web3 Actions folder (default: `actions`) and the language for writing Action functions (default: `typescript` or `javascript`).

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
tenderly actions init --sources=actions --language=typescript
```

You’ll be prompted to add your Web3 Actions to a Tenderly project. You can either create a new project or pick an existing one.

**Step 3**: **Install any NPM dependency you need**

After running `tenderly init`, you have an NPM project at your disposal, so you can install any NPM library you need in a familiar way.

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
cd actions
npm i --save-dev axios ethers
cd ..
```

**Step 4: Build and deploy Web3 Actions**

After you have written your function and trigger configuration in **tenderly.yaml**, you can run these commands to build and deploy the Web3 Action.

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
# run within the folder containing tenderly.yaml

# Build the project (optional)
tenderly actions build

# Publish the project to Tenderly without running it (start manually)
tenderly actions publish

# Deploy the project to Tenderly Runtime (or re-deploy any changes you make)
tenderly actions deploy
```

Shortly after running `publish`, your Web3 Action is available in the Dashboard and listening to events per your configuration.

<Note>
  You can upgrade your Web3 Actions with zero downtime, by running the `publish` command after
  you’ve edited the function and trigger configuration.
</Note>

**Optional: Validate your tenderly.yaml**

Before deploying, you can validate the structure and trigger configuration of your `tenderly.yaml` locally. No login is required.

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
# Validate all projects in tenderly.yaml
tenderly actions validate

# Validate a single project only
tenderly actions validate --project username/project-slug

# Machine-readable JSON output (useful in CI pipelines)
tenderly actions validate --json
```

The `--json` flag emits a structured result. When everything is valid:

```json theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{ "valid": true }
```

When validation fails, `schema_errors` and/or `trigger_errors` are included (omitted when empty):

```json theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{
  "valid": false,
  "schema_errors": ["..."],
  "trigger_errors": [
    { "project": "my-org/my-project", "action": "myAction", "errors": ["..."] }
  ]
}
```

**Optional: Explore supported features**

To see a machine-readable manifest of all supported trigger types, runtimes, execution types, and intervals:

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
# Print the capabilities manifest
tenderly actions capabilities

# Include the full embedded JSON Schema in the output
tenderly actions capabilities --include-schema
```

This is useful for editor integrations and tooling that need to discover what the CLI supports without parsing documentation.

**Optional: Using Tenderly Runtime locally**

Install the [**@tenderly/actions-test**](https://github.com/Tenderly/tenderly-actions/tree/main/packages/actions-test) package to test your Web3 Action Functions locally.

Assuming you're already in an npm project, run the following:

```bash title="example" showLineNumbers theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
npm install @tenderly/actions-test
```

<Note>
  It’s recommended to keep tests and run scripts for web3-actions outside of the actions directory,
  to avoid increasing the size of your Web3 Actions project.
</Note>

Check out a [guide on local development and testing of Web3 Actions](/monitoring/web3-actions/references/local-development) for more detail and examples.
