text
stringlengths
0
59.1k
title: CLI Commands Reference
sidebar_position: 8
---
# CLI Commands Reference
The VoltAgent CLI provides commands for managing datasets and running experiments. All eval commands are available under `voltagent eval` or `npx @voltagent/cli eval`.
## Installation
### Quick Setup
Initialize VoltAgent in your project (automatically adds scripts to package.json):
```bash
npx @voltagent/cli init
```
This command will:
- Install `@voltagent/cli` as a dev dependency
- Add `"volt": "volt"` script to your package.json
- Create initial configuration files
### Manual Setup
Install the CLI and add to package.json scripts:
```bash
# Install as dev dependency
npm install --save-dev @voltagent/cli
# Or globally
npm install -g @voltagent/cli
```
Add to your `package.json`:
```json
{
"scripts": {
"volt": "volt"
}
}
```
Now you can use (pass CLI flags after `--` so npm forwards them to `volt`):
```bash
npm run volt eval dataset push -- --name my-dataset
# Instead of: npx @voltagent/cli eval dataset push --name my-dataset
```
## Dataset Commands
### `eval dataset push`
Upload a local dataset JSON file to VoltOps.
```bash
# Using npm script
npm run volt eval dataset push -- --name <dataset-name>
# Or directly
voltagent eval dataset push --name <dataset-name>
```
**Options:**
| Option | Description | Default |
| --------------- | ------------------------- | --------------------------------- |
| `--name <name>` | Dataset name (required) | - |
| `--file <path>` | Path to dataset JSON file | `.voltagent/datasets/<name>.json` |
**Environment Variables:**
- `VOLTAGENT_DATASET_NAME` - Default dataset name
- `VOLTAGENT_API_URL` - VoltOps API endpoint (default: `https://api.voltagent.dev`)
- `VOLTAGENT_PUBLIC_KEY` - Authentication public key
- `VOLTAGENT_SECRET_KEY` - Authentication secret key
- `VOLTAGENT_CONSOLE_URL` - Console URL for dataset links
**Examples:**
```bash
# Push with environment variable
export VOLTAGENT_DATASET_NAME=production-qa
npm run volt eval dataset push
# Push specific file
npm run volt eval dataset push -- --name qa-tests --file ./data/custom-qa.json
# Push to different environment
VOLTAGENT_API_URL=https://staging-api.voltagent.dev \
npm run volt eval dataset push -- --name staging-data
```
### `eval dataset pull`
Download a dataset from VoltOps to local filesystem.