---
title: "Vertesia CLI"
source: "https://docs.vertesiahq.com/cli"
markdown: "https://docs.vertesiahq.com/llms/cli.md"
---

# Vertesia CLI

The Vertesia CLI provides a set of commands to manage and interact with the Vertesia Platform. This documentation covers all available commands, grouped by their logical functionality, and provides examples on how to use each command.

## Installation

To install the CLI, follow these steps:

1. **Ensure Node.js is installed**: The Vertesia CLI requires Node.js. You can download and install it from [nodejs.org](https://nodejs.org/). You can verify Node.js is installed by running:

    ```bash
    node --version
    ```

2. **Install the Vertesia CLI globally**: Open your terminal and run the following command to install the Vertesia CLI globally using npm:

    ```bash
    npm install -g @vertesia/cli
    ```

3. **Verify the installation**: After installation, you can verify that the Vertesia CLI is installed correctly by running:

    ```bash
    vertesia --version
    ```

This command displays the version of the CLI installed on your system.

## Help

To get help with the CLI.

  ```bash
  vertesia --help
  ```

To get help with any CLI command.
   ```bash
  vertesia help [command]
  ```

Option to get help with any CLI command.
   ```bash
  vertesia <command> --help
  ```

## Authentication

Commands to manage authentication.

### Commands

- `auth token`: Get a JWT token for the API key used in the authentication.

  ```bash
  vertesia auth token
  ```

- `auth refresh`: Refresh the JWT token.

  ```bash
  vertesia auth pk <projectId> --name <keyName> --ttl <timeToLive>
  ```

## Profiles

Commands to manage configuration profiles which enable using the CLI with different Vertesia accounts, projects, and infrastructure.

### Commands

- `profiles show [name]`: Show the configured profiles or the profile with the given name.

  ```bash
  vertesia profiles show [name]
  ```

- `profiles use [name]`: Switch to another configuration profile.

  ```bash
  vertesia profiles use [name]
  ```

- `profiles add [name] [options]`: Create a new configuration profile.

  ```bash
  vertesia profiles add [name] --target <environment>
  ```

- `profiles edit [name]`: Edit an existing configuration profile.

  ```bash
  vertesia profiles edit [name]
  ```

- `profiles refresh`: Refresh token for the current configuration profile.

  ```bash
  vertesia profiles refresh
  ```

- `profiles delete `: Delete an existing configuration profile.

  ```bash
  vertesia profiles delete <name>
  ```

- `profiles file`: Print the configuration file path.

  ```bash
  vertesia profiles file
  ```

## Projects

Command to list projects.

### Command

- `projects`: List the projects you have access to.

  ```bash
  vertesia projects
  ```

## Environments

Command to list environments.

### Command

- `envs [envId]`: List the environments you have access to.

  ```bash
  vertesia envs [envId]
  ```

## Interactions

Commands to list interactions, generate test data, run, and search interactions.

### Commands

- `interactions`: List the interactions available in the current project.

  ```bash
  vertesia interactions
  ```

- `interactions `: List the details of an interaction given its ID.

  ```bash
  vertesia interactions <interactionId>
  ```

- `datagen  [options]`: Generate test  data for an interaction given its ID.

  ```bash
  vertesia datagen <interactionId> --env <envId> --model <model> --temperature <value> --output <file> --count <number>
  ```

- `run  [options]`: Run an interaction by ID.

  ```bash
  vertesia run <interactionId> --input <file> --output <file> --data <json> --tags <tags> --temperature <temperature> --model <model> --env <environmentId> --no-stream --count <count> --verbose --jsonl --data-only
  ```

- `runs  [options]`: Search the run history by interaction ID.

  ```bash
  vertesia runs <interactionId> --tags <tags> --status <status> --env <environmentId> --model <model> --query <query> --limit <limit> --page <page> --format <format> --output <file> --before <date> --after <date>
  ```

## Content Objects

Commands to manage content objects.

### Commands

- `content post <file...> [options]`: Post a new object to the store. The path to the file can include wildcards by using `*`.

  ```bash
  vertesia content post <file...> --name <name> --type <type> --mime <mime> --path <parentPath> --recursive
  ```

- `content delete `: Delete an existing object given its ID.

  ```bash
  vertesia content delete <objectId>
  ```

- `content get `: Get an existing object given its ID.

  ```bash
  vertesia content get <objectId>
  ```

- `content list  [options]`: List the objects inside a folder.

  ```bash
  vertesia content list <folderPath> --limit <limit> --skip <skip>
  ```

## Workflow

Commands to manage workflows and workflow rules.

### Commands

- `workflows rules create [options]`: Create a new workflow rule.

  ```bash
  vertesia workflows rules create --name <name> --on <event> --run <endpoint>
  ```

- `workflows rules get  [options]`: Get a workflow rule given its ID.

  ```bash
  vertesia workflows rules get <workflowId> --file <file>
  ```

- `workflows rules apply [options]`: Apply a workflow rule.

  ```bash
  vertesia workflows rules apply --file <file>
  ```

- `workflows rules list`: List all workflow rules.

  ```bash
  vertesia workflows rules list
  ```

- `workflows rules execute  [options]`: Execute a workflow rule given its ID.

  ```bash
  vertesia workflows rules execute <workflowId> --objectId <objectId>
  ```

- `workflows rules delete `: Delete a workflow rule given its ID.

  ```bash
  vertesia workflows rules delete <objectId>
  ```

- `workflows definitions transpile <files...> [options]`: Transpile a TypeScript workflow definition to JSON.

  ```bash
  vertesia workflows definitions transpile <files...> --out <file>
  ```

- `workflows definitions create [options]`: Create a new workflow definition.

  ```bash
  vertesia workflows definitions create --file <file>
  ```

- `workflows definitions apply [workflowId] [options]`: Apply a workflow definition.

  ```bash
  vertesia workflows definitions apply [workflowId] --file <file> --skip-validation
  ```

- `workflows definitions list`: List all workflow definitions.

  ```bash
  vertesia workflows definitions list
  ```

- `workflows definitions get  [options]`: Get a workflow definition given its ID.

  ```bash
  vertesia workflows definitions get <objectId> --file <file>
  ```

- `workflows definitions delete `: Delete a workflow definition given its ID.

  ```bash
  vertesia workflows definitions delete <objectId>
  ```

## Code Generation

Commands to generate code based on interactions.

### Commands

- `codegen [interactionName]`: Generate code given an interaction name or for all the interactions in the project.

  ```bash
  vertesia codegen [interactionName] --versions <versions> --all --dir <file> --export <version>
  ```

## Package Management

Commands to manage the Vertesia CLI package.

This command checks if there is a newer version of the CLI available. If a new version is found, it prompts the user to confirm the upgrade. If the user confirms, the Vertesia CLI will update itself to the latest version. If no updates are available, it will notify the user.

### Commands

- `upgrade`: Upgrade to the latest version of the CLI.

  ```bash
  vertesia upgrade
  ```