<!--
hoody-code Subskill (cli)
Auto-generated by Hoody Skills Generator
Generated: 2026-06-19T23:03:59.354Z
Model: mimo-v2.5-pro + fixer:z-ai/glm-5.1
Mode: cli


Tokens: 5878

DO NOT EDIT MANUALLY - Changes will be overwritten on next generation
-->

# hoody-code Subskill

## Overview

### What is hoody-code?
hoody-code provides VS Code instances accessible via URL, running as containerized services in the Hoody ecosystem. Each container can host multiple VS Code instances, enabling cloud-based development environments with automatic domain routing and SSL termination.

### When to Use
- Accessing VS Code web interface without local installation
- Managing VS Code extensions in containerized environments
- Proxying local development services through secure URLs
- Building automated development workflows
- Health monitoring and update management for VS Code servers

### Integration with Hoody Philosophy
hoody-code embodies the Hoody principles of container-based service isolation with automatic routing. All instances follow the standardized URL pattern:
```
https://{projectId}-{containerId}-{serviceName}-{serviceId}.{node}.containers.hoody.com
```
This enables zero-configuration access with built-in authentication, allowing developers to focus on coding rather than infrastructure setup.

### Core Features
- Multiple VS Code instances per container
- Automatic SSL termination and domain routing
- Extension management via CLI
- PWA support for desktop installation
- Local port proxying for development services
- Health checks and update management

## Common Workflows

### 1. Access VS Code Web Interface
```
# Get the VS Code web interface URL
hoody code vs -c my-container-123 -o json
```

### 2. Install VS Code Extensions
```
# Install an extension from a URL (required: url field)
hoody code install -c my-container-123 \
  --url "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/python/2023.22.0/vspackage"

# Verify installation
hoody code list -c my-container-123
```

### 3. Authentication Management
```
# Get login page (when authentication is enabled)
hoody code login -c my-container-123

# Submit credentials (rate limited: 2 attempts/minute)
hoody code submit -c my-container-123 -u developer -p securepass123

# Logout and clear session
hoody code logout -c my-container-123
```

### 4. Service Health Monitoring
```
# Check service health (doesn't count toward heartbeat)
hoody code health -c my-container-123 -o json

# Check for updates (queries GitHub releases)
hoody code check-update -c my-container-123
```

### 5. Proxy Local Services
```
# Proxy to local port with path stripping (port 1024-65535 required)
hoody code proxy 8080 /api/data -c my-container-123

# Proxy with absolute path (full path preserved)
hoody code proxy-path 3000 /v2/users -c my-container-123
```

### 6. PWA and Security Setup
```
# Get PWA manifest for desktop installation
hoody code manifest -c my-container-123 -o json

# Generate server encryption key (256-bit, stored in user-data-dir)
hoody code mint-key -c my-container-123

# Retrieve security policy
hoody code security-policy -c my-container-123
```

### 7. Static Assets and Injected Scripts
```
# Get static files from build directory
hoody code static /js/app.js -c my-container-123

# Retrieve injected JavaScript (loaded when --hoody-code enabled)
hoody code injected-script /hoody-code/main.js -c my-container-123

# Get robots.txt
hoody code robots -c my-container-123
```

### 8. Complete Development Setup Workflow
```
# Step 1: Access VS Code interface
hoody code vs -c dev-container-456

# Step 2: Install required extensions
hoody code install -c dev-container-456 \
  --url "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/dbaeumer/vsextensions/eslint/2.4.2/vspackage"

# Step 3: Generate encryption key for secure communication
hoody code mint-key -c dev-container-456

# Step 4: Configure proxy for local API development
hoody code proxy 4000 /graphql -c dev-container-456

# Step 5: Verify setup
hoody code health -c dev-container-456 -o json
```

### State Verification Between Steps
- After `install`: Use `list` to verify extension appears
- After `login`: Check `vs` returns interface (not login redirect)
- After `mint-key`: Key stored in `user-data-dir/serve-web-key-half`
- After `proxy`: Service accessible via proxied URL

## Advanced Operations

### 1. Automated Extension Deployment
```
CONTAINER="prod-vscode-789"

# Install multiple extensions in sequence
hoody code install -c $CONTAINER \
  --url "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-azuretools/vsextensions/vscode-docker/1.26.1/vspackage"

hoody code install -c $CONTAINER \
  --url "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode/vsextensions/remote-containers/0.327.0/vspackage"

# Verify all installations
hoody code list -c $CONTAINER -o json | jq '.extensions | length'
```

### 2. Error Recovery Patterns

**Extension Installation Failure:**
```
# Check service health first
hoody code health -c problematic-container -o json

# If service is healthy, try installation with verbose output
hoody code install -c problematic-container \
  --url "https://valid-marketplace-url" 2>&1 | tee install.log

# Check for rate limiting (login attempts)
hoody code submit -c problematic-container -u user -p pass 2>&1 | grep -i "rate"
```

**Proxy Connection Issues:**
```
# Verify proxy configuration
hoody code proxy 8080 /api -c container-id

# Check target service is running on specified port
hoody code health -c container-id -o json | jq '.runtime.ports'

# Test proxy with absolute path
hoody code proxy-path 8080 /api/health -c container-id
```

### 3. Performance Optimization

**Batch Operations:**
```
# Parallel extension installation (if container supports)
hoody code install -c container-id --url "ext1.vsix" &
hoody code install -c container-id --url "ext2.vsix" &
wait
```

**Selective Health Checks:**
```
# Quick health check without full service startup
hoody code health -c container-id -o json | jq '.status'

# Schedule update checks during maintenance windows
hoody code check-update -c container-id  # Runs every 6 hours
```

### 4. Multi-Container Management
```
# Script to apply same configuration to multiple containers
for container in vs-code-1 vs-code-2 vs-code-3; do
  hoody code install -c $container \
    --url "https://essential-extension.vsix"
  hoody code mint-key -c $container
done
```

### 5. Custom Script Injection
```
# Inject custom JavaScript after VS Code loads
# Scripts in extra/injected/ load sequentially after window load
hoody code injected-script /custom/init.js -c container-id
```

### 6. Update Management Strategy
```
# Check for updates (notifies once per week)
hoody code check-update -c container-id -o json

# In CI/CD pipelines, check and log without applying
hoody code check-update -c staging-container | tee update-check.log
```

## Quick Reference

### Essential Commands
| Command | Description | Required Parameters |
|---------|-------------|---------------------|
| `hoody code vs` | Get VS Code web interface | `-c <container-id>` |
| `hoody code install` | Install extension | `-c`, `--url <vsix-url>` |
| `hoody code list` | List extensions | `-c` |
| `hoody code health` | Health check | `-c` |
| `hoody code proxy` | Proxy to local port | `-c`, `<port>`, `<path>` |
| `hoody code mint-key` | Generate encryption key | `-c` |

### Common Parameters
- `-c <container-id>`: Target container (or set `HOODY_CONTAINER` env var)
- `-o json`: Machine-readable JSON output
- `--url`: VSIX URL for extension installation
- `-u`: Username for authentication
- `-p`: Password for authentication

### Response Patterns
**Health Check:**
```
{
  "status": "healthy",
  "runtime": {
    "version": "1.85.0",
    "uptime": 3600
  }
}
```

**Extension List:**
```
{
  "extensions": [
    {
      "id": "ms-python.python",
      "version": "2023.22.0",
      "displayName": "Python"
    }
  ]
}
```

**PWA Manifest:**
```
{
  "name": "Hoody Code",
  "display": "fullscreen",
  "icons": [
    {
      "src": "/_static/icons/192.png",
      "sizes": "192x192"
    }
  ]
}
```

### Port Proxy Limitations
- **Port Range**: 1024-65535
- **Path Proxy**: Strips prefix (`/proxy/port/path` → `/path`)
- **Absolute Proxy**: Preserves full path (`/absproxy/port/path` → `/port/path`)

### Authentication Notes
- **Password Authentication**: Argon2 hashing supported
- **Rate Limiting**: 2 attempts/minute, 12 attempts/hour
- **Session Management**: Cookie-based
- **Key Storage**: `user-data-dir/serve-web-key-half` (persistent)

### Important Behaviors
- `health` endpoint doesn't count toward heartbeat activity
- `check-update` queries GitHub releases every 6 hours
- `mint-key` generates 256-bit key, reused across restarts
- `injected` scripts load sequentially after VS Code window load
- `proxy` requests forward to applications running on local ports