npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@teamnhz/sandbox-platform-cli

v0.1.0

Published

CLI tool for managing sandbox platform resources

Readme

Sandbox Platform CLI

A command-line interface for managing the E2B-like sandbox platform. Create, manage, and execute code in secure, isolated environments from your terminal.

Installation

# Install globally
npm install -g @sandbox-platform/cli

# Or use with npx
npx @sandbox-platform/cli --help

Quick Start

  1. Authenticate:
sbp auth login
  1. Create a sandbox:
sbp sandbox create --tech-stack python --name my-project
  1. Execute code:
sbp sandbox execute <sandbox-id> "print('Hello from sandbox!')"
  1. List sandboxes:
sbp sandbox list

Commands

Authentication

# Login with API key
sbp auth login

# Check authentication status
sbp auth whoami

# Logout
sbp auth logout

# Show current configuration
sbp auth config

Sandbox Management

# Create sandbox
sbp sandbox create [options]
  -t, --tech-stack <stack>    Technology stack (nodejs, python, go, etc.)
  -n, --name <name>          Project name
  -f, --files <pattern>      Upload files matching pattern
  --template <template>      Use template
  --cpu <cpu>               CPU limit (vCPUs)
  --memory <memory>         Memory limit (MB)
  --timeout <timeout>       Timeout in seconds
  --env <KEY=VALUE>         Environment variables
  --no-wait                 Don't wait for sandbox to be ready

# List sandboxes
sbp sandbox list
  -u, --user-id <userId>    Filter by user ID
  -f, --format <format>     Output format (table|json|yaml)

# Get sandbox details
sbp sandbox get <id>

# Execute code
sbp sandbox execute <id> [code]
  -l, --language <language> Programming language
  -f, --file <file>         Execute code from file
  -s, --stream              Stream execution output
  -t, --timeout <timeout>   Execution timeout

# Delete sandbox
sbp sandbox delete <id>
  -f, --force               Force deletion without confirmation

# Get logs
sbp sandbox logs <id>
  -n, --lines <lines>       Number of lines to show

Templates

# List available templates
sbp templates --list

# Get template details
sbp templates --get <id>

Configuration

# List all configuration
sbp config --list

# Get specific value
sbp config --get <key>

# Set configuration value
sbp config --set <key=value>

# Reset configuration
sbp config --reset

Examples

Create and Use a Python Sandbox

# Create sandbox with template
sbp sandbox create \
  --tech-stack python \
  --name data-analysis \
  --template data-science \
  --env "API_KEY=secret123"

# Execute code with streaming output
sbp sandbox execute sandbox-123 --stream \
  "
import pandas as pd
import numpy as np

data = pd.DataFrame({
    'x': np.random.randn(100),
    'y': np.random.randn(100)
})

print(data.describe())
"

# Execute code from file
sbp sandbox execute sandbox-123 --file analysis.py

# Clean up
sbp sandbox delete sandbox-123 --force

Batch Operations

# List all running sandboxes
sbp sandbox list --format json | jq '.[] | select(.status == "running")'

# Delete all stopped sandboxes
sbp sandbox list --format json | \
  jq -r '.[] | select(.status == "stopped") | .id' | \
  xargs -I {} sbp sandbox delete {} --force

Working with Files

# Create sandbox with initial files
sbp sandbox create \
  --tech-stack nodejs \
  --files "src/**/*.js,package.json" \
  --name web-app

# Execute with environment variables
sbp sandbox execute sandbox-456 \
  --env "NODE_ENV=development" \
  --env "PORT=3000" \
  "npm start"

Configuration

The CLI stores configuration in your home directory. You can configure:

  • apiKey: Your API key for authentication
  • baseUrl: API base URL (default: https://api.sandboxplatform.com)
  • defaultTechStack: Default technology stack
  • outputFormat: Default output format (table, json, yaml)
# Set default tech stack
sbp config --set defaultTechStack=python

# Set custom API URL
sbp config --set baseUrl=https://my-sandbox-api.com

# Set default output format
sbp config --set outputFormat=json

Output Formats

The CLI supports multiple output formats:

Table (default)

sbp sandbox list
┌─────────────┬─────────┬─────────────┬─────────────────────┬──────┐
│ ID          │ Status  │ Tech Stack  │ Created At          │ URLs │
├─────────────┼─────────┼─────────────┼─────────────────────┼──────┤
│ sandbox-123 │ running │ python      │ 2023-12-01 10:30:00 │ 2    │
└─────────────┴─────────┴─────────────┴─────────────────────┴──────┘

JSON

sbp sandbox list --format json
[
  {
    "id": "sandbox-123",
    "status": "running",
    "techStack": "python",
    "createdAt": "2023-12-01T10:30:00Z",
    "urls": {
      "api": "https://...",
      "preview": "https://..."
    }
  }
]

YAML

sbp sandbox list --format yaml
- id: sandbox-123
  status: running
  techStack: python
  createdAt: 2023-12-01T10:30:00Z
  urls:
    api: https://...
    preview: https://...

Tech Stacks

Supported technology stacks:

  • nodejs - Node.js with npm
  • python - Python with pip
  • go - Go with modules
  • java - Java with Maven
  • react-vite - React with Vite
  • vue-vite - Vue with Vite
  • nextjs - Next.js framework
  • sveltekit - SvelteKit framework
  • astro - Astro framework
  • remix - Remix framework
  • qwik - Qwik framework
  • expo - React Native with Expo

Error Handling

The CLI provides detailed error messages and exit codes:

  • 0 - Success
  • 1 - General error
  • 2 - Authentication error
  • 3 - Resource not found
  • 4 - Validation error

Development

# Install dependencies
npm install

# Build CLI
npm run build

# Test locally
npm run dev

# Link for global testing
npm link

Aliases

You can use these shorter aliases:

  • sbp instead of sandbox-platform
  • sb instead of sandbox
  • ls instead of list
  • rm instead of delete
  • tpl instead of templates

License

MIT