| name | narrator-ai-cli-skill |
| description | Use narrator-ai-cli to create AI-powered movie narration videos through natural language commands |
| triggers | ["create a movie narration video","generate narration for a film","make a video commentary","use narrator-ai-cli","create video with movie clips and voiceover","generate AI narration video","search for movies to narrate","list available narration templates"] |
narrator-ai-cli-skill
Skill by ara.so — Devtools Skills collection.
This skill enables AI agents to use narrator-ai-cli, a command-line tool for automated movie narration video production. The CLI wraps the NarratorAI API and provides commands for searching movies, selecting templates, generating scripts, and composing videos.
What is narrator-ai-cli?
narrator-ai-cli is a Python CLI tool that automates the creation of movie narration videos (also called "film commentary" or "short drama" videos). It handles the entire pipeline: movie selection → template selection → script generation → video composition.
Key capabilities:
- Search ~100 built-in movies or upload custom content
- 90+ narration templates (comedy, suspense, emotional, etc.)
- 146 BGM tracks and 63 dubbing voices
- Two workflows: Adapted Narration (uses existing clips) and Original Narration (AI generates everything)
- Voice cloning and text-to-speech
- Full video composition pipeline
Installation
Install via pip from the GitHub repository:
pip install "narrator-ai-cli @ git+https://github.com/NarratorAI-Studio/narrator-ai-cli.git"
Requirements:
- Python 3.10+
- Dependencies: typer, httpx[socks], httpx-sse, pyyaml, rich
Verify installation:
narrator-ai-cli --version
Configuration
Set API Key
The CLI requires an API key. Set it using the config command:
narrator-ai-cli config set app_key YOUR_APP_KEY
Or set the environment variable:
export NARRATOR_APP_KEY="your_api_key_here"
To obtain an API key: Contact merlinyang@gridltd.com
View Current Configuration
narrator-ai-cli config show
Core Concepts
Before using the CLI, understand these key terms:
- file_id: Unique identifier for uploaded files (movies, audio, images)
- task_id: Identifier for async tasks (script generation, video composition)
- task_order_num: Serial number for tracking task status
- Adapted Narration: Uses pre-existing movie clips (Fast Path)
- Original Narration: AI generates clips from scratch (Standard Path)
- Hot Drama: Select from ~100 built-in movies
- Original Mix: Upload your own movie file
- New Drama: Upload multiple video clips manually
Key Commands
1. Resource Discovery
List movies:
narrator-ai-cli resource movie list
Search for a specific movie:
narrator-ai-cli resource movie list --search "Shawshank"
List narration templates:
narrator-ai-cli resource template list
Filter templates by category:
narrator-ai-cli resource template list --category comedy
List BGM tracks:
narrator-ai-cli resource bgm list
List dubbing voices:
narrator-ai-cli resource dubbing list
2. File Management
Upload a movie file:
narrator-ai-cli file upload /path/to/movie.mp4
Returns a file_id for use in subsequent commands.
List uploaded files:
narrator-ai-cli file list
3. Fast Path: Adapted Narration (Original Narration)
This workflow uses AI to generate the entire video from a movie file.
Step 0: Upload movie (if using Original Mix mode)
narrator-ai-cli file upload movie.mp4
Step 1: Select movie and template
For Hot Drama mode (built-in movie):
narrator-ai-cli resource movie list --search "Inception"
narrator-ai-cli resource template list --category suspense
Step 2: Generate narration script
Using Hot Drama mode:
narrator-ai-cli task create-script \
--mode hot_drama \
--movie-id MOVIE_ID \
--template-id TEMPLATE_ID \
--bgm-id BGM_ID \
--dubbing-id DUBBING_ID
Using Original Mix mode (custom movie):
narrator-ai-cli task create-script \
--mode original_mix \
--file-id abc123 \
--template-id TEMPLATE_ID \
--bgm-id BGM_ID \
--dubbing-id DUBBING_ID
Returns task_id and task_order_num.
Step 3: Poll task status
narrator-ai-cli task status TASK_ORDER_NUM
Poll every 10-15 seconds until status is completed. The output will contain script_file_id.
Step 4: Compose video
narrator-ai-cli task compose-video \
--script-file-id SCRIPT_FILE_ID \
--visual-template-id VISUAL_TEMPLATE_ID
Returns task_id and task_order_num for the composition task.
Step 5: Poll composition status and download
narrator-ai-cli task status COMPOSITION_TASK_ORDER_NUM
When completed, the output contains video_url. Download the video:
curl -o final_video.mp4 "VIDEO_URL"
4. Standard Path: Adapted Narration (Adapted Narration)
This workflow uses pre-existing movie clips (requires uploading clip metadata).
Step 0: Upload movie and clip data
narrator-ai-cli file upload movie.mp4
narrator-ai-cli file upload clips.json
Step 1: Generate narration script
narrator-ai-cli task create-script \
--mode new_drama \
--file-id movie123 \
--clip-data-file-id clips456 \
--template-id TEMPLATE_ID \
--bgm-id BGM_ID \
--dubbing-id DUBBING_ID
Steps 2-4: Same as Fast Path (poll script status, compose video, poll composition status)
5. Standalone Tasks
Voice cloning:
narrator-ai-cli file upload voice_sample.mp3
narrator-ai-cli task clone-voice --file-id voice789 --name "My Custom Voice"
Text-to-speech:
narrator-ai-cli task tts \
--text "Hello, this is a test narration." \
--dubbing-id DUBBING_ID \
--speed 1.0 \
--volume 1.0
6. Task Management
List all tasks:
narrator-ai-cli task list
Get task details:
narrator-ai-cli task status TASK_ORDER_NUM
Common Patterns
Pattern 1: End-to-End Video Creation (Fast Path)
narrator-ai-cli resource movie list --search "Matrix"
narrator-ai-cli resource template list --category action
narrator-ai-cli resource bgm list
narrator-ai-cli resource dubbing list
narrator-ai-cli task create-script \
--mode hot_drama \
--movie-id 12345 \
--template-id 67890 \
--bgm-id 111 \
--dubbing-id 222
narrator-ai-cli task status 999
narrator-ai-cli task compose-video \
--script-file-id script_abc \
--visual-template-id 1
narrator-ai-cli task status 1000
curl -o my_narration.mp4 "https://..."
Pattern 2: Using Custom Movie (Original Mix)
narrator-ai-cli file upload my_movie.mp4
narrator-ai-cli task create-script \
--mode original_mix \
--file-id custom123 \
--template-id 67890 \
--bgm-id 111 \
--dubbing-id 222
Pattern 3: Batch Video Creation
import subprocess
import json
import time
def create_narration_video(movie_id, template_id, bgm_id, dubbing_id):
result = subprocess.run([
"narrator-ai-cli", "task", "create-script",
"--mode", "hot_drama",
"--movie-id", str(movie_id),
"--template-id", str(template_id),
"--bgm-id", str(bgm_id),
"--dubbing-id", str(dubbing_id)
], capture_output=True, text=True)
task_order_num = parse_task_order_num(result.stdout)
while True:
status_result = subprocess.run([
"narrator-ai-cli", "task", "status", str(task_order_num)
], capture_output=True, text=True)
status_data = parse_status_output(status_result.stdout)
if status_data["status"] == "completed":
script_file_id = status_data["script_file_id"]
break
elif status_data["status"] == "failed":
raise Exception(f"Script generation failed: {status_data}")
time.sleep(15)
compose_result = subprocess.run([
, , ,
, script_file_id,
,
], capture_output=, text=)
compose_task_num = parse_task_order_num(compose_result.stdout)
:
status_result = subprocess.run([
, , , (compose_task_num)
], capture_output=, text=)
status_data = parse_status_output(status_result.stdout)
status_data[] == :
status_data[]
status_data[] == :
Exception()
time.sleep()
movies = [, , , , ]
movie_id movies:
video_url = create_narration_video(
movie_id=movie_id,
template_id=,
bgm_id=,
dubbing_id=
)
()
Configuration Options
The CLI stores configuration in ~/.narrator-ai-cli/config.yaml. Key settings:
app_key: "your_api_key"
api_endpoint: "https://api.narrator-ai.com"
log_level: "INFO"
Set configuration values:
narrator-ai-cli config set KEY VALUE
narrator-ai-cli config set log_level DEBUG
Get configuration value:
narrator-ai-cli config get app_key
Error Handling
The CLI returns standard error codes. Common errors:
| Code | Meaning | Action |
|---|
| 401 | Invalid API key | Check NARRATOR_APP_KEY or config |
| 404 | Resource not found | Verify file_id, movie_id, or template_id |
| 429 | Rate limit exceeded | Wait and retry |
| 500 | Server error | Check API status, retry later |
Example error output:
Error: API request failed with status 401
Details: {"error": "Invalid API key"}
Troubleshooting
Issue: "narrator-ai-cli: command not found"
Solution: Ensure the CLI is installed and in your PATH:
pip install "narrator-ai-cli @ git+https://github.com/NarratorAI-Studio/narrator-ai-cli.git"
which narrator-ai-cli
Issue: "API key not configured"
Solution: Set the API key:
narrator-ai-cli config set app_key YOUR_KEY
export NARRATOR_APP_KEY="YOUR_KEY"
Issue: Task stuck in "processing" status
Solution: Tasks can take 5-15 minutes depending on complexity. Poll status every 10-15 seconds:
while true; do
narrator-ai-cli task status TASK_ORDER_NUM
sleep 15
done
If stuck for >30 minutes, check API status or contact support.
Issue: Video composition fails
Solution: Ensure script_file_id is from a completed script task. Check task output:
narrator-ai-cli task status SCRIPT_TASK_ORDER_NUM
Issue: Downloaded video is corrupted
Solution: Use proper download method:
curl -L -o video.mp4 "VIDEO_URL"
Important Notes for AI Agents
-
Always poll task status — Script generation and video composition are async. Poll every 10-15 seconds until status: completed.
-
Resource IDs are required — Before creating tasks, retrieve IDs for movie, template, BGM, and dubbing from resource commands.
-
Confirm before creating tasks — Each task may incur costs. Ask the user to confirm movie/template selection before running task create-script.
-
Use environment variables for secrets — Never hardcode API keys. Use $NARRATOR_APP_KEY or config file.
-
Handle file uploads carefully — When using Original Mix or New Drama modes, upload files first and note the returned file_id.
-
Visual template is optional — If not specified, defaults to template ID 1. User can override with --visual-template-id.
-
Language chain — If user speaks Chinese, default to Chinese templates, BGM, and dubbing. If English, default to English resources. Always ask for confirmation.
-
Check task status errors — If a task fails, examine the error message in the status output and suggest corrective action.
Workflow Decision Tree
When a user asks to create a narration video:
-
Ask for movie source:
- Built-in movie (Hot Drama) → Get movie_id
- Custom movie file (Original Mix) → Upload file, get file_id
- Multiple clips (New Drama) → Upload files + clip data
-
Ask for template preference:
- List templates, ask user to select by ID or category
-
Ask for BGM and dubbing:
- List options, use defaults if user has no preference
-
Confirm details:
- Show selected movie, template, BGM, dubbing
- Ask "Proceed with video creation?"
-
Execute workflow:
- Fast Path (Original Narration) → Steps 0-4
- Standard Path (Adapted Narration) → Steps 0-5
-
Monitor and report:
- Poll task status, show progress
- Provide video URL when complete
API Endpoint Reference
The CLI communicates with the NarratorAI API at https://api.narrator-ai.com. All requests require the app_key header.
Example manual API call (for debugging):
curl -X GET "https://api.narrator-ai.com/v1/resources/movies" \
-H "app_key: $NARRATOR_APP_KEY"
Data Privacy
- Uploaded files are stored on NarratorAI servers
- Files are associated with your API key
- Generated videos are accessible via temporary URLs
- No data is stored locally by the CLI except configuration
Additional Resources