Content Creation
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Content Creation module in the Recoup CLI provides a comprehensive interface for managing and triggering automated content pipelines. It allows users to browse available visual templates, validate artist readiness, estimate operational costs, and initiate high-quality video generation runs. The system is designed to handle both individual requests and parallel batch processing.
This module acts as a wrapper around the Recoup REST API, specifically interacting with /api/content/* endpoints to facilitate the transition from artist assets to finished marketing or social content. Once triggered, progress can be monitored through the Tasks System.
Sources: src/commands/content.ts:1-12, src/commands/content/createCommand.ts:7-14, CLAUDE.md:28-28
System Architecture and Components
The content creation system is structured as a nested command hierarchy under the primary content command. It is composed of four primary sub-commands that manage different stages of the content lifecycle.
Core Command Structure
The system uses commander.js to define its interface, delegating logic to specific command implementations.
| Command | Description | Source File |
|---|---|---|
templates | Lists available visual styles and settings | src/commands/content/templatesCommand.ts |
validate | Checks if an artist has necessary assets for generation | src/commands/content/validateCommand.ts |
estimate | Calculates the USD cost for a generation run | src/commands/content/estimateCommand.ts |
create | Triggers the actual production pipeline | src/commands/content/createCommand.ts |
Sources: src/commands/content.ts:1-12, src/commands/content/createCommand.ts:7-20
Content Creation Flow
The following diagram illustrates the typical workflow a user follows to generate content using the CLI.
The workflow ensures that requirements (templates and artist assets) are met before incurring costs or triggering backend resources.
Sources: src/commands/content/createCommand.ts:36-60, tests/commands/content.test.ts:38-75
Functional Modules
Template Management
The templates command retrieves curated configurations that define the visual output (e.g., "artist-caption-bedroom"). Each template includes a name and a descriptive summary of the visual setting or style.
Sources: src/commands/content/templatesCommand.ts:7-30, tests/commands/content.test.ts:25-36
Artist Validation
Before creation, the system checks if an artist account is "ready." This involves verifying the presence of specific files required by the generation engine. If the artist is not ready, the CLI provides a list of missing files.
Sources: src/commands/content/validateCommand.ts:7-29, tests/commands/content.test.ts:38-53
Cost Estimation
The estimate command allows users to project expenses based on specific parameters:
- Lipsync: Whether the video requires audio-visual synchronization.
- Batch Count: Total number of videos to be generated.
- Comparison: Inclusion of different profile variations.
Sources: src/commands/content/estimateCommand.ts:7-35, tests/commands/content.test.ts:55-68
The Creation Pipeline
The create command is the primary entry point for triggering production. It supports several configuration options to customize the output quality and length.
API Parameters
The command sends a POST request to /api/content/create with the following schema:
| Parameter | Type | Default | Description |
|---|---|---|---|
artist_account_id | String | (Required) | The unique ID of the artist |
template | String | artist-caption-bedroom | The visual style to apply |
lipsync | Boolean | false | Enable/disable audio lip synchronization |
caption_length | String | short | Options: short, medium, long |
upscale | Boolean | false | Increase resolution for higher quality |
batch | Integer | 1 | Number of parallel videos to generate |
songs | String Array | undefined | Optional list of song slugs to use |
Sources: src/commands/content/createCommand.ts:7-20, src/commands/content/createCommand.ts:31-34
Execution Logic
The following sequence diagram detail how the CLI handles a creation request and provides tracking information back to the user.
The CLI provides immediate feedback by listing the runIds generated by the backend, which are essential for subsequent status checks.
Sources: src/commands/content/createCommand.ts:21-63, tests/commands/content.test.ts:70-90
Tasks and Monitoring
Because content creation is an asynchronous process, the CLI instructs users to utilize the tasks module for monitoring. The tasks status command queries the /api/tasks/runs endpoint to provide real-time updates on the generation status and eventually returns the signed URL of the completed video.
Run Status Schema
| Field | Description |
|---|---|
id | The unique run identifier |
status | Current state (e.g., COMPLETED, PENDING) |
output.video.signedUrl | The final location of the generated content |
Sources: tests/commands/tasks.test.ts:31-64, src/commands/content/createCommand.ts:62-62
Conclusion
The Content Creation system provides a structured, validated path for generating media assets. By separating template discovery, asset validation, and cost estimation from the actual creation trigger, the CLI ensures a reliable user experience. The integration with the Tasks module allows for robust monitoring of the long-running asynchronous processes involved in high-quality video production.