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


Tokens: 8312

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

# hoody-app Subskill

## Overview

The `hoody-app` service provides application resolution and execution across multiple package sources. It enables searching, selecting, and running applications from configured sources with support for profiles, recipes, and batch operations.

**When to use this service:**
- Searching for available applications across package sources
- Running or preflight-checking application execution
- Managing package sources (add, remove, sync, diagnose)
- Creating and managing user profiles with different preferences
- Saving and reusing selector templates as recipes
- Executing batch operations across multiple applications

**How it fits into Hoody philosophy:**
- Provides unified access to applications regardless of source
- Supports authenticated, container-targeted operations via `hoody` CLI
- Enables reproducible workflows through profiles and recipes
- Integrates with Hoody's job system for async operations

**Key concepts:**
- **Sources**: Package registries or repositories where applications are found
- **Profiles**: Named configurations with default preferences and source overrides
- **Recipes**: Saved selector templates for repeatable application resolution
- **Selectors**: Query objects that identify target applications

---

## Common Workflows

### 1. Health Check

Verify the service is running:

```
hoody app health -c <container-id>
```

```
{
  "status": "healthy",
  "version": "1.0.0",
  "uptime": 3600,
  "timestamp": "2025-01-15T10:30:00Z",
  "service": "hoody-app",
  "environment": "production",
  "region": "us-east-1",
  "instance": "abc123"
}
```

### 2. Search for Applications

Find applications matching a query:

```
hoody app search --app "node" -c <container-id>
```

```
{
  "candidates": [
    {
      "app": "node",
      "version": "20.10.0",
      "source": "npm-registry",
      "rank": 1
    }
  ],
  "set_id": "search-abc123",
  "total": 1
}
```

### 3. Run an Application

Execute an application directly:

```
hoody app run --app "node@20" -c <container-id>
```

```
{
  "command": "node",
  "args": ["--version"],
  "resolved_app": "node@20.10.0",
  "source": "npm-registry"
}
```

### 4. Preflight Check

Validate execution plan without running:

```
hoody app preflight --app "python@3.11" -c <container-id>
```

```
{
  "app": "python@3.11",
  "resolved_version": "3.11.7",
  "source": "pypi",
  "command": "python3.11",
  "available": true
}
```

### 5. Manage Package Sources

**List all sources:**

```
hoody app sources list -c <container-id>
```

```
{
  "sources": [
    {
      "source_id": "npm-registry",
      "source_type": "npm",
      "provider": "npmjs",
      "enabled": true,
      "priority": 100,
      "pin": {
        "url": "https://registry.npmjs.org"
      }
    }
  ]
}
```

**Add a new source:**

```
hoody app sources create \
  --source-id "custom-registry" \
  --source-type "npm" \
  --provider "custom" \
  --enabled true \
  --priority 50 \
  --pin.url "https://custom.registry.com" \
  -c <container-id>
```

```
{
  "source_id": "custom-registry",
  "source_type": "npm",
  "provider": "custom",
  "enabled": true,
  "priority": 50,
  "pin": {
    "url": "https://custom.registry.com"
  }
}
```

**Sync a specific source:**

```
hoody app sources sync npm-registry -c <container-id>
```

```
{
  "job_id": "sync-job-abc123",
  "status": "queued",
  "source_id": "npm-registry"
}
```

**Sync all sources:**

```
hoody app sources sync-all -c <container-id>
```

```
{
  "job_id": "sync-all-job-def456",
  "status": "queued"
}
```

**Get source diagnostics:**

```
hoody app sources diagnostics npm-registry -c <container-id>
```

```
{
  "source_id": "npm-registry",
  "health": "healthy",
  "last_sync": "2025-01-15T09:00:00Z",
  "last_search": "2025-01-15T10:25:00Z",
  "recent_failures": []
}
```

**Delete a source:**

```
hoody app sources delete custom-registry -c <container-id>
```

### 6. Manage Profiles

**List profiles:**

```
hoody app profiles list -c <container-id>
```

```
{
  "profiles": [
    {
      "name": "default",
      "description": "Default profile",
      "defaults": {},
      "sources_mode": "all",
      "sources": []
    }
  ],
  "selected": "default"
}
```

**Create a profile:**

```
hoody app profiles create \
  --name "production" \
  --description "Production environment profile" \
  -c <container-id>
```

```
{
  "name": "production",
  "description": "Production environment profile",
  "defaults": {},
  "sources_mode": "all",
  "sources": []
}
```

**Select a profile:**

```
hoody app profiles select production -c <container-id>
```

```
{
  "selected": "production",
  "message": "Profile 'production' is now active"
}
```

**Delete a profile:**

```
hoody app profiles delete old-profile -c <container-id>
```

### 7. Manage Recipes

**List recipes:**

```
hoody app recipes list -c <container-id>
```

```
{
  "recipes": [
    {
      "name": "node-lts",
      "selector": {
        "app": "node@lts"
      }
    }
  ]
}
```

**Create a recipe:**

```
hoody app recipes create \
  --name "python-data" \
  --selector.app "python@3.11" \
  -c <container-id>
```

```
{
  "name": "python-data",
  "selector": {
    "app": "python@3.11"
  }
}
```

**Run a recipe:**

```
hoody app recipes run python-data -c <container-id>
```

```
{
  "command": "python3.11",
  "args": [],
  "resolved_app": "python@3.11.7",
  "source": "pypi"
}
```

### 8. Monitor Async Jobs

**Check job status:**

```
hoody app jobs sync-job-abc123 -c <container-id>
```

```
{
  "job_id": "sync-job-abc123",
  "status": "completed",
  "progress": 100,
  "result": {
    "synced": 1500,
    "errors": 0
  }
}
```

**Wait for job completion:**

```
hoody app jobs sync-job-abc123 --wait done --timeout-ms 30000 -c <container-id>
```

### 9. Get Configuration

View full runtime configuration:

```
hoody app config -c <container-id>
```

```
{
  "sources": [],
  "profiles": [],
  "selected_profile": "default"
}
```

### 10. Get API Documentation

Retrieve OpenAPI spec:

```
hoody app openapi --format yaml -c <container-id>
```

```
hoody app openapi --format json -c <container-id>
```

---

## Advanced Operations

### Batch Operations

Process multiple search or run requests in a single call:

```
hoody app batch \
  --items '[
    {
      "request_id": "req-1",
      "mode": "search",
      "selector": {
        "app": "node"
      }
    },
    {
      "request_id": "req-2",
      "mode": "run",
      "selector": {
        "app": "python@3.11"
      }
    }
  ]' \
  -c <container-id>
```

```
{
  "results": [
    {
      "request_id": "req-1",
      "status": "success",
      "candidates": [
        {
          "app": "node",
          "version": "20.10.0"
        }
      ]
    },
    {
      "request_id": "req-2",
      "status": "success",
      "command": "python3.11"
    }
  ]
}
```

### Paged Search

For large result sets, use paged search with cursor-based pagination:

```
hoody app search-paged \
  --selector.app "tool" \
  --page-size 10 \
  -c <container-id>
```

```
{
  "candidates": [],
  "cursor": "eyJwYWdlIjoxfQ==",
  "has_more": true,
  "total": 150
}
```

**Next page:**

```
hoody app search-paged \
  --selector.app "tool" \
  --page-size 10 \
  --cursor "eyJwYWdlIjoxfQ==" \
  -c <container-id>
```

### Async Search Jobs

Queue long-running searches in the background:

```
hoody app search-jobs --app "complex-query" -c <container-id>
```

```
{
  "job_id": "search-job-xyz789",
  "status": "queued"
}
```

Poll for results:

```
hoody app jobs search-job-xyz789 --wait done -c <container-id>
```

### Path-Based Application Resolution

Use clean URLs for application resolution:

```
hoody app go "node@20" -c <container-id>
```

```
hoody app go "linux/python@3.11" -c <container-id>
```

### Terminal-Anchored Resolution

Specify both terminal and application in a single path:

```
hoody app go-terminal --terminal-id term-abc --rest "node@20" -c <container-id>
```

### Error Recovery Patterns

**Source sync failure recovery:**

1. Check source diagnostics:
   ```
   hoody app sources diagnostics failing-source -c <container-id>
   ```

2. If source is unhealthy, disable it:
   ```
   hoody app sources update failing-source --enabled false -c <container-id>
   ```

3. After fixing, re-enable and sync:
   ```
   hoody app sources update failing-source --enabled true -c <container-id>
   hoody app sources sync failing-source -c <container-id>
   ```

**Job timeout handling:**

If a job times out, check its status without waiting:

```
hoody app jobs <job-id> -c <container-id>
```

If stuck, the job may need to be retried by re-running the original command.

### Performance Considerations

- **Use profiles** to avoid repeating common source configurations
- **Use recipes** for frequently-run applications to skip search resolution
- **Batch operations** reduce network overhead for multiple requests
- **Paged search** prevents memory issues with large result sets
- **Async jobs** prevent blocking on long-running sync or search operations
- **Source priority** affects search order—put fastest sources first

---

## Quick Reference

### Essential Commands

| Command | Description |
|---------|-------------|
| `hoody app health` | Check service health |
| `hoody app search --app <name>` | Search for applications |
| `hoody app run --app <name>` | Run an application |
| `hoody app preflight --app <name>` | Validate without running |
| `hoody app sources list` | List package sources |
| `hoody app sources sync` | Sync all sources |
| `hoody app profiles list` | List profiles |
| `hoody app profiles select <name>` | Activate a profile |
| `hoody app recipes list` | List saved recipes |
| `hoody app recipes run <name>` | Run a saved recipe |
| `hoody app jobs <id>` | Check job status |
| `hoody app config` | View full configuration |

### Common Parameters

| Parameter | Description |
|-----------|-------------|
| `-c <container-id>` | Target container (required) |
| `-o json` | Output as JSON |
| `--app <name>` | Application selector (required for search/run) |
| `--name <name>` | Name for profiles/recipes |
| `--enabled <bool>` | Enable/disable sources |
| `--priority <int>` | Source priority (higher = searched first) |
| `--wait <status>` | Wait for job status (e.g., `done`) |
| `--timeout-ms <int>` | Timeout for wait operations |

### Typical Response Formats

**Health response** (9 fields):
```
{
  "status": "healthy",
  "version": "1.0.0",
  "uptime": 3600,
  "timestamp": "2025-01-15T10:30:00Z",
  "service": "hoody-app",
  "environment": "production",
  "region": "us-east-1",
  "instance": "abc123"
}
```

**Job status response:**
```
{
  "job_id": "job-abc123",
  "status": "completed",
  "progress": 100,
  "result": {}
}
```

**Search response:**
```
{
  "candidates": [],
  "set_id": "search-abc123",
  "total": 0
}
```

**Run response:**
```
{
  "command": "app-name",
  "args": [],
  "resolved_app": "app@version",
  "source": "source-id"
}
```

### Authentication

```
# Login with credentials
hoody auth login --username <user> --password <pass>

# Use token directly
hoody app health --token <api-token> -c <container-id>

# Use environment variable
export HOODY_TOKEN=<api-token>
hoody app health -c <container-id>
```