AI Video CLI: Generate UGC Videos from Your Terminal

First video free, no card

Developer

Nobody else ships a CLI for AI video generation. agent-media gives you npm install -g agent-media-cli, and you can generate UGC videos without ever opening a browser. Write scripts in your editor, batch-generate across actors, pipe output into your CI/CD pipeline. See pricing.

Install and Authenticate

The CLI is a single npm package. Install it globally and log in with your agent-media account. Authentication opens your browser once, then stores the token locally.

$ npm install -g agent-media-cli

$ agent-media login

Logged in as you@example.com

Generate Your First Video

One command. Description, script, duration, subtitles. Run agent-media status <job-id> --watch to wait for the job, then agent-media download to save the MP4.

$ agent-media selfie \

--description "woman in her late 20s, warm and natural, kitchen morning light" \

--script "This changed everything for me. I used to spend hours on content." \

--duration 10

Generating... job sel_8f2ac91b3c

$ agent-media status sel_8f2ac91b3c --watch

done (2m 14s)

$ agent-media download sel_8f2ac91b3c -o clip.mp4

Saved: clip.mp4

Saved Actors for a Consistent Series

Persist a person once with agent-media character create and reuse the returned id across every clip, so the same face and voice show up every time instead of a new person per call.

$ agent-media character create \

--name "sofia" \

--description "woman in her late 20s, warm and natural, kitchen morning light" \

--voice-brief "upbeat, energetic"

Created character char_8f2ac91b3c

$ agent-media selfie \

--character char_8f2ac91b3c \

--script "Stop scrolling. This product changed my morning routine." \

--duration 10

Batch Generation via Shell Scripting

Because it runs in the terminal, you can wrap agent-media in a shell loop. Generate the same script across 5 saved characters in one shot. Or loop over a file of scripts and character ids.

#!/bin/bash
SCRIPT="Stop scrolling. This product changed my morning routine."
CHARACTERS=("char_8f2ac91b3c" "char_1c77e4a290" "char_5b0f2d81aa" "char_9e63c7b204" "char_2a94d1f877")

for CHAR in "${CHARACTERS[@]}"; do
  echo "Generating for $CHAR..."
  agent-media selfie \\
    --character "$CHAR" \\
    --script "$SCRIPT" \\
    --duration 10
done

echo "All videos generated."

Five videos, five different faces, same script. Upload them all to your ad platform and test which one drives the best click-through rate. Total cost: 1,625 credits.

CI/CD Integration

Run agent-media in GitHub Actions, GitLab CI, or any pipeline that supports Node.js. Set your API key as a secret, install the CLI, and generate videos on every push or on a schedule.

name: Generate UGC Videos
on:
  schedule:
    - cron: '0 9 * * 1'  # Every Monday at 9am

jobs:
  generate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 20

      - run: npm install -g agent-media-cli

      - run: |
          agent-media selfie \\
            --description "woman in her late 20s, warm and natural, kitchen morning light" \\
            --script "New week, new routine." \\
            --duration 10
        env:
          AGENT_MEDIA_API_KEY: \${{ secrets.AGENT_MEDIA_KEY }}

      - uses: actions/upload-artifact@v4
        with:
          name: ugc-videos
          path: "*.mp4"

Claude Code Skill Integration

agent-media works as a Claude Code skill. Your AI coding assistant can generate videos directly from the conversation. Write a prompt describing the video you want, and Claude calls the CLI under the hood.

Generate a 10-second UGC video with Sofia reviewing a fitness app.

Running: agent-media selfie --character char_8f2ac91b3c --script "I found this fitness app..." --duration 10

Video saved: clip.mp4

This is useful when you want an AI assistant to handle the creative copy and video generation in one step. No context-switching between tools.

CLI Commands Reference

Why the agent-media CLI

Related Pages

Last updated: April 2026

What do you sell?

First video free, no card