beervid-cli
v0.1.9
Published
Zero-dependency CLI for the Beervid Open API
Downloads
791
Maintainers
Readme
Beervid CLI
First-pass zero-dependency CLI for the Beervid Open API.
Positioning
This CLI targets the Beervid product-side API surface used for video generation, templates, publish strategies, and library workflows.
It is not the same thing as the Beervid third-party application Open API:
- Use this CLI when you want broad internal/product capabilities such as
labels,templates,video create,video tasks,video list,publish strategy, andraw. - Use a separate third-party/Open API tool when your primary goal is TT/TTS OAuth onboarding or app-facing publish flows.
Quick Start
node ./bin/beervid.js auth set-key YOUR_API_KEY
node ./bin/beervid.js auth test
node ./bin/beervid.js auth check
node ./bin/beervid.js auth profile
node ./bin/beervid.js accounts list
node ./bin/beervid.js labels list
node ./bin/beervid.js templates list
node ./bin/beervid.js templates get --id template_xxx
node ./bin/beervid.js video upload --path ./assets/cover.jpg --type image
node ./bin/beervid.js video create --file ./examples/video-create.json
node ./bin/beervid.js video tasks get --task-id task_xxx
node ./bin/beervid.js video tasks watch --task-id task_xxx
node ./bin/beervid.js video list
node ./bin/beervid.js video publish --file ./examples/video-publish.json
node ./bin/beervid.js video data get --id video_xxx
node ./bin/beervid.js publish strategy list
node ./bin/beervid.js publish products --creator-user-open-id creator_open_id_xxx
node ./bin/beervid.js publish strategy create --file ./examples/publish-strategy-template.json
node ./bin/beervid.js publish strategy enable --id strategy_xxx
node ./bin/beervid.js publish strategy get --id strategy_xxx
node ./bin/beervid.js publish strategy delete --id strategy_xxx
node ./bin/beervid.js publish recordsInstall
Install from npm:
npm install -g beervid-cli
beervid --help
beervid-cli --helpOr run it without installing globally:
npx beervid-cli --help
npx beervid-cli auth set-key YOUR_API_KEY
npx beervid-cli auth testPublished binary names:
beervidbeervid-cli
Install from the local repo while iterating:
npm link
beervid --helpDevelopment
Current code layout:
src/commands/contains command-family handlerssrc/workflows/contains multi-step command orchestrationsrc/core.jscontains pure normalization and status helperssrc/help.jscontains shared CLI help text
Local helper tests:
npm test
npm run test:helpersExample File Guidance
These example files are ready to use as-is for request shape testing:
examples/video-create.jsonexamples/video-create-lg-c5-16s.jsonexamples/video-create-lg-c5-16s-single-fragment.jsonexamples/video-create-lg-c5-16s-user-request.jsonexamples/video-create-lg-c5-verbatim-user-prompt.jsonexamples/video-create-xiaomi-sora-15s-verbatim-user-prompt.jsonexamples/video-list.jsonexamples/publish-records.json
These files are editable templates and require you to replace placeholder values before sending them to the API:
examples/video-publish.jsonexamples/publish-products.jsonexamples/publish-strategy-template.json
For examples/publish-strategy-template.json, the bundled date is intentionally set to a valid far-future value so the CLI's local validation still passes before you replace the account and template placeholders.
Cookbook
Check auth and account access
node ./bin/beervid.js auth set-key YOUR_API_KEY
node ./bin/beervid.js auth test
node ./bin/beervid.js auth profile
node ./bin/beervid.js accounts list
node ./bin/beervid.js accounts shoppableGenerate a video from local JSON and watch it finish
node ./bin/beervid.js video create --file ./examples/video-create.json
node ./bin/beervid.js video tasks watch --task-id task_xxx
node ./bin/beervid.js video list --current 1 --size 5If you want the CLI to do the create-and-watch flow in one command:
node ./bin/beervid.js video run --file ./examples/video-create.jsonIf you intentionally submit a single-fragment veo 16-second request, confirm that the user really wants two internal 8-second chapters:
node ./bin/beervid.js video create --file ./examples/video-create-lg-c5-16s-single-fragment.json --confirm-veo-two-8s
node ./bin/beervid.js video run --file ./examples/video-create-lg-c5-16s-single-fragment.json --confirm-veo-two-8sFor real generation workloads, the platform commonly needs about 5-10 minutes. Prefer waiting about 5 minutes before the first status query instead of polling immediately:
node ./bin/beervid.js video tasks watch --task-id task_xxx --initial-wait 300
node ./bin/beervid.js video run --file ./examples/video-create.json --initial-wait 300Upload local or remote assets before create
node ./bin/beervid.js video upload --path ./assets/cover.jpg --type image
node ./bin/beervid.js video upload --path ./assets/music.mp3 --type audioFor video create and video run, local paths and http/https asset URLs inside the payload are auto-uploaded before submit.
Inspect labels and templates before building a payload
node ./bin/beervid.js labels list
node ./bin/beervid.js templates list
node ./bin/beervid.js templates get --id template_xxxCreate, enable, and inspect a publish strategy
# Replace __REPLACE_WITH_...__ placeholders in the template first.
node ./bin/beervid.js publish strategy create --file ./examples/publish-strategy-template.json
node ./bin/beervid.js publish strategy enable --id strategy_xxx
node ./bin/beervid.js publish strategy get --id strategy_xxx
node ./bin/beervid.js publish recordsIf you want the CLI to create and enable in one pass:
# Replace __REPLACE_WITH_...__ placeholders in the template first.
node ./bin/beervid.js publish run --file ./examples/publish-strategy-template.jsonDebug an endpoint that is not wrapped yet
node ./bin/beervid.js raw get /templates/options
node ./bin/beervid.js raw post /send-records/list --file ./examples/publish-records.jsonVideo Create Rules
- In this system,
techType: "veo"corresponds to the cinematic style path, andtechType: "sora",sora_azure,sora_h_pro, andsora_aiocorrespond to the realistic style path. - If the user explicitly selected a style, the submitted payload and user-facing explanations should stay aligned with that mapping. Do not describe a
veorequest as写实, and do not describe asorarequest as电影. techType: "veo"means the cinematic model. In eachfragmentListitem,segmentCountmaps to duration:1=8s,2=16s,3=24s,4=32s.- A single-fragment
veorequest withsegmentCount: 2does not mean one native 16-second take. It means two internal 8-second chapters in one fragment, so the CLI now requires explicit confirmation via--confirm-veo-two-8s. techType: "sora",sora_azure,sora_h_pro, andsora_aiouse the SORA family rules and the realistic style path. Each request must use exactly one fragment, and that fragment corresponds to one 15-second generation.fragmentList.lengthmatches the number of UI chapters or scenes. Two 8-second VEO scenes should be modeled as two fragment objects withsegmentCount: 1each.videoScalecontrols aspect ratio and accepts9:16or16:9.portraitImagesis VEO-only, allows at most 1 image, and requiresuseCoverFrame: truewhenvideoScaleis9:16.productReferenceImagesallows at most 3 images for VEO and at most 1 image for each SORA-family fragment.nineGridImagesallows at most 9 images for each SORA-family fragment, andnineGridImagesplusproductReferenceImagesmust either both be provided or both be empty.spliceMethod: "LONG_TAKE"is not allowed for SORA-family fragments or for VEO fragments whensegmentCountis1.fragmentList[].videoContentis treated as verbatim user input. The CLI must not rewrite, translate, trim, summarize, or otherwise alter the user's prompt text before submission.- Real generation commonly takes around 5-10 minutes, so a delayed first poll such as
--initial-wait 300is recommended forvideo tasks watchandvideo run.
Notes
video createaccepts raw open-API request bodies plus olderformData/requestwrappers and normalizes them before sending.video createandvideo runwill auto-upload both local file paths and remotehttp/httpsURLs found inproductReferenceImages,nineGridImages,portraitImages,bgmList,headVideo, andendVideo, then replace them with the returnedfileUrlbefore submitting the task.headVideoandendVideocorrespond to the cover/opening video and ending video in the product UI flow, so they follow the same upload-then-submit behavior as product images, portrait images, and BGM.video publishaccepts eitherbusinessIdor the olderaccountIdalias and maps it to the open API shape.publish strategy createaccepts the raw open-API request body plus the olderstrategyCreateDTOwrapper.video createandvideo runnow validatetechType,fragmentList,segmentCount, andspliceMethodbefore sending the request.video uploadsends multipart form data, requires--pathplus--type image|video|audio, and checks extension/size limits before upload.video tasks getqueries the task list endpoint and matches bytask_id.video tasks watchpolls until the task reaches a terminal state.video listqueries the video library and should be treated as the final source of generated videos.publish strategy enableandpublish strategy disablenow call the documented toggle API with an explicitenableboolean, so they are safe to run repeatedly.
