> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Template Catalog CLI (JS)

> CLI commands for template catalog - reference for JavaScript/TypeScript developers

CLI commands for browsing, building, and managing the PraisonAI template catalog. These commands work the same regardless of whether you're using Python or TypeScript.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    User([User]) --> CLI[CLI]
    CLI --> Catalog([Templates])

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class Catalog agent
    class CLI,User tool
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff
```

## Quick Start

<Steps>
  <Step title="Simple Usage">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai templates list
    ```
  </Step>

  <Step title="With Configuration">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai templates run my-template
    ```
  </Step>
</Steps>

***

## Browse Templates

Open the template catalog in your default browser.

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Open catalog in browser
praisonai templates browse

# Print URL only (don't open browser)
praisonai templates browse --print

# Use custom catalog URL
praisonai templates browse --url https://my-catalog.example.com
```

| Option        | Description                                   |
| ------------- | --------------------------------------------- |
| `--print`     | Print the catalog URL without opening browser |
| `--url <url>` | Use a custom catalog URL                      |
| `--local`     | Run local catalog server (if installed)       |

## Validate Templates

Validate TEMPLATE.yaml files for correctness.

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Validate templates in default location
praisonai templates validate

# Validate specific directory
praisonai templates validate --source ./my-templates

# Strict mode (warnings become errors)
praisonai templates validate --strict

# JSON output format
praisonai templates validate --json
```

| Option           | Description                                |
| ---------------- | ------------------------------------------ |
| `--source <dir>` | Directory containing templates to validate |
| `--strict`       | Treat warnings as errors                   |
| `--json`         | Output results as JSON                     |

## Build Catalog

Build the template catalog locally.

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Build with defaults
praisonai templates catalog build

# Specify output directory
praisonai templates catalog build --out ./dist

# Use custom source directory
praisonai templates catalog build --source ./my-templates

# Minify output
praisonai templates catalog build --minify
```

| Option            | Description                           |
| ----------------- | ------------------------------------- |
| `--out <dir>`     | Output directory for generated files  |
| `--source <path>` | Source directory containing templates |
| `--minify`        | Minify JSON output                    |

## Sync Sources

Sync template sources from GitHub repositories.

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Sync all configured sources
praisonai templates catalog sync

# Sync specific source
praisonai templates catalog sync --source agent-recipes

# Use custom config file
praisonai templates catalog sync --config ./my-config.json

# Specify cache directory
praisonai templates catalog sync --cache-dir ./my-cache
```

| Option              | Description                 |
| ------------------- | --------------------------- |
| `--source <name>`   | Sync only a specific source |
| `--config <path>`   | Path to catalog config file |
| `--cache-dir <dir>` | Override cache directory    |

## List Templates

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# List all templates
praisonai templates list

# Show search paths
praisonai templates list --paths

# Filter by source
praisonai templates list --source custom
```

## Search Templates

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Search by keyword
praisonai templates search video

# Search with offline mode
praisonai templates search transcript --offline
```

## Template Info

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Get template info
praisonai templates info ai-video-editor
```

## Run Templates

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# Run a template
praisonai templates run transcript-generator ./audio.mp3

# With options
praisonai templates run ai-video-editor input.mp4 --output edited.mp4
```

## Using with Node.js

You can execute CLI commands from Node.js using `child_process`:

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { exec } from 'child_process';
import { promisify } from 'util';

const execAsync = promisify(exec);

async function runTemplate(name: string, args: string[] = []) {
  const cmd = `praisonai templates run ${name} ${args.join(' ')}`;
  const { stdout, stderr } = await execAsync(cmd);
  return { stdout, stderr };
}

async function validateTemplates(source?: string) {
  const cmd = source 
    ? `praisonai templates validate --source ${source} --json`
    : `praisonai templates validate --json`;
  const { stdout } = await execAsync(cmd);
  return JSON.parse(stdout);
}

async function buildCatalog(outDir: string) {
  const cmd = `praisonai templates catalog build --out ${outDir}`;
  const { stdout } = await execAsync(cmd);
  return stdout;
}

// Usage
const results = await validateTemplates('./templates');
console.log('Validation results:', results);
```

## Complete Command Reference

| Command                                            | Description                 |
| -------------------------------------------------- | --------------------------- |
| `praisonai templates browse`                       | Open catalog in browser     |
| `praisonai templates browse --print`               | Print catalog URL           |
| `praisonai templates validate`                     | Validate templates          |
| `praisonai templates validate --source <dir>`      | Validate specific directory |
| `praisonai templates validate --strict`            | Strict validation mode      |
| `praisonai templates validate --json`              | JSON output                 |
| `praisonai templates catalog build`                | Build catalog locally       |
| `praisonai templates catalog build --out <dir>`    | Build to specific directory |
| `praisonai templates catalog sync`                 | Sync template sources       |
| `praisonai templates catalog sync --source <name>` | Sync specific source        |
| `praisonai templates list`                         | List all templates          |
| `praisonai templates search <query>`               | Search templates            |
| `praisonai templates info <name>`                  | Show template details       |
| `praisonai templates run <name>`                   | Run a template              |

## Related

<CardGroup cols={2}>
  <Card title="Template Catalog" icon="js" href="/docs/js/template-catalog">TypeScript API</Card>
  <Card title="Agent" icon="robot" href="/docs/js/agent">Agent configuration</Card>
</CardGroup>
