nouclip ยท diff

git:20260905.24439c7 to git:20260905.5f53f92

26 added, 27 removed. Audit C to C.

---
name: nouclip
description: CLI video clipping, universal aspect reframing (9:16, 1:1, 4:5), Whisper transcription, kinetic subtitle burning, typography presets, silence trimming, BGM ducking, dependency checks, and installation workflows using NouClip CLI.
---
# NouClip โ€” Agentic Video Clipper & Shorts Engine Skill
Operational instructions and procedures for checking prerequisites, installing dependencies, clipping videos, reframing aspect ratios, transcribing with Whisper, applying typography presets, trimming silence, mixing ducked BGM, and burning kinetic subtitles using the `nouclip` CLI.
---
## ๐Ÿ› ๏ธ Step 0: Verification & Self-Installation (For Agents)
Before running clipping commands, verify that required host binaries are present on the system.
### 1. Check if `nouclip` is Installed
```bash
nouclip --version
```
If `nouclip` is **not found** (`command not found` or `ENOENT`), install it using one of the following methods:
- **Option A (Package Managers โ€” Recommended & Fastest):**
Check if `bun`, `npm`, or `pnpm` is available on the machine:
```bash
# Using Bun (Fastest)
bun add -g nouclip
# Using npm
npm install -g nouclip
# Using pnpm
pnpm add -g nouclip
```
- **Option B (One-Line Standalone Script for Linux & macOS):**
```bash
curl -fsSL https://raw.githubusercontent.com/nouverse/nouclip/main/install.sh | bash
```
- **Option C (Direct GitHub Releases Binary Download):**
```bash
# Linux (x86_64)
curl -fsSL https://github.com/nouverse/nouclip/releases/latest/download/nouclip-linux-x64 -o /usr/local/bin/nouclip && chmod +x /usr/local/bin/nouclip
# macOS Apple Silicon (arm64)
curl -fsSL https://github.com/nouverse/nouclip/releases/latest/download/nouclip-darwin-arm64 -o /usr/local/bin/nouclip && chmod +x /usr/local/bin/nouclip
# macOS Intel (x86_64)
curl -fsSL https://github.com/nouverse/nouclip/releases/latest/download/nouclip-darwin-x64 -o /usr/local/bin/nouclip && chmod +x /usr/local/bin/nouclip
# Windows (PowerShell)
Invoke-WebRequest -Uri "https://github.com/nouverse/nouclip/releases/latest/download/nouclip-windows-x64.exe" -OutFile "$env:LOCALAPPDATA\Microsoft\WindowsApps\nouclip.exe"
```
### 2. Check & Install System Dependencies (`ffmpeg` & `yt-dlp`)
Check if installed:
```bash
ffmpeg -version
yt-dlp --version
```
If missing, install per host OS:
- **macOS:** `brew install ffmpeg yt-dlp`
- **Ubuntu/Debian:** `sudo apt update && sudo apt install -y ffmpeg && pip install yt-dlp`
- **Arch Linux:** `sudo pacman -S ffmpeg yt-dlp`
- **Windows:** `winget install Gyan.FFmpeg yt-dlp`
---
## ๐Ÿ” Introspection & Storage Discovery
NouClip is agent-friendly. Before re-downloading or re-processing, always inspect the workspace:
```bash
# Discover storage paths and existing assets in JSON
nouclip info --json
# List specific asset collections
nouclip list downloads --json
nouclip list transcripts --json
nouclip list segments --json
nouclip list output --json
```
Default workspace is `~/.nouclip/`:
- `~/.nouclip/downloads/` โ€” Cached raw source/YouTube videos (never re-downloaded if present).
- `~/.nouclip/transcripts/` โ€” Whisper JSONs (`*.whisper.json`) and ASS scripts (`*.ass`).
- `~/.nouclip/segments/` โ€” Cut raw segments, trimmed videos, and reframed MP4s.
- `~/.nouclip/output/` โ€” Final rendered videos with burned subtitles & mixed BGM.
---
## โฑ๏ธ Timestamp & Range Syntax
NouClip accepts human, timestamp, and second ranges:
- **Ranges:** `--range 13:25-14:50` or `--range 01:20..02:15` or `--range 45-75`
- **Explicit From/To:** `--from 13:25 --to 14:50` (or `--start 13:25 --end 14:50`)
- **Duration:** `--from 13:25 --duration 45s` (or `--start 805 --duration 45`)
- **Formats accepted:** `MM:SS` (`13:25`), `HH:MM:SS` (`01:13:25`), human units (`1h30m`, `13m25s`, `45s`), and raw seconds (`85.5`).
---
## ๐ŸŽจ Typography Presets (`--style`)
NouClip includes 4 built-in animated ASS kinetic typography presets:
- `--style hormozi`: High-energy all-caps (Arial Black), electric neon green highlight (`&H0000FF00`), pop scaling 118%, thick 6px outline.
- `--style storyteller`: Clean natural-case (Inter/Arial), soft cyan highlight (`&H0050E3C2`), refined 3px outline.
- `--style cinematic`: Elegant wide-tracking (+4), golden amber highlight (`&H0000A5FF`).
- `--style default`: Classic yellow highlight.
---
## โœ‚๏ธ Silence & Pause Trimming (`--silence-trim`)
- Automatically detects silent pauses between spoken words using Whisper word timestamps (`--silence-gap 0.6` by default).
- Excises silent gaps and concatenates video seamlessly with FFmpeg.
- Automatically recalculates and frame-shifts subtitle `.ass` timestamps so captions stay 100% aligned with the trimmed video.
---
## ๐ŸŽต Background Music & Sidechain Ducking (`--bgm`)
- `--bgm <path>`: Background music track to loop and mix with video audio.
- Auto sidechain ducking: BGM volume automatically attenuates when speech is detected and gently rises back up during silence.
- `--bgm-volume <volume>`: BGM volume factor (default: `0.10`).
- `--no-ducking`: Disables sidechain compression for constant volume mixing.
---
## ๐Ÿ“ Aspect Ratios & Framing Modes
| Preset | Target Resolution | Description |
|---|---|---|
| `9:16` *(default)* | 1080x1920 | TikTok, YouTube Shorts, Instagram Reels |
| `1:1` | 1080x1080 | Instagram Feed, Square Video |
| `4:5` | 1080x1350 | Instagram Portrait Feed |
| `16:9` | 1920x1080 | YouTube Horizontal, Widescreen |
| `4:3` | 1440x1080 | Classic standard definition |
### Framing Styles (`--mode`)
- `--mode blur` *(default, or `--blur`)*: Scales and heavily blurs background video, overlays clean centered foreground. Ideal for podcasts and screen-shares.
- `--mode center` *(or `--center`)*: Full-bleed zoom and center crop to fill the entire target canvas.
- `--mode pad`: Letterbox / pillarbox with black padding bars.
- `--mode stretch`: Scales directly without maintaining source aspect ratio.
---
## โœ๏ธ Staged & Draft Review Workflow (MANDATORY FOR AI AGENTS)
> **โš ๏ธ STRICT DIRECTIVE FOR ALL AI AGENTS:**
> 1. **ALWAYS use `--draft` (or `--no-burn`) on `nouclip auto` and video clipping.** Never run a blind end-to-end burn in one step.
> 2. **ALWAYS inspect and edit the intermediate `.ass` transcript** to fix typos, acronyms, or styling before rendering.
> 3. **MANDATORY USER CONFIRMATION:** Always present the draft cuts, summary, and transcript snippet to the user, and **WAIT for explicit user approval before triggering the final render/burn**.
AI Whisper STT can mishear proper nouns, brand names, or slang. The staging protocol guarantees zero hallucinated/typo subtitles:
### Step 1: Generate Segment & Subtitle Draft
```bash
nouclip auto "https://youtu.be/EXAMPLE_ID" \
--range 13:25-14:10 \
--aspect 9:16 \
--style hormozi \
--blur \
--draft
```
Output will return:
- Segment Video: `~/.nouclip/segments/video_framed_9x16_blur.mp4`
- Subtitle Script: `~/.nouclip/transcripts/video_13m25s-14m10s.ass`
### Step 2: Review & Edit Subtitle
Read and correct any typos in the `.ass` file:
```bash
# Agent opens ~/.nouclip/transcripts/<name>.ass and edits words, casing, or styles directly
```
### Step 3: Present Draft & Await User Confirmation
Show the clip proposal and transcript draft to the user in your natural conversational voice/language (the following is an illustrative example):
```text
"Draft clip & subtitles are ready (13:25 - 14:10):
- Hook / Topic: 'Why we migrated to Hono...'
- Style: Hormozi (Neon Green highlight)
- Silence Trim: Enabled (>0.6s excised)
- BGM: lofi_beat.mp3 (Sidechain ducking active)
Ready to proceed with final rendering?"
```
**CRITICAL:** Present the plan in your natural voice, and **STOP to wait for explicit user confirmation**. DO NOT proceed to Step 4 until approved.
### Step 4: Burn Verified Subtitles into Final Video (After Approval)
```bash
nouclip subtitle ~/.nouclip/segments/video_framed_9x16_blur.mp4 \
--sub ~/.nouclip/transcripts/video_13m25s-14m10s.ass \
--bgm "lofi_music.mp3" \
-o ~/.nouclip/output/final_short.mp4
```
---
## ๐Ÿ› ๏ธ CLI Command Reference
### 1. `auto` โ€” End-to-End Pipeline
```bash
nouclip auto <videoOrUrl> [options]
-r, --range <range> Time range e.g. "13:25-14:50"
-s, --start, --from <t> Start timestamp
-e, --end, --to <t> End timestamp
-d, --duration <t> Duration
-a, --aspect <ratio> Target aspect ratio (default: "9:16")
-m, --mode <mode> Framing mode: blur, center, pad, stretch
--blur Shortcut for --mode blur
--no-subtitles Do not generate or burn subtitles (clean reframed video only)
-l, --lang <lang> Whisper language (default: "id")
--style <preset> Subtitle style preset: "default", "hormozi", "storyteller", "cinematic"
--font-size <size> Subtitle font size (default: 60)
--silence-trim Auto-trim silent pauses (>0.6s) between words
--silence-gap <seconds> Silence threshold in seconds before trimming (default: 0.6)
--bgm <path> Background music track to mix with sidechain ducking
--bgm-volume <volume> BGM audio volume factor (default: 0.10)
--no-ducking Disable sidechain audio ducking
--draft, --no-burn Pause before burning for subtitle review
-o, --output <path> Output video path
```
### 2. `subtitle` โ€” Burn Subtitles & Audio Mixing
```bash
nouclip subtitle <video> [options]
--sub <assPath> ASS subtitle file to burn
--style <preset> Subtitle typography style preset
--font-size <size> Subtitle font size (default: 60)
--bgm <path> Background music track
--bgm-volume <volume> BGM audio volume factor (default: 0.10)
--no-ducking Disable sidechain audio ducking
-o, --output <path> Output MP4 path
```
### 3. `download` โ€” YouTube Downloader & Caching
```bash
nouclip download <url> [options]
-s, --start <time> Start timestamp
-e, --end <time> End timestamp
-o, --output <filename> Output filename template
--dir <directory> Download destination directory
--force Force re-download even if already cached
```
### 4. `cut` โ€” Fast Video Segment Clipping
```bash
nouclip cut <video> [options]
-r, --range <range> Time range e.g. "13:25-14:50"
-s, --start, --from <t> Start timestamp
-e, --end, --to <t> End timestamp
-d, --duration <t> Duration
-o, --output <path> Output MP4 path
--reencode Re-encode video with libx264 (default: false)
```
### 5. `crop` / `reframe` โ€” Aspect Ratio Converter
```bash
nouclip crop <video> [options]
-a, --aspect <ratio> Target aspect ratio (9:16, 1:1, 4:5, 16:9)
-m, --mode <mode> Framing style: blur, center, pad, stretch
--blur Shortcut for --mode blur
-o, --output <path> Output MP4 path
```
### 6. `extract` โ€” Audio & Whisper Transcription
```bash
nouclip extract <video> [options]
-l, --lang <lang> Language (default: "id")
-m, --model <model> Model name (default: "large-v3")
-o, --output <path> Output JSON path (default: ~/.nouclip/transcripts/)
```
### 7. `transcript` โ€” Format Converter
```bash
nouclip transcript <videoOrJson> [options]
-f, --format <format> Export format: txt, srt, vtt, json (default: txt)
-l, --lang <lang> Language (default: "id")
-o, --output <path> Output file path
```
---
## โš™๏ธ Environment Variables & Agent E2E Setup
- NouClip automatically loads configuration from `~/.nouclip/.env` (global) and `./.env` (local directory). Existing environment variables take precedence.
+ NouClip automatically loads configuration from `~/.nouclip/.env` (global) and `./.env` (local directory). Existing shell environment variables take precedence.
- ### Quick E2E Setup for Agents
- If setting up a fresh environment for NouClip, create the configuration file:
+ ### Minimal vs Optional Configuration
+ - **REQUIRED:** Only `NOUCLIP_OPENAI_AUDIO_URL` must be configured (pointing to your Whisper STT endpoint).
+ - **OPTIONAL:** Everything else works out-of-the-box using sensible defaults!
+ - `NOUCLIP_OPENAI_AUDIO_API_KEY` is **optional** (leave blank for local Whisper compute).
+ - All storage paths default cleanly to `~/.nouclip/`.
+ - LLM variables are **optional** (only used when extracting viral moments via LLM heuristics).
+ - Binaries (`ffmpeg`, `ffprobe`, `yt-dlp`) are auto-detected from system `$PATH`.
+ ### Quick Minimal Setup (Local Voice Compute)
```bash
mkdir -p ~/.nouclip
cat << 'EOF' > ~/.nouclip/.env
- # Whisper STT Engine (Local Voice Compute or Remote OpenAI/Groq)
+ # Required: Endpoint for Whisper STT
NOUCLIP_OPENAI_AUDIO_URL=http://localhost:8880
- NOUCLIP_OPENAI_AUDIO_API_KEY=
- NOUCLIP_OPENAI_AUDIO_MODEL=large-v3
-
- # Optional LLM Analysis Engine
- NOUCLIP_OPENAI_LLM_URL=https://api.openai.com/v1
- NOUCLIP_OPENAI_LLM_API_KEY=your_openai_api_key
- NOUCLIP_OPENAI_LLM_MODEL=gpt-4o-mini
EOF
```
### Complete Environment Variables Reference Table
- | Variable Name | Fallback Key | Default Value | Description |
- |---|---|---|---|
- | `NOUCLIP_WORKSPACE_DIR` | - | `~/.nouclip` | Root workspace for all cached artifacts & logs |
- | `NOUCLIP_DOWNLOAD_DIR` | - | `~/.nouclip/downloads` | Storage directory for downloaded videos |
- | `NOUCLIP_TRANSCRIPT_DIR` | - | `~/.nouclip/transcripts` | Storage for Whisper JSON & ASS subtitle scripts |
- | `NOUCLIP_SEGMENT_DIR` | - | `~/.nouclip/segments` | Storage for cropped segments & reframed intermediate MP4s |
- | `NOUCLIP_OUTPUT_DIR` | - | `~/.nouclip/output` | Destination for final rendered videos |
- | `NOUCLIP_OPENAI_AUDIO_URL` | `OPENAI_AUDIO_URL` | `http://localhost:8880` | Endpoint for Whisper STT `/v1/audio/transcriptions` |
- | `NOUCLIP_OPENAI_AUDIO_API_KEY` | `OPENAI_AUDIO_API_KEY` | *(empty)* | Bearer token / API key for Whisper endpoint |
- | `NOUCLIP_OPENAI_AUDIO_MODEL` | `OPENAI_AUDIO_MODEL` | `large-v3` | Whisper model name |
- | `NOUCLIP_OPENAI_LLM_URL` | `OPENAI_LLM_URL` | `https://api.openai.com/v1` | OpenAI-compatible endpoint for moment analysis |
- | `NOUCLIP_OPENAI_LLM_API_KEY` | `OPENAI_LLM_API_KEY` | *(empty)* | API key for LLM endpoint |
- | `NOUCLIP_OPENAI_LLM_MODEL` | `OPENAI_LLM_MODEL` | `gpt-4o-mini` | LLM model for heuristic moment extraction |
- | `NOUCLIP_FFMPEG_PATH` | `FFMPEG_PATH` | `ffmpeg` on PATH | Custom path to FFmpeg binary |
- | `NOUCLIP_FFPROBE_PATH` | `FFPROBE_PATH` | `ffprobe` on PATH | Custom path to FFprobe binary |
- | `NOUCLIP_YTDLP_PATH` | `YTDLP_PATH` | `yt-dlp` on PATH | Custom path to yt-dlp binary |
+ | Variable Name | Fallback Key | Requirement | Default Value | Description |
+ |---|---|---|---|---|
+ | `NOUCLIP_OPENAI_AUDIO_URL` | `OPENAI_AUDIO_URL` | **REQUIRED** | `http://localhost:8880` | Whisper STT endpoint (local or remote OpenAI/Groq) |
+ | `NOUCLIP_OPENAI_AUDIO_API_KEY` | `OPENAI_AUDIO_API_KEY` | **Optional** | *(empty)* | API Key for audio endpoint (not required for local compute) |
+ | `NOUCLIP_OPENAI_AUDIO_MODEL` | `OPENAI_AUDIO_MODEL` | **Optional** | `large-v3` | Whisper model identifier |
+ | `NOUCLIP_WORKSPACE_DIR` | - | **Optional** | `~/.nouclip` | Root workspace directory for all artifacts & caches |
+ | `NOUCLIP_DOWNLOAD_DIR` | - | **Optional** | `~/.nouclip/downloads` | Storage directory for cached downloaded videos |
+ | `NOUCLIP_TRANSCRIPT_DIR` | - | **Optional** | `~/.nouclip/transcripts` | Storage for Whisper JSON & ASS subtitle scripts |
+ | `NOUCLIP_SEGMENT_DIR` | - | **Optional** | `~/.nouclip/segments` | Storage for cropped segments & reframed MP4s |
+ | `NOUCLIP_OUTPUT_DIR` | - | **Optional** | `~/.nouclip/output` | Destination for final rendered videos |
+ | `NOUCLIP_OPENAI_LLM_URL` | `OPENAI_LLM_URL` | **Optional** | `https://api.openai.com/v1` | OpenAI-compatible endpoint for moment analysis |
+ | `NOUCLIP_OPENAI_LLM_API_KEY` | `OPENAI_LLM_API_KEY` | **Optional** | *(empty)* | API key for LLM analysis |
+ | `NOUCLIP_OPENAI_LLM_MODEL` | `OPENAI_LLM_MODEL` | **Optional** | `gpt-4o-mini` | LLM model name for moment heuristics |
+ | `NOUCLIP_FFMPEG_PATH` | `FFMPEG_PATH` | **Optional** | `ffmpeg` on PATH | Custom path to FFmpeg binary |
+ | `NOUCLIP_FFPROBE_PATH` | `FFPROBE_PATH` | **Optional** | `ffprobe` on PATH | Custom path to FFprobe binary |
+ | `NOUCLIP_YTDLP_PATH` | `YTDLP_PATH` | **Optional** | `yt-dlp` on PATH | Custom path to yt-dlp binary |