Nagellabs 开源 libi:面向编码智能体的 AI 视频工作室
Nagellabs/libi
Nagellabs 发布开源 AI 视频工作室 libi,把视频当作代码处理,每一帧都是绘制到 canvas 的 JavaScript 函数,编码智能体可像写软件一样编写和修改视频。
An AI video studio for coding agents.
npx @nagellabs/libi — or download the desktop app for macOS or Windows.
libi treats video as code. Every frame is a JavaScript function drawing to a canvas, so an AI coding agent — the most capable form of AI available today — can write, edit and refine a video the same way it writes software. You describe what you want in chat; the agent builds the scenes, generates or imports the assets, adds voiceover and music, and you watch it come together in a live preview.
Everything libi can do is one local MCP endpoint (http://127.0.0.1:3457/mcp) — its own
tools plus every generation MCP you enable — so the in-app agent and your own CLI see
exactly the same tools. libi uses port 3457 when free (falling back to the studio port + 1,
then any free port); the live port is in <LIBI_HOME>/mcp-port and on the Settings card,
and if it ever moves, re-run libi connect to update the registration.
- Chat with Claude Code or Codex. libi drives them over ACP and hands them video tools over MCP.
- Canvas scenes + layered overlays — text, images, video, code and 3D, each with its own timing, position and z-order.
- Real editing tools — timeline, audio mixer with ducking, object tracking, background removal, video analysis.
- Bring any MCP server. Generate clips, voiceover, music or sound effects through fal.ai, ElevenLabs, YouTube download, or anything you connect yourself.
- Fast exports. A trim is a stream copy; overlays composite in a single ffmpeg pass; anything else renders through WebCodecs.
- Post and measure, without leaving the app. Send a finished piece straight to Instagram or TikTok, schedule it, and see how every post and ad is doing — social posting is built in.
- Local-first. Your media, database and generated assets stay on your machine in
~/.libi/.
libi is in beta. It moves fast and has rough edges. Please tell us about the ones you hit.
Social posting, built in
Finish a video and put it in front of your audience from the same window. libi's social posting is part of the app, and part of the chat:
- Compose once, post anywhere it fits. Instagram (Reel, Feed, Story) and TikTok from a piece's Posting tab: caption, accounts and timing in one place. libi checks the video against each platform's limits before anything goes out.
- Schedule it. Post now, or pick the day and time it goes out.
- Let your agent do it. Ask in chat — "post this as a Reel tomorrow at 9" — and the agent prepares the post for you to review. It can also reach Facebook, X and YouTube.
- See how it did. Every post, with its status and numbers, on the Social page, plus read-only reporting for your ads.
Works through the posting provider you choose. libi is built to plug into social posting providers rather than lock you into one; Zernio is the provider supported today. You connect it once in your browser — libi never sees a password or API key, and your posts, media and metrics stay with your provider. libi itself only remembers which provider you picked and which post belongs to which piece.
Posting is included in libi at no charge. The posting provider is a separate service with its own plans (Zernio has a free allowance for small setups), so check its pricing when you connect accounts.
Requirements
- Node.js 20.9+ (only for the npm package — the desktop app bundles its own runtime)
- A CLI coding agent you're already signed in to — Claude Code or Codex. libi installs the adapters it needs; you bring the account.
- ~1 GB of free disk for what libi downloads as you use it. First launch fetches only ffmpeg/ffprobe; the agent adapter arrives when you set up your agent, and the Chromium used for rendering, object tracking and background removal come down the first time you use them.
- macOS or Windows — Linux support is coming. The Windows installer is not code-signed yet, so Windows will warn on first launch; see below.
Run libi
Desktop app
Download the build for your platform (macOS .dmg / .zip, Windows .exe) from the
Releases page and launch it. Nothing else to
install. Linux desktop builds are coming in a future release.
On Windows, the installer is not code-signed yet. SmartScreen will say "Windows protected your PC" — choose More info → Run anyway. Code signing is on the way; until it lands, the npm route below is unaffected and needs no such dismissal.
The desktop app updates its own runtime from npm: when a new version ships, Settings → General offers to install it, and it takes effect on the next restart. Most releases are runtime-only and arrive this way, so the newest entry on the Releases page is often older than the version you are running — that is expected, and it is not a sign you are behind. A new download only appears when the desktop shell itself changes.
npm
npx @nagellabs/libi
It opens http://localhost:3456 in your browser once the server is up. If nothing appears — over SSH, in a container, on a machine with no desktop — the URL is printed in the terminal; open it yourself.
Today this is tested on macOS — that's where we build and use libi daily. Broader platform support is on the way.
The first launch sets up ~/.libi/ and downloads the binaries and models libi needs — this
takes a few minutes and prints its progress. Every launch after that is fast. If setup
fails, it says why and exits rather than starting a half-working app.
Useful flags and environment variables:
npx @nagellabs/libi --port 4000 |
Serve on a different port (default 3456) |
npx @nagellabs/libi connect [dir] [--global] |
Use libi from your own CLI. Registers libi's MCP endpoint for your whole Claude Code and Codex account, and installs libi's skills in that folder (or, with --global, for every folder). libi records the install and keeps the skills current on its own. Codex is found on your PATH or, on macOS, inside the ChatGPT / Codex desktop app — the app's own MCP list picks it up after a restart. libi must be running — any way you run it, including the desktop app. |
npx @nagellabs/libi --no-open |
Don't launch a browser — just print the URL (also LIBI_OPEN=0) |
LIBI_HOME=/path/to/dir |
Move the data directory somewhere other than ~/.libi |
LIBI_MCP_PORT=3500 |
Serve libi's MCP endpoint somewhere other than 3457 (set it before connect) |
LIBI_DEBUG=1 |
Verbose MCP transport logging |
Run from source
If you'd rather run the checkout directly (developed and tested on macOS):
git clone https://github.com/Nagellabs/libi.git cd libi npm install npm run dev # http://localhost:3456 npm run dev:electron # …and the desktop shell
Always start libi through npm run dev (i.e. node bin/libi.js), never next dev. The
CLI runs an install-and-probe phase before Next.js boots (ffmpeg/ffprobe, the data directory,
the ports); skipping it leaves the studio half-wired and the agent's tools failing.
npm test # unit + integration (Vitest) npm run test:e2e # end-to-end (Playwright) npm run test:electron # desktop end-to-end npm run lint npm run db:generate # regenerate the Drizzle migration after a schema change
Logs land in ~/.libi/logs/ — server.log for Next.js output, libi.log for structured
application events (tail -f ~/.libi/logs/libi.log | jq).
Conventions, architecture notes and the rules the codebase is held to live in
AGENTS.md.
How it fits together
Claude Code / Codex (subprocess)
│ ACP over stdio
▼
Next.js server ── AgentProcessManager · SessionManager · JobManager
│ stdio
▼
MCP server ── libi.* tools (pieces, scenes, overlays, audio, files, ffmpeg, tracking…)
▼
~/.libi/ ── SQLite · media storage · logs · bundled binaries
A piece holds a composition: canvas scenes (agent-written draw functions) plus a track of timed, layered overlays and audio clips. The same renderer drives the preview and the canvas export path, so what you see is what you get. Agent actions write the composition, the server pushes an event, and the editor re-renders — there is no hidden local state.
Built on Next.js 16, React 19, Electron, SQLite + Drizzle, Tailwind v4, ffmpeg, WebCodecs (mediabunny), and the Agent Client Protocol + Model Context Protocol SDKs.
Privacy
Everything you make stays on your machine. libi sends two kinds of telemetry, both switchable off in Settings → Privacy, and both disabled automatically when you run from a cloned repo:
- Crash and error reports (Sentry) — stack traces and surrounding logs so we can fix
what broke. No user identity, no IP addresses, no request bodies; credential-shaped keys
and values are scrubbed before anything leaves the machine. Turn it off and no report is
sent at all — the toggle takes effect immediately, no restart.
LIBI_SENTRY_DISABLED=1is a hard kill-switch that overrides everything. - Product analytics (GA4) — bounded, enumerated events like "a piece was created", keyed to a random per-install id. Never file names, prompts, or anything you typed.
Connecting a posting provider is the one place libi holds a credential of yours: the OAuth
token from a browser sign-in you complete, kept in your OS keychain (or a private 0600 file
under npx), never in the database and never in an API response. Revoke it in libi or at
the provider. It is separate from your agent's own sign-in to that provider, and libi never
reads that one.
Full details: privacy policy.
Contributing
Pull requests are not being accepted right now — libi is still in beta. The architecture is moving fast and large parts of it are still settling, so I can't give outside PRs the review they deserve, and I'd rather not leave anyone sitting on a branch that goes stale underneath them. PRs opened against this repository will be closed without review. I'll announce here and in CONTRIBUTING.md when that changes.
Issues, on the other hand, are very welcome and genuinely appreciated. Bug reports, crashes, reproductions, feature requests and any rough edge you hit while actually using libi are the most useful thing you can send us right now. We read them, and we'll do our best to address them.
- Open an issue — the fastest route, and public so others benefit
- A reproduction (steps, and a log excerpt from
~/.libi/logs/libi.log) makes a report dramatically more actionable - Can't reach the tracker? Email support@nagellabs.com — no GitHub account needed
- Anything security-sensitive: admin@nagellabs.com, not a public issue — see SECURITY.md for the disclosure process and threat model
License
libi is free and open source under GPL-3.0-only. See SECURITY.md for the security policy and how to report a vulnerability.
Use it for anything, personal or commercial. Modify it, fork it, run it however you like. If you distribute a modified version, ship its source under GPL as well. The videos you make with libi are yours — the license covers libi's code, not your output.
The editor is free forever; an optional paid membership adds cloud services on top (team sharing, backup, managed model usage) and never gates anything already in the box. See LICENSING.md for the plain-English version, and THIRD-PARTY-NOTICES.md for the notices of every production dependency the packaged app redistributes.
Copyright © 2026 Nadav Nagel.
来源:GitHub · github.com