open-index/open-npm huggingface dataset:
npm package: @infilla/devbox
Description: `devbox` - CLI for managing devboxes.
Latest version: 0.0.0-0680d86

# @infilla/devbox

`devbox` - CLI for managing devboxes.

## Installation

```bash
npm install -g @infilla/devbox
```

Or run from the monorepo:

```bash
# From repo root
bun cli <command>

# Or directly
bun packages/cli/src/index.ts <command>
```

## Commands

### create

Create a new devbox.

```bash
devbox create <name>
```

### list

List all existing devboxes.

```bash
devbox list
devbox ls
```

### use

Set the active devbox for the current directory. Creates a `.devbox` file.

```bash
devbox use <name>
```

### current

Show the currently active devbox.

```bash
devbox current
```

### destroy

Destroy a devbox. Uses active devbox if name not provided.

```bash
devbox destroy [name]
```

### exec

Execute a command in a devbox. Uses active devbox by default.

```bash
devbox exec <command...>
devbox exec -n my-devbox ls -la
devbox exec npm install
```

### ssh

SSH into a devbox.

```bash
devbox ssh [name]
```

### preview

Get a preview URL for a port.

```bash
devbox preview <port>
devbox preview -n my-devbox 3000
```

### proxy

Proxy remote ports to localhost via SSH tunnel.

```bash
devbox proxy <ports> [name]
devbox proxy 3000,8080
devbox proxy 3000,8080,1337 my-devbox
```

### editor

Open the devbox in an editor. Supported: code (VS Code), cursor, windsurf, vscodium.

```bash
devbox editor [editor]
devbox editor cursor
devbox editor --list  # Show all editor URLs
```

## Active Devbox

Many commands support an active devbox to avoid repeating the name:

```bash
# Set active devbox
devbox use my-devbox

# Commands now use my-devbox automatically
devbox exec ls -la
devbox ssh
devbox preview 3000
devbox destroy
```

The active devbox is stored in `.devbox` in the current directory:

```json
{
  "name": "my-devbox"
}
```

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| `DEVBOX_SERVER` | `http://localhost:1337` | Backend server URL |

## Examples

### Full Workflow

```bash
# Create a devbox
devbox create dev

# Set as active
devbox use dev

# Run commands
devbox exec "git clone https://github.com/user/repo ."
devbox exec "npm install"
devbox exec "npm run dev"

# Get preview URL
devbox preview 3000

# Or proxy to localhost
devbox proxy 3000

# SSH for interactive work
devbox ssh

# Open in editor
devbox editor cursor

# Clean up
devbox destroy
```

### Multiple Devboxes

```bash
# Create multiple devboxes
devbox create frontend
devbox create backend

# Work on frontend
devbox use frontend
devbox exec "npm run dev"

# Switch to backend
devbox use backend
devbox exec "cargo run"

# List all
devbox list
```