
Luna is a local web app for downloading video and audio from YouTube, Instagram, and TikTok, organizing files in Workspace, and turning long videos into short clips with AI. Downloads need no API keys and run straight on your machine. For AI Short Clips, Luna works completely offline using YouTube captions and local scoring (Local (No API Key) + Auto (YouTube Captions First)), or connects to cloud models (Gemini, OpenAI-compatible chat models, Groq Whisper, ElevenLabs Scribe) and renders vertical or widescreen clips locally with FFmpeg.
Click here to see more previews
Edit downloaded videos on a multi-block timeline with Auto Cut Silence, 2D Speed Curve, aspect ratio reframing, color looks, Smart Audio, and multi-layer music.
Browse your local library by platform or mode, search titles and captions, and keep YouTube, Audio MP3, Video Trimmer, and AI Short Clips in separate workspaces.
Review source video metadata, AI pipeline steps, and virality-ranked clip cards on one canvas, then download clips in bulk or open any clip directly in Studio.
Git is not needed for the quick installers. Both put Luna in %USERPROFILE%\Luna on Windows (~/Luna on macOS and Linux), set up uv, Python 3.12, dependencies, FFmpeg if missing, and a default .env, then open Luna at http://localhost:8000. Nothing is installed system-wide except uv.
Prefer to inspect before running or isolate Luna from your host files? Read install.ps1 / install.sh first, clone a tagged release, or use Docker.
irm https://raw.githubusercontent.com/miqdadbadjuber/luna/main/install.ps1 | iexThis adds a Luna shortcut to the Desktop and Start Menu. Start Luna later by double-clicking that shortcut with no terminal needed.
curl -fsSL https://raw.githubusercontent.com/miqdadbadjuber/luna/main/install.sh | shStart Luna again later with ./start.sh.
If you cloned the repository, run the local installer once inside the clone folder.
On Windows PowerShell (PowerShell blocks .ps1 files by default):
powershell -ExecutionPolicy Bypass -File .\install.ps1| You see | What to do |
|---|---|
start.bat is not recognized |
PowerShell does not run files from the current folder. Type .\start.bat, or double-click the file. |
Luna is not installed yet. Run install.ps1 first. |
This folder has no .venv yet. Run the install command above in the same folder. |
running scripts is disabled on this system |
Use the powershell -ExecutionPolicy Bypass -File .\install.ps1 form. |
On macOS and Linux:
./install.shCreate a Python 3.12+ virtual environment, install FFmpeg and FFprobe, then run:
pip install -r requirements.txt
cp .env.example .env
python -m lunanpm run dev and npm start in package.json only wrap those Python commands. Node is optional, not a required toolchain.
Docker replaces the local Python and FFmpeg install. Create these host files first so Compose does not create root-owned directories:
cp .env.example .env
touch cookies.txt
mkdir -p output media-vaultOn Linux, also export your host user IDs so the container can write to them:
export LUNA_UID=$(id -u) LUNA_GID=$(id -g)Then start Luna:
docker compose up -d --build # production mode
docker compose -f compose.yaml -f compose.dev.yaml up --build # development, reloads on saveInside a container, the Settings folder picker and Open Folder button cannot reach your desktop. Open media-vault/ on the host instead, because Compose fixes MEDIA_STORAGE_DIR to the mounted volume.
Open Settings > Updates > Check for Updates to check and apply updates directly inside Luna (with expandable release notes). It works for both Git clones and archive installs, installs updated dependencies when requirements.txt changes, restarts the server in place in the same terminal, and keeps your .env, cookies.txt, and media untouched.
You can also update from a terminal by re-running the install command above, or running git pull followed by install.ps1 or ./install.sh when dependencies change.
| Feature | API keys | What it does |
|---|---|---|
| Video & MP3 download | None | Downloads video or 320 kbps MP3 from YouTube, TikTok, and Instagram |
| AI Short Clips | Optional (Zero-API offline default, or Gemini / OpenAI-compatible + Groq / ElevenLabs) | Picks viral moments and renders 9:16, 1:1, 3:4, or 16:9 clips (3-15 clips, Auto or Custom duration) with Face Track, Dual Split, Gaming Split, and Screencast Blur |
| Full Video Studio | None | Non-destructive NLE for downloaded videos: multi-block timeline cuts, Auto Cut Silence, 2D Speed Curve, aspect ratio reframing, 6 Looks + Adjust, Smart Audio, multi-layer audio, and GPU-accelerated export |
| AI Clipper Studio | None | Edits AI-generated clips locally with 6 subtitle styles (Selene, Amber Karaoke, Crisp Clean, Pill Box, Condensed Impact, Word Focus), subtitle translation, Check Frame preview, background music slice picker, Multi-Ratio batch export, and non-destructive MP4 export |
| Manual Video Trimmer | None | Cuts exact timestamp ranges (1-20 segments) without AI |
| Workspace | None | Organizes, previews, searches, bulk-selects, renames, and manages local downloads and clips |
| Interface & Settings | None | Full Light and Dark themes, Side Navigation (default drawer with Recent Workspaces) or Top Pill Bar, 6-tab Settings modal with interactive Media Storage donut breakdown, and Dark Studio background presets (Default Dark + static/motion presets) |
| Local Whisper transcription | None for transcription | Install requirements-whisper.txt and set LOCAL_TRANSCRIBE_PROVIDER=whisper |
| Cookies for restricted videos | None | Optional upload in Settings for age- or login-gated sources (cookies.txt) |
API keys are optional even for AI Short Clips thanks to Zero-API offline scoring and YouTube caption extraction. Add cloud keys in Settings > AI Providers only when you want LLM ranking or cloud transcription (OpenAI-compatible auto-loads available chat models from any base URL); only the audio or transcript needed for clipping is sent to your chosen provider, and you should never commit .env or cookies.txt.
luna/mcp_server.py lets an MCP client such as Claude Code start clip jobs, follow progress, and collect the rendered clips. Install requirements-mcp.txt, then register it:
claude mcp add luna -e LUNA_URL=http://127.0.0.1:8000 -- /path/to/luna/.venv/bin/python /path/to/luna/luna/mcp_server.pySee MCP.md for the tools, running Luna on another machine, and a simulated session.
luna/ web app: API, storage, Workspace, templates, assets
luna/clipper/ clip pipeline, under its own MIT license
tests/ unittest suite
Python code reloads on save with python -m luna, and luna/templates/*.html is read on every request. Set MEDIA_STORAGE_DIR=media-vault in .env to keep test downloads separate from your real library. .python-version pins CI to Python 3.12.
pip install -r requirements-dev.txt
python -m unittest discover -vLuna collects zero telemetry and binds to 127.0.0.1 by default, with Host header allowlisting (anti DNS rebinding), cross-origin CSRF rejection, SSRF URL filtering, masked API keys, and Zip Slip checks on updates (covered by tests/test_security.py). API keys and cookies.txt are optional and stay local on your machine.
Because Luna has no built-in authentication and its API can change settings and manage Workspace files, keep it on 127.0.0.1. If you host it remotely, put an authenticating reverse proxy in front of it and add the proxy hostname to LUNA_ALLOWED_HOSTS in .env. Run a single process, because job state is held in memory. See SECURITY.md for the full threat model, outbound connections list, and vulnerability reporting.
Without Docker, launch with .\start.bat, ./start.sh, or npm start. With Docker, pushing a v* tag publishes ghcr.io/miqdadbadjuber/luna (amd64 only); run it with LUNA_IMAGE=ghcr.io/miqdadbadjuber/luna:<tag> docker compose up -d --no-build after creating the host mounts above.
Do I need API keys to download videos? No. Video downloads, 320 kbps MP3 extraction, and Manual Video Trimmer work with zero API keys.
Which AI providers are supported?
Fresh setups support Zero-API offline clipping out of the box (Local (No API Key) for scoring + Auto (YouTube Captions First) for captions). When cloud keys are configured, Luna supports Gemini (3.8/3.7/3.6/3.5) or any OpenAI-compatible endpoint (auto-loading /models dynamically), and transcription via Groq Whisper, ElevenLabs Scribe, Gemini, or local Faster-Whisper. All provider, theme, and navigation layout preferences persist in .env.
Where are my files stored?
Temporary downloads go to output/. Workspace uses MEDIA_STORAGE_DIR when set, defaulting to D:\Luna-Media on Windows and output/ on macOS and Linux.
What if port 8000 is already in use?
Luna picks the next free port and prints it. Set LUNA_PORT if you want to pin a specific port.
What about cookies and copyright?
Cookies are optional and sensitive, so never share or commit cookies.txt. Platform changes can affect yt-dlp, and you are responsible for having the rights to any videos you download, cut, and publish.
Luna is built and maintained by:
|
Miqdad Badjuber @miqdadbadjuber
|
Fajar Hidayat @fajarhide
|
Want to contribute? Open an issue for bugs or ideas, or read CONTRIBUTING.md before sending a pull request.
Luna is licensed under AGPL-3.0-or-later. Copyright (C) 2026 Miqdad Badjuber. You may run, modify, and distribute it, provided you share source under the same license and keep copyright and license notices intact.
luna/clipper/ keeps its upstream MIT License at luna/clipper/LICENSE for the original clip-pipeline files (highlights.py, fast_http.py, local_scorer.py, and text_boundaries.py are Luna original code under AGPL-3.0-or-later); see THIRD_PARTY_NOTICES.md for full attribution. Commercial licensing without AGPL terms is available on request through the repository issue tracker.



