Overview

The vibekit local connect command provides interactive shell access to your sandbox environment. It uses Dagger’s terminal functionality to give you a full shell experience for debugging, exploration, and manual operations.

Syntax

vibekit local connect [options]

Options

OptionAliasDescriptionDefault
--env <name>-eEnvironment name to connect toInteractive prompt
--shell <shell>Shell to use: bash, zsh, shbash
--container <image>Container image for terminalalpine

Examples

Basic Connection

Connect to environment with default shell:
vibekit local connect -e my-env
Interactive selection:
vibekit local connect
# Prompts for environment selection

Different Shells

Use specific shell:
# Bash (default)
vibekit local connect -e my-env --shell bash

# Zsh
vibekit local connect -e my-env --shell zsh

# Basic sh
vibekit local connect -e my-env --shell sh

Custom Container

Use different base container:
# Ubuntu container
vibekit local connect -e my-env --container ubuntu:latest

# Node.js container
vibekit local connect -e my-env --container node:18

# Python container
vibekit local connect -e my-env --container python:3.11

Interactive Shell Features

Available Commands

Once connected, you have full shell access:
# Navigate filesystem
cd /app
ls -la

# Edit files
vi config.json
nano README.md

# Run processes
npm start
python app.py

# Check environment
env
whoami
pwd

Environment Persistence

Changes made during connection persist:
  • File modifications
  • Installed packages
  • Environment variables (for session)
  • Running processes

Exiting

To disconnect:
exit
# or
Ctrl+D

Common Use Cases

Debugging

Investigate issues interactively:
# Connect to environment
vibekit local connect -e debug-env

# Inside shell:
# Check logs
tail -f /var/log/app.log

# Inspect processes
ps aux | grep node

# Test connections
curl http://localhost:3000/health

File Editing

Make quick manual changes:
vibekit local connect -e my-env

# Edit configuration
vi config/settings.json

# Update environment file
echo "DEBUG=true" >> .env

# Create new files
touch newfile.txt

Package Management

Install or update packages:
vibekit local connect -e my-env

# Node.js
npm install express
yarn add -D @types/node

# Python
pip install requests
pip freeze > requirements.txt

# System packages
apt-get update && apt-get install -y curl

Process Management

Manage running services:
vibekit local connect -e my-env

# Start services
npm run dev &
redis-server &

# Check running processes
jobs
ps aux

# Stop services
kill %1
killall node

Advanced Usage

Session Management

Work with multiple terminals:
# Terminal 1: Run server
vibekit local connect -e my-env
npm run server

# Terminal 2: Run tests
vibekit local connect -e my-env
npm test --watch

File Transfer

Copy files in/out of environment:
# Inside environment
cat important-file.txt
# Copy output manually

# Or use exec for automated transfer
vibekit local exec -e my-env -c "cat file.txt" > local-file.txt

Environment Exploration

Understand the sandbox:
vibekit local connect -e my-env

# Check OS
cat /etc/os-release

# Available tools
which git npm python

# Disk usage
df -h

# Memory
free -m

Integration with Development Workflow

Post-Generation Review

Review AI-generated code:
# Generate code
vibekit local generate -e my-env -p "Create authentication system"

# Connect to review
vibekit local connect -e my-env

# Inside shell
git diff
cat src/auth.js
npm test

Manual Testing

Test features interactively:
vibekit local connect -e my-env

# Start server
npm run dev

# In another terminal, test API
curl -X POST http://localhost:3000/api/login \
  -H "Content-Type: application/json" \
  -d '{"email":"test@example.com","password":"123456"}'

Configuration Tweaks

Adjust settings on the fly:
vibekit local connect -e my-env

# Update config
vi config/database.json

# Test changes
npm run migrate
npm start

Shell Customization

Shell Configuration

The shell inherits the environment’s configuration:
  • Working directory from environment
  • Environment variables
  • Installed packages
  • User permissions

Installing Tools

Add tools as needed:
vibekit local connect -e my-env

# Install development tools
apt-get update
apt-get install -y vim git curl wget

# Install language-specific tools
npm install -g nodemon
pip install ipython

Tips and Tricks

1. Productivity Shortcuts

# Set up aliases
echo "alias ll='ls -la'" >> ~/.bashrc
echo "alias gs='git status'" >> ~/.bashrc
source ~/.bashrc

2. Multiple Windows

Use terminal multiplexer:
# Install tmux
apt-get install -y tmux

# Start tmux session
tmux

# Split windows
Ctrl+b %  # Split vertically
Ctrl+b "  # Split horizontally

3. Command History

Navigate history efficiently:
  • ↑/↓ - Previous/next command
  • Ctrl+R - Search history
  • history - View all commands
  • !n - Run command number n

4. File Navigation

Quick navigation:
# Jump to project root
cd $WORKDIR

# Find files
find . -name "*.js" -type f

# Search in files
grep -r "TODO" .

Troubleshooting

Connection Failed

# Check environment status
vibekit local status -e my-env

# Ensure environment is running
vibekit local list --status running

# Try recreating
vibekit local delete my-env
vibekit local create --name my-env --agent claude

Shell Not Available

# Use basic sh if bash unavailable
vibekit local connect -e my-env --shell sh

# Or install bash
vibekit local exec -e my-env -c "apt-get update && apt-get install -y bash"

Permission Issues

# Inside environment
sudo command  # If sudo available

# Or reconnect with different container
vibekit local connect -e my-env --container ubuntu:latest

Terminal Display Issues

# Set terminal type
export TERM=xterm-256color

# Reset terminal
reset
clear

Security Considerations

Isolation

  • Each environment is isolated
  • Changes don’t affect host system
  • Network isolation can be configured

Best Practices

  1. Don’t store secrets in shell history
  2. Use environment variables for sensitive data
  3. Clean up sensitive files before sharing
  4. Be cautious with system commands

Performance

Resource Usage

Interactive sessions use minimal additional resources:
  • Share environment’s allocated CPU/memory
  • No additional container overhead
  • Efficient terminal streaming

Long-Running Sessions

For extended work:
# Use tmux/screen for persistence
vibekit local connect -e my-env
tmux new -s work

# Detach: Ctrl+b d
# Reattach later:
vibekit local connect -e my-env
tmux attach -t work