npm package: @riventa/cli
Description: Riventa.Dev CLI - Command line tools for DevOps automation
Author: Riventa.Dev
Latest version: 1.2.2

# @riventa/cli

Command line interface for Riventa.Dev - AI-powered DevOps platform.

## Installation

```bash
npm install -g @riventa/cli
# or
yarn global add @riventa/cli
```

## Quick Start

```bash
# Authenticate
riventa login

# Initialize project
riventa init

# Deploy
riventa deploy

# Run code review
riventa review --file src/app.ts

# Check status
riventa status
```

## Commands

| Command | Description |
|---------|-------------|
| `riventa login` | Authenticate with Riventa.Dev |
| `riventa logout` | Log out and clear credentials |
| `riventa whoami` | Show current authenticated user |
| `riventa init` | Initialize project in current directory |
| `riventa projects` | List and switch between projects |
| `riventa deploy` | Deploy to production |
| `riventa status` | View project and deployment status |
| `riventa logs` | View deployment logs |
| `riventa rollback` | Rollback to a previous deployment |
| `riventa review` | Run AI code review on changes |
| `riventa security` | Security scanning and score |
| `riventa config` | Manage CLI configuration |
| `riventa config:update` | Update .riventa.yml with AI |
| `riventa health` | Check API connectivity and status |

## Command Details

### Authentication

```bash
# Login with browser (recommended)
riventa login

# Show current user
riventa whoami

# Logout
riventa logout
```

### Project Management

```bash
# Initialize a new project
riventa init

# List all projects
riventa projects
```

### Deployments

```bash
# Deploy to production
riventa deploy

# Deploy to a specific environment
riventa deploy --environment staging

# Deploy a specific branch
riventa deploy --branch feature/new-ui

# Check deployment status
riventa status

# View deployment logs
riventa logs

# Follow logs in real-time
riventa logs --follow

# View specific deployment logs
riventa logs --deployment dep_123abc
```

### Rollback

```bash
# Interactive rollback
riventa rollback

# Rollback to specific deployment
riventa rollback --deployment dep_123abc
```

### Code Review

```bash
# Review staged changes
riventa review

# Review a specific file
riventa review --file src/components/Button.tsx

# Review a pull request
riventa review --pr 42
```

### Configuration

```bash
# List all configuration
riventa config --list

# Get a specific value
riventa config --get baseUrl

# Set a value
riventa config --set baseUrl=https://custom.api.riventa.dev
```

## Configuration File

Riv AI generates and manages `.riventa.yml` automatically. Run `riventa init` and the AI will analyze your project structure, framework, and cloud provider to create the optimal configuration — no manual YAML writing needed.

```bash
# AI generates .riventa.yml based on your project
riventa init

# Update config with natural language
riventa config:update "add Slack notifications to #deploys"
riventa config:update "enable auto-rollback on error rate > 5%"
riventa config:update "add staging environment with health checks"
```

### `config:update` Command

Modify your `.riventa.yml` using natural language instructions:

```bash
riventa config:update <instruction>
```

The command reads your current `.riventa.yml`, sends the instruction to Riv AI, shows a diff preview of the proposed changes, and applies them after confirmation.

### Security

```bash
# Run a security scan
riventa security --scan

# View security score
riventa security --score
```

### Health Check

```bash
# Check API connectivity
riventa health
```

## Environment Variables

| Variable | Description |
|----------|-------------|
| `RIVENTA_API_KEY` | API key for authentication |
| `RIVENTA_BASE_URL` | Custom API base URL |

## Documentation

Full documentation at [https://riventa.dev/developers/cli](https://riventa.dev/developers/cli)

## License

MIT