Marketing one-click finished video uses an independent public API, orchestrated server-side for creation. Story ads, brand films, and influencer带货 are expressed through the user's natural language instructions, without fabricating mode、template and other parameters. Ordinary model direct output, canvas editing, and short drama creation should use their respective existing Skills; do not replace marketing finished video with a single ordinary video generation.
Setup
Requires Node.js 16+ and support for marketing command @pippit-dev/cli. The script location is "{baseDir}/scripts/marketing.js"; the relative paths in the examples below are executed from this Skill directory. First check pippit-tool-cli marketing --help; if the command does not exist, install or update the CLI:npm install -g @pippit-dev/cli@latest, then check again; if still unsupported, report a version blocker, and do not switch to asking the user for a key.
When the host calls pippit-tool-cli install / update , silently append the optional --source HOSTaccording to the trusted runtime environment; when directly running the npm global installation, set PIPPIT_CLI_SOURCE。HOST in that command environment to a placeholder for the real host identifier, not a fixed platform, and omit it if unknown, without asking the user. Installation/update writes this value to host_platform, preserving the original source and operating system platform; the server must support the new field to count it in statistics. If the old command version does not support this parameter, omit it, and do not reinstall repeatedly for statistics; scripts that only install the CLI internally follow the original no-reporting behavior.
Marketing API calls reuse the login state of other CLI commands; the script does not read or export credentials. Before executing a real request, run pippit-tool-cli status, and read the JSON's logged_in; do not rely only on the exit code. When not logged in or credentials have expired, run pippit-tool-cli login, let the user complete authorization in the browser; after waiting for the CLI to return successfully, check status again, then continue the original task. If a valid login state already exists, reuse it directly without logging in again; offline preview and help do not require login.
Do not let the user provide or copy access_token, Access Key, and do not write credentials into chat, request files, command parameters, or logs. The CLI retains the original XYQ_ACCESS_KEY explicit environment override rule, which takes precedence over web login; this is only for configured automation environments and is not a required field for ordinary users. When the override is invalid, do not silently switch accounts. When web login credentials are rejected, handle it according to the CLI's login --force process, and do not automatically resubmit a generation task that may already have been created.
First follow the API contract to prepare the request; when a complete execution example is needed, read product image to marketing video。
Workflow
- Confirm the marketing content and product materials the user wants to generate. Preserve the user's original instructions, and do not proactively expand or add selling points that were not provided. Only queries, integration consultations, or estimates do not submit generation; an explicit generation request can be executed without repeatedly asking for authorization already given. Ask for necessary supplementary information using the host's currently allowed
request_user_input_async、request_user_inputorask_user_question, and use ordinary chat when no tool is available. - When there are local product materials, upload them one by one and keep the returned
data.pippit_asset_id. For remote materials, first obtain the user's authorization to use the local file; do not put URLs or paths intoasset_ids. If the user has already provided a valid asset ID, reuse it directly. Pure text requests without materials do not require upload. - Write a UTF-8 JSON request file.
messagePreserve the user's instructions;general_agent_settings.video_modelRequired, cannot be passed{}. When the user specifies a model, use it as-is; when unspecified, ask, or select within the range the user has explicitly authorized such as "you decide" and explain. Set other options according to the user's given or authorized preferences; do not silently switch models.thread_idOnly pass the real ID when continuing an existing marketing session. - Preview and validate first; after generation authorization is obtained, use
--executeto submit. Immediately save the response and display the realdata.web_thread_link, and keepdata.run.thread_id、data.run.run_id. When the web link is missing, only report the actual returned information; do not construct links yourself. - Use the current thread/run to query until completion and download media. When encountering a confirmation or questionnaire, continue using existing authorization; only ask the user when a necessary choice is missing. After confirmation, continue the same thread and obtain the latest run_id before querying again: an old Run may remain in a waiting-for-interaction state indefinitely. The returned web link can be viewed through the host browser; you can also use
pippit-tool-cli'sget-thread --thread-id THREAD_IDto read the real ID of each Run. Do not use an old Run to repeatedly confirm or regenerate. A successful submission, web link, or progress link does not mean delivery is complete.
node scripts/marketing.js upload --file /path/to/product.png
node scripts/marketing.js generate --request /path/to/marketing-request.json --dry-run
node scripts/marketing.js generate --request /path/to/marketing-request.json --execute
node scripts/marketing.js query --thread-id THREAD_ID --run-id RUN_ID --wait --max-wait 900 --output-dir /path/to/results
node scripts/marketing.js balance
Generation defaults to offline preview; preview does not require login. Upload, query, and balance are actual API requests.--timeout Set the total time limit for a single request (seconds, default 60).--wait is queried by the script every 10 seconds, with a default maximum of 900 seconds; do not stack other pollers. When there is no --wait , query only once. The script outputs line-by-line JSON; before querying and downloading, first output the server response, then output each downloaded file one by one, and finally output the response containing downloaded_files .
Source Attribution
Only marketing generation commands (marketing generate or marketing.js generate) silently append the optional --source, which the CLI maps to the request body platform, and it is not written into the creative text or request file. For Doubao Office, fill in doubao_office, for WorkBuddy fill in workbuddy, for Codex fill in codex; for other hosts, use a real stable identifier from a trusted environment, omit it if unknown, and do not ask the user. Do not attach version, session ID, user information, or prompt. Leading and trailing whitespace is removed; omit if not passed or empty; this applies to both the first generation and continued submissions in the same session. Upload, query, download, and balance do not append it. If an old CLI does not support it, omit it; do not resubmit the task for source statistics.
Prefer to confirm the real host from the host's system identity, the current tool runtime environment, and explicit platform metadata, and proactively fill in --sourceon each submission; do not skip it merely because the field is optional. When an explicit value is missing, the CLI tries PIPPIT_CLI_SOURCE and verified host runtime markers in order. Report only the stable platform name, not the session ID in the marker; if the source conflicts or still cannot be confirmed, omit it, do not ask the user, and do not scan login credentials or installation directories. An explicit --source "" disables automatic attribution for that instance.
Completion and Recovery
retis a string or number0is API business success. Querydata.run_state: 1/2/7 means submitted or in progress; 8 means the program was interrupted (possibly waiting for a tool callback), continue querying within the time limit; 3 means this round is complete; 4/5 means failed/canceled; 6/9 means waiting for user interaction. A single in-progress query with exit code 0 cannot be treated as generation completion.- Exit code 4: 6=
InputRequired,9=HITL_Interrupt(manual interaction interruption, the terminal state of the current Run). Output the raw response,run_state_name、action_required=trueand the next-step explanation, and stop polling immediately. 9 does not mean the video failed or completed; after handling the confirmation in the same session, query the latest Run. - Exit code 5: unknown or unspecified status. Preserve the original response and task ID, stop automatic polling and diagnose, do not resubmit generation.
- Exit code 2: generation failed, was cancelled, or succeeded but produced no video. Display
fail_reasonor "task succeeded but returned no video", do not fabricate artifacts, do not automatically resubmit. When successful but only images are present, the original response still contains image links, which can be faithfully delivered as partial artifacts. - Exit code 3: wait budget exhausted. Preserve the task ID and last status; you may continue waiting with the same query command. Network errors, abnormal status formats, business errors, or parameter errors exit with code 1; diagnose first, do not automatically resubmit generation. A submission timeout may have already created a task; when there is no ID, report that the result is unclear, first check the official website task or contact support to verify
log_id。 - When download fails, the original response and records of already downloaded files have been output; you can re-query with the same ID. The script only creates new files and does not overwrite existing results; downloads do not carry API authentication headers. The production API always uses
https://xyq.jianying.com, and does not follow redirects for authenticated requests. - Check that local media can be opened, and that content type and duration match the delivery; a successful download only proves that bytes were obtained, and does not mean creative quality has been accepted. Display each final video/image through the host's attachment or media preview capability, with URL/path as supplementary. If the current host cannot display attachments, clearly state this and provide available local files or download links.
Scope
This Skill only uses official public marketing interfaces; it does not claim to support team space switching. The authentication scope follows the current CLI login identity and server-side authorization; public requests have no TeamID field, do not add team fields yourself or reuse assets/task IDs across accounts. Immersive short films and Volcano Engine services are outside the scope of this script.