<!--
hoody-code Subskill (cli)
Auto-generated by Hoody Skills Generator
Generated: 2026-05-06T20:51:09.428Z
Model: mimo-v2.5-pro
Mode: cli


Tokens: 5962

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

# hoody-code Subskill

## Overview

**What it does**: hoody-code provides VS Code instances accessible via URL, enabling remote development environments within Hoody containers. Each container can host multiple VS Code instances with automatic domain routing, SSL termination, and built-in authentication.

**When to use it**:
- When you need a web-based IDE for containerized development
- For collaborative coding sessions in shared environments
- When automating development environment setup
- For remote debugging and code editing without local setup

**Hoody philosophy alignment**:
- Zero DNS configuration required
- Automatic SSL/TLS termination
- Built-in authentication via Hoody API
- Service instance isolation
- Multi-tenant support
- Standardized across all services

**Key characteristics**:
- Multiple VS Code instances per container
- Automatic domain-based routing: `https://{projectId}-{containerId}-{serviceName}-{serviceId}.{node}.containers.hoody.icu`
- Progressive Web App (PWA) support
- Extension management capabilities
- Port proxying for local applications

## Common Workflows

### 1. Basic VS Code Access

**Step 1: Get VS Code web interface**
```
# Get VS Code interface for a specific container
hoody code vs -c container-123
```

**Step 2: Verify service health**
```
# Check if VS Code service is running
hoody code health -c container-123 -o json
```

**Expected response**:
```
{
  "status": "healthy",
  "process": {
    "pid": 1234,
    "memory": 104857600,
    "uptime": 3600
  },
  "runtime": {
    "nodeVersion": "v18.17.0",
    "platform": "linux"
  }
}
```

### 2. Authentication Workflow

**Step 1: Check current authentication status**
```
# Attempt to access VS Code (will redirect to login if needed)
hoody code vs -c container-123
```

**Step 2: Get login page (if authentication required)**
```
# Get login page HTML
hoody code login -c container-123
```

**Step 3: Submit credentials**
```
# Submit login credentials (interactive)
hoody code submit -c container-123
```

**Step 4: Verify successful login**
```
# Access VS Code again after login
hoody code vs -c container-123
```

**Step 5: Logout when done**
```
# Clear session and logout
hoody code logout -c container-123
```

### 3. Extension Management

**Step 1: List installed extensions**
```
# Get all installed extensions
hoody code list -c container-123 -o json
```

**Expected response**:
```
[
  {
    "name": "python",
    "displayName": "Python",
    "version": "2023.14.0",
    "publisher": "ms-python"
  },
  {
    "name": "gitlens",
    "displayName": "GitLens",
    "version": "14.1.0",
    "publisher": "eamodio"
  }
]
```

**Step 2: Install a new extension**
```
# Install extension from VSIX URL
hoody code install -c container-123 --url "https://example.com/extension.vsix"
```

**Step 3: Verify installation**
```
# Check if extension appears in list
hoody code list -c container-123 | grep "extension-name"
```

### 4. Port Proxying for Local Applications

**Step 1: Proxy to local application (path-based)**
```
# Proxy to port 3000 with path stripping
hoody code proxy-path 3000 /api/data -c container-123
```

**Step 2: Proxy to local application (absolute path)**
```
# Proxy to port 8080 with full path preservation
hoody code proxy 8080 /app/dashboard -c container-123
```

**Step 3: Verify proxy is working**
```
# Test the proxied endpoint
hoody code proxy-path 3000 /health -c container-123
```

### 5. PWA Installation

**Step 1: Get PWA manifest**
```
# Get Progressive Web App manifest
hoody code manifest -c container-123 -o json
```

**Expected response**:
```
{
  "name": "Hoody Code",
  "short_name": "HoodyCode",
  "start_url": "/",
  "display": "fullscreen",
  "icons": [
    {
      "src": "/_static/icon-192.png",
      "sizes": "192x192",
      "type": "image/png"
    }
  ]
}
```

**Step 2: Generate encryption key (for PWA security)**
```
# Generate server web key for encryption
hoody code mint-key -c container-123
```

## Advanced Operations

### 1. Multi-Step Environment Setup

**Complete development environment setup**:
```
# 1. Verify container exists and service is healthy
hoody code health -c container-123 -o json

# 2. Install required extensions
hoody code install -c container-123 --url "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/python/2023.14.0/vspackage"
hoody code install -c container-123 --url "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-vscode/vsextensions/live-server/0.4.12/vspackage"

# 3. Verify all extensions installed
hoody code list -c container-123 -o json

# 4. Set up port proxying for development server
hoody code proxy-path 3000 /api -c container-123

# 5. Access the environment
hoody code vs -c container-123
```

### 2. Error Recovery Patterns

**Scenario: Service unresponsive**
```
# 1. Check service health
hoody code health -c container-123 -o json

# 2. If unhealthy, check for updates
hoody code check-update -c container-123

# 3. Clear authentication if login issues
hoody code logout -c container-123

# 4. Re-authenticate
hoody code submit -c container-123

# 5. Verify recovery
hoody code vs -c container-123
```

**Scenario: Extension installation failure**
```
# 1. Check current extensions
hoody code list -c container-123

# 2. Try alternative installation method
hoody code install -c container-123 --url "https://alternative-source.com/extension.vsix"

# 3. Verify installation
hoody code list -c container-123 | grep "extension-name"
```

### 3. Performance Considerations

**Optimize for large codebases**:
```
# Use absolute proxy for better performance with large files
hoody code proxy 8080 /large-files -c container-123

# Monitor service health during heavy operations
watch -n 5 'hoody code health -c container-123 -o json'
```

**Resource monitoring**:
```
# Check service health for memory/CPU usage
hoody code health -c container-123 -o json | jq '.process.memory'

# Monitor uptime
hoody code health -c container-123 -o json | jq '.process.uptime'
```

### 4. Security Operations

**Check security policy**:
```
# Get security.txt for vulnerability disclosure
hoody code security-policy -c container-123
```

**Verify robots.txt**:
```
# Check crawling permissions
hoody code robots -c container-123
```

**Access injected scripts**:
```
# Get specific injected script
hoody code injected-script "custom-theme.js" -c container-123
```

## Quick Reference

### Most Common Commands

| Command | Description | Example |
|---------|-------------|---------|
| `hoody code vs` | Get VS Code interface | `hoody code vs -c container-123` |
| `hoody code health` | Service health check | `hoody code health -c container-123 -o json` |
| `hoody code list` | List extensions | `hoody code list -c container-123` |
| `hoody code install` | Install extension | `hoody code install -c container-123 --url "URL"` |
| `hoody code proxy-path` | Proxy to local port | `hoody code proxy-path 3000 /api -c container-123` |

### Essential Parameters

| Parameter | Description | Required |
|-----------|-------------|----------|
| `-c <container-id>` | Target container | Yes (or `HOODY_CONTAINER` env var) |
| `-o json` | JSON output format | No (for machine-readable) |
| `--url` | Extension VSIX URL | For `install` command |
| `port` | Local port number | For proxy commands |
| `path` | Path to proxy | For proxy commands |

### Typical Response Formats

**Health check response**:
```
{
  "status": "healthy",
  "process": {
    "pid": 1234,
    "memory": 104857600,
    "uptime": 3600
  },
  "runtime": {
    "nodeVersion": "v18.17.0",
    "platform": "linux"
  }
}
```

**Extension list response**:
```
[
  {
    "name": "python",
    "displayName": "Python",
    "version": "2023.14.0",
    "publisher": "ms-python"
  }
]
```

**PWA manifest response**:
```
{
  "name": "Hoody Code",
  "short_name": "HoodyCode",
  "start_url": "/",
  "display": "fullscreen",
  "icons": [
    {
      "src": "/_static/icon-192.png",
      "sizes": "192x192",
      "type": "image/png"
    }
  ]
}
```

### Important Notes

1. **Always target containers**: Use `-c <container-id>` or set `HOODY_CONTAINER` environment variable
2. **Use JSON for automation**: Add `-o json` for machine-readable output
3. **Authentication required**: Most operations require authentication via `hoody auth login` or `--token`
4. **No direct HTTP calls**: Always use `hoody` CLI commands, never curl
5. **Rate limiting**: Login attempts are rate-limited (2/minute, 12/hour)
6. **Update checks**: Automatic update checks occur every 6 hours