PTENES
music + cover + video, in phases

A sentence goes in. Out comes music, cover, and video β€” with you approving each part.

The plan for all three parts is written before a single cent is spent. You read it, adjust whatever you want, approve each part individually β€” and only then generate. The cover and clip are free through Agnes; only the music uses credits.

Musician rehearsing, amber light β€” musicavideo project cover
What it is

Planning is cheap. Execution is expensive.

Asking a generic agent to "make a song about X" gives you a random track, a cover that doesn't fit it, and no clip. The three come out disconnected because there was never a shared plan. Here, the plan is the product.

πŸ“‹ The plan comes first

A plano.json with a closed schema decides the song structure, cover concept, and video breakdown together β€” using a style database measured from real material (BPM, key, instrumentation, vocal type).

🚦 Gate for each part

Each part has its own cycle: ver β†’ ajusta β†’ ok β†’ faz. You can stop after approving the cover and come back three days later β€” the estado.json pick up where you left off.

πŸ”Œ The engine is data, not code

Pluggable provider using the adapter pattern + models.json declarative. Without a key, it appears unavailable with the reason β€” never runs over during generation. Switching is a flag.

How it works

Four phases, and only one of them costs money

Research is opt-in. The plan is free. Execution happens one part at a time, with the estimated cost shown before any call. Delivery is automatic when all three are ready.

research (opt-in)→ plan→ ok→ does→ PACOTE.md

πŸ”Ž Phase 0 β€” research

Only with --pesquisa. It goes to the web to find niche references and see whether the topic has traction; it becomes pesquisa.md and is included as context for the planner. Never overwrites what you requested.

πŸ“ Phase 1 β€” plan

Zero media API cost. It comes plano.json (the contract) and PLANO.md (for you to read). The lyrics can be yours: like draft, it finishes and shows the diff; like final, is law and not even the adjuster touches it.

πŸŽ›οΈ Phase 2 β€” execution

faz only runs what was approved. A provider failure doesn’t bring down the run: that part becomes erro with the message, and the others continue (exit 2).

planned→ OK → approved→ does → generating→ ready| error
Prerequisites

The distro's Python and ffmpeg. That's all.

Zero pip dependencies: everything uses the standard library. Keys are read at runtime from .env authorized and never copied into the repo.

System

python3 (3.10+) e ffmpeg, used to concatenate the clip's shots.

# Debian/Ubuntu
sudo apt install ffmpeg

Cover art and clip β€” free

AGNES_API_KEY provides images and video at zero cost. It’s the default for both parts and the reason it runs on any VPS.

# read at runtime from:
~/projetos/openpcbotv2/.env

Music β€” the paid part

KIE_API_KEY (Suno v4.5), ~US$ 0,08 per generation β€” which already includes two tracks.

# read at runtime from:
~/projetos/wifi/.env
User guide Β· step by step

From raw text to a ready-to-use package

Real commands. The normal path uses the approval gate; there's a shortcut without the gate at the end for when you trust the plan.

1

Install

Clone and go β€” no build or pip install.

git clone https://github.com/inematds/musicavideo.git && cd musicavideo
2

Plan (costs nothing)

Free-form text request. The plan for all three parts is generated together, and the PLANO.md appears on screen.

bash musicavideo.sh plano "mΓΊsica de virada, rock feminino, sobre quem constrΓ³i em silΓͺncio e agora cobra"
3

Read each part

With no argument, it shows the full plan. With a part specified, it shows only that section β€” style and lyrics, cover concept and prompt, or the shot-by-shot breakdown.

bash musicavideo.sh ver agora-eu-cobro           # the entire plan
bash musicavideo.sh ver agora-eu-cobro clipe     # just the shot breakdown
4

Adjust what didn't turn out well

Replan just that part and prints a diff of what changed. As many times as you like β€” nothing has been generated yet.

bash musicavideo.sh ajusta agora-eu-cobro musica "mais lento, e o refrΓ£o sobe uma oitava"
5

Approve β€” the gate

Part without ok doesn’t generate. Approving one doesn’t approve the others.

bash musicavideo.sh ok agora-eu-cobro musica
6

Generate (this is where it costs)

Shows the estimated cost for each part and the total before before calling any API. Without that part, everything approved runs. --sim skips confirmation.

bash musicavideo.sh faz agora-eu-cobro musica
# estimated cost:
#   music   US$ 0.0800  (kie:suno-v4.5)
#   total    US$ 0.0800
# confirm? [s/N]
7

Bring your own lyrics

As a draft, the planner finishes and shows the diff. With --letra-final, the lyrics are passed through verbatim and no one changes them β€” not even ajusta.

bash musicavideo.sh plano "sertanejo" --letra rascunho.txt
bash musicavideo.sh plano "sertanejo" --letra final.txt --letra-final
8

No approval gate, with spending lock

Plan, approve all three, and execute. The limit keeps you from overspending: whatever fits gets completed; the rest remains approved and resumes with faz.

bash musicavideo.sh tudo "balada pop sobre recomeΓ§o" --teto 2 --sim
9

Switch engines

The engine lives in the plan, never in the code. The flag overrides it in plano, ajusta or faz.

bash musicavideo.sh faz agora-eu-cobro clipe --motor clipe=kling:kling-2.5
10

Browse the collection

Each slug becomes a row in the index.jsonl, rewritten with every state change. The collection grows with each use and feeds its own planner.

bash musicavideo.sh lista 10
bash musicavideo.sh busca "rock"
bash musicavideo.sh custo agora-eu-cobro   # estimated vs. spent
From disk to the web

The finished clip doesn't end on your machine

There are two panels, and that's intentional. The local dashboard is the workbench: where you listen, compare, send things to the trashβ€”and where you approves what comes out of the machine. A showcase is what the public sees. Uploading isn’t a consequence of being finished: production-ready work is working material.

πŸŽ›οΈ The dashboard, always up

A systemd service keeps the workbench running from boot on the local network. Going offline because you forgot to run the command is the bug, not the cost savings.

systemctl --user enable --now musicavideo-painel

☁️ Approve with one click, publish with one command

O publica-hf uploads only what changed, it writes the manifesto to the showcase repo and commits β€” publishing ends with the push, not halfway through.

bash musicavideo.sh publica-hf
# 0 productions if nothing changed

πŸ“Ί Hosting that costs nothing

The files live in a public dataset on Hugging Face, which serves range request β€” the video bar navigates directly, with no proxy or paid storage. The showcase only reads the manifest.

bash musicavideo.sh likes   # the audience's β™₯ comes back
Engines

Free by default, paid by choice

The cover and clip defaults intentionally cost US$ 0 β€” that's what lets the project run on any VPS without an account anywhere.

🎡 Music

kie:suno-v4.5 β€” ~US$ 0,08 per generation, provides 2 tracks. The only paid part today.

πŸ–ΌοΈ Cover

agnes:agnes-image-2.1-flash β€” US$ 0. Alternative: inemaimg:flux2-klein, local server on the DGX.

🎬 Clip

agnes:agnes-video-v2.0 β€” US$ 0, shots concatenated with ffmpeg. Paid alternatives: kling:kling-2.5 e fal:kling-video-v2.5-turbo-pro.

Adding a provider takes two files: providers/<nome>.py implementing disponivel/estimar_custo/gerar, e providers/<nome>.models.json declaring models, cost, and accepted params. Nothing else in the project changes.

# output for one slug
~/projetos/output/musicavideo/<slug>/
β”œβ”€β”€ plano.json      # the contract
β”œβ”€β”€ PLANO.md        # the same plan, for you to read and approve
β”œβ”€β”€ estado.json     # source of truth: stages, cost, errors, history
β”œβ”€β”€ faixa.mp3  capa.png  clipe.mp4
β”œβ”€β”€ PACOTE.md       # delivery (complete or partial, with what's missing)
└── raw/            # raw provider responses
Roadmap

Where it is and what's next

The core is complete and tested. What's missing is broader provider support and clip finishing.

ready
Complete corePer-part approval gate, resumable state machine, fixed contract, cost estimate before spending, limit, searchable collection, and delivery in PACOTE.md.
ready
Agnes and Kie testedCover art and clip generated for free by Agnes; music by Suno via Kie.
to test
Kling and falAdapters are written and covered by contract tests, but have not yet been exercised against the real API.
after
Clip post-productionToday, the shots are concatenated without grading or mixing with the track. Matching the clip and music to the beat is the natural next step.
after
Add as a skillO plano.json is a closed contract precisely so other projects can consume it without knowing how it was made.