feat: add sonilo-cli package and context7.json - #10
Merged
Conversation
Sapient docs evalsWaiting for the staging docs URL before running evals. Sapient will start the selected PR evals automatically when GitHub reports a successful docs deployment for this PR. This usually happens within 15 minutes. Commit: |
…nilo 0.5.x The 0.5.0 SDK release adds these two endpoints and the CLI's `sonilo>=0.4,<0.5` pin excluded it, making the packages unresolvable together. Widen the pin and wire up both commands, being careful that unset --no-ducking/--preserve-speech forward None (not False) so the server's default-ON ducking isn't silently disabled.
…and the free trial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports sonilo-js PR #12 to Python: a new
sonilo-clipackage plus a repo-rootcontext7.json. Rebased onsonilo0.5.0, so it also covers the new combined-soundtrack endpoints.What is
sonilo-clifor?A command-line wrapper around the
soniloSDK, so you can generate music and SFX from the terminal without writing Python. Instead of a script:you run:
sonilo text-to-music --prompt "warm lo-fi piano" --duration 30Useful for quick demos, shell/CI/cron automation, and non-programmers. It's a thin layer — all capability comes from the SDK; the CLI only translates flags into SDK calls (hence zero third-party dependencies, stdlib
argparseonly).What is
context7.jsonfor?Context7 is a service that feeds up-to-date library docs to AI coding assistants so they stop hallucinating stale/wrong APIs.
context7.jsonis the library-author config we hand Context7: which folders to skip when indexing, plus a set of agent-facing rules (read the key fromSONILO_API_KEY; text-to-sfx/video-to-sfx are always async; result URLs are short-lived presigned links — don't send the auth header; which error types to catch). Once the repo is registered on Context7, anyone using an AI assistant to write Sonilo code gets our own accurate guidance instead of a guess.What's included
sonilo-clipackage (bin:sonilo) wrapping the SDK:account,usage,text-to-music,video-to-music,text-to-sfx,video-to-sfx,video-to-sound,video-to-video-sound,tasks get/tasks wait. Auth viaSONILO_API_KEYor--api-key. Async-only options (--format wav,--isolate-vocals,--preserve-speech) submit + poll automatically instead of streaming. Zero third-party deps (stdlibargparse).video-to-sound(mixed audio, defaultoutput.wav) andvideo-to-video-sound(source video with audio muxed in, defaultoutput.mp4). Both take--music-prompt/--sfx-prompt,--preserve-speech,--no-ducking, and a repeatable--stem music|music_processed|sfxthat saves the individual layers next to the combined output (--output soundtrack.wav→soundtrack.music.m4a).context7.jsonat the repo root — folder exclusions plus Python-flavored agent rules, including the new sound endpoints, the ducking tri-state gotcha, stem semantics, and the free trial.ci.ymlinstalls and tests all three packages; newpublish-cli.ymlmirrors the video-kit OIDC trusted-publishing workflow (tag prefixsonilo-cli-v*).Note on
duckingduckingis default-ON server-side, andbuild_v2s_partsonly emits a boolean when it isn'tNone. The CLI therefore forwardsNonewhen--no-duckingis absent andFalseonly when it's passed — forwarding a plainstore_truedefault ofFalsewould have silently disabled the server default. Same tri-state forpreserve_speech. Both directions are covered by tests that assert the field is absent from the form body when the flag is unset, not merely that it's false.Dependency pin
sonilo-clipinssonilo>=0.5,<0.6. The original>=0.4,<0.5excluded 0.5.0 and would have reproduced theResolutionImpossiblethatsonilo-video-kitjust hit and fixed by widening to<0.6.Not included — needs the account owner
sonilo-cli: for a brand-new project name, a PyPI Trusted Publisher must be configured forsonilo-clibefore the first tag push, or the publish step fails. That's a PyPI org-settings action.context7.jsonis ready, but claiming the library at context7.com requires signing in there.Test plan
pytest sonilo-cli→ 28 passedpytest(SDK) → 167 passed;pytest sonilo-video-kit→ 52 passed (no regression)sonilo0.5.0taskssubcommand,--video+--video-urltogether — all exit 1 with a one-linesonilo:messageaccountandusage --days 7return real data;text-to-music --duration 5→ valid 5.06s MP4/M4A (streaming path);text-to-sfx --duration 2→ valid 2.04s 16-bit/44.1kHz WAV (async submit → poll → presigned download). Billing confirmed to apply the documented minimums (5s music + 2s sfx billed as 10s + 3s).video-to-sound/video-to-video-soundnot live-tested (respx-stubbed only) — same submit/poll/download code paths as the tested commands