Volumes, Commands and Terminals in Endor v0.2

Volumes, Commands and Terminals in Endor v0.2

Angel M Miguel
Angel M Miguel
/ 2025-07-16

Endor provides instant, private, sandboxed environments for your favorite services and tools. It as as simple as typing endor run postgres in the command line.

Endor v0.2 adds exciting new fetures:

  • Volumes: Mount your local projects and run them instantly. Share code, configs, and files seamlessly between host and guest.
  • Terminal: Debug, explore, and modify your environments in real-time with interactive shell access.
  • Commands and Scripts: Automate the service setup with init scripts and one-shot commands. Perfect for pre-configured development services and reproducible environments.

Try It!

You can follow these quick examples to test the new features right away:

# Your first Endor environment in 5 seconds
npx -y @endorhq/cli@latest run alpine --shell

# Or jump straight into a database
npx -y @endorhq/cli@latest run postgres --init-command "createdb -U postgres my-app"

Now, let’s dive into how these new features work.

Volumes

By default, an Endor sandbox does not have access to the host filesystem. Volumes can now bridge your local filesystem with Endor’s isolated environments. Mount any folder to share code, config, scripts, and aso on. Currently this is a one-way integration. Endor sandboxes can read and modify mounted files, but those changes won’t propagate back to your host filesystem, which remains untouched. You will be able to allow two-way changes explicitly in future releases.

How It Works

npx -y @endorhq/cli@latest run -v <host-path>:<guest-path> <service>

Examples

Basic mount

Mount any local directory to share scripts, configs, or data files with your environment.

npx -y @endorhq/cli@latest run -v ./scripts:/data alpine

Database Migrations

Safely test database schema changes and migrations in an isolated PostgreSQL instance.

npx -y @endorhq/cli@latest run 
  -v ./migrations:/migrations 
  --init-command "psql -f /migrations/schema.sql" 
  postgres

Redis Configuration Testing

Experiment with different Redis configurations without affecting your local installation.

npx -y @endorhq/cli@latest run 
  -v ./redis-dev.conf:/etc/redis/redis.conf 
  -v ./test-data:/data 
  --init-command "rc-service redis restart" 
  redis

💡 Pro tip: Endor’s isolation means you can test destructive operations safely. Delete files, modify configs, corrupt data. Your host files stay protected.

Terminal

The --shell flag gives you an interactive terminal inside any Endor environment, transforming isolated services into fully explorable Linux systems. Debug issues, install packages, or run commands—all without touching your host system.

How It Works

npx -y @endorhq/cli@latest run --shell <service>

Examples

Linux on Windows

Get a full Alpine Linux shell on Windows in seconds. No Windows Subsystem for Linux (WSL) or Virtual Machine (VM) software required.

npx -y @endorhq/cli@latest run alpine --allow-net --shell

~5 seconds later you will have a running Alpine Linux with an interactive shell. Perfect for running scripts and experimenting with installing Linux software. Combine this with volumes and you can have an isolated Linux environment running in Windows.

Database Debugging

Connect directly to your database server and run queries interactively.

# PostgreSQL with psql access
npx -y @endorhq/cli@latest run postgres --shell
# Inside the shell: psql -U postgres

# MariaDB with mysql client
npx -y @endorhq/cli@latest run mariadb --shell
# Inside the shell: mysql -u root -proot

Package Installation

Install any tool without polluting your system. Perfect for trying new software or running one-shot scripts.

# Test a Python package in isolation
npx -y @endorhq/cli@latest run alpine --allow-net --shell --init-command "apk add curl"
# Inside: curl https://example.com/install.sh -sSf | bash

Service Configuration

Modify service configs on-the-fly and restart services to test changes.

# Redis with live config updates
npx -y @endorhq/cli@latest run redis --shell
# Inside: vi /etc/redis/redis.conf && rc-service redis restart

💡 Pro tip: Use --allow-net when you need to install packages or download files. Without it, environments are by default network-isolated for security.

Commands and Scripts

Automate your environment setup with commands and scripts, eliminating manual configuration steps. Pre-install packages, seed databases, configure services, or run health checks. All before you even connect! This makes your environments reproducible and ready-to-use from the very first second.

Available Options

  • --command <cmd>: Run a single command and exit. Perfect for one-shot tasks and CI/CD pipelines.
  • --init-command <cmd>: Execute commands during startup. Ideal for installing dependencies or configuring services.
  • --init-script <path>: Run a script from your host during startup. Great for complex setup logic or multi-step configurations.

Examples

One-Shot Database Queries

Execute a single query and get the result — no need for an interactive session.

# Check PostgreSQL version
npx -y @endorhq/cli@latest run postgres 
  --command "psql -U postgres -c 'SELECT version();'"

# Count Redis keys
npx -y @endorhq/cli@latest run redis 
  --command "redis-cli DBSIZE"

Pre-configured Development Databases

Set up a database with test data automatically.

# PostgreSQL with schema and seed data
npx -y @endorhq/cli@latest run postgres 
  -v ./db-setup:/setup 
  --init-command "psql -U postgres -f /setup/schema.sql" 
  --init-command "psql -U postgres -f /setup/seed-data.sql" 
  --shell

Complex Setup with Scripts

Use init scripts for sophisticated environment preparation.

# Create a setup script
cat > setup-dev-env.sh << 'EOF'
#!/bin/sh
apk add jq vim
wget https://my-project.test/tools.zip
echo "Environment ready!"
EOF

# Run it during startup
npx -y @endorhq/cli@latest run alpine 
  -v ./my-app:/app 
  --allow-net 
  --init-script ./setup-dev-env.sh 
  --shell

CI/CD Integration

Perfect for automated testing and deployment pipelines.

# Run integration tests with timeout
npx -y @endorhq/cli@latest run postgres 
  -v ./tests:/tests 
  --init-command "createdb -U postgres testdb" 
  --command "psql -U postgres testdb -f /tests/integration.sql" 
  --command-timeout 60

💡 Pro tip: Commands execute in order: init-commands first, then init-scripts, and finally the main command. Use --command-timeout to prevent hanging in CI/CD environments.

Share it

We’d love to hear how you’re using Endor! Share your workflows and report issues:

Happy coding with Endor! 🚀

Share this article