@quicktvui/ai-cli
v1.1.22
Published
CLI for installing and validating QuickTVUI AI skills
Readme
@quicktvui/ai-cli
QuickTVUI skill runtime CLI.
Install
npm install -g @quicktvui/ai-cli @quicktvui/ai-skillsStarting from @quicktvui/[email protected], global install/upgrade auto-runs
quicktvui-ai update to sync:
~/.agents/skills/quicktvui~/.gemini/GEMINI.mdbridge block~/.gemini/settings.jsoncontext file names
Set QUICKTVUI_AI_SKIP_POSTINSTALL=1 to disable auto-sync.
Commands
quicktvui-ai init
quicktvui-ai doctor
quicktvui-ai validate
quicktvui-ai update
quicktvui-ai create-project quick-tv-app
quicktvui-ai setup-vue-env --project ./quick-tv-app
quicktvui-ai setup-android-env --project ./quick-tv-app
quicktvui-ai setup-all-env --project ./quick-tv-app
quicktvui-ai run-dev --project ./quick-tv-app
quicktvui-ai run-esapp --project ./quick-tv-app --pkg es.hello.world
quicktvui-ai debug-targets --base-url http://127.0.0.1:38989
quicktvui-ai debug-events --client-id 192.168.1.10 --limit 100
quicktvui-ai debug-native-logs --client-id 192.168.1.10 --limit 100
quicktvui-ai debug-screenshot --client-id 192.168.1.10 --project ./quick-tv-app
quicktvui-ai plugin-create-project plugin/demo-plugin --package-name com.qtapp.plugin.demo
quicktvui-ai plugin-build plugin/demo-plugin
quicktvui-ai plugin-create-module --project plugin/demo-plugin --description "展示设备信息"
quicktvui-ai plugin-create-component --project plugin/demo-plugin --description "展示二维码"
quicktvui-ai plugin-enable-api --device <serial>
quicktvui-ai plugin-check --device <serial>
quicktvui-ai plugin-status --device <serial>
quicktvui-ai runtime-status --device <serial>
quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --file docs/plugin/armeabi-v7a.zip
quicktvui-ai plugin-upload-plugin --device <serial> --pkg eskit.plugin.imagequality --file docs/plugin/plugin-general-debug.apk
quicktvui-ai prompt --lang zh
# alias commands for create-project
quicktvui-ai-create-project quick-tv-app
quicktvui-aicreate-project quick-tv-appDefault install path
~/.agents/skills/quicktvui
Options
--dir <path>: custom skill path--project <path>: custom project root for rule checks--dest <path>: destination base directory forcreate-project--offline: use bundled template directly forcreate-project--skip-install: skip dependency install forcreate-project--strict: fail on doctor check issues--lang <code>: prompt language forpromptcommand (zhoren)--gemini-dir <path>: custom Gemini config directory (default~/.gemini, or$GEMINI_CLI_HOME/.gemini)--skip-gemini-config: skip updating Gemini bridge config duringinit/update--node-major <n>: target Node.js LTS major forsetup-vue-env(default20)--skip-node-install: skip Node.js install stage insetup-vue-env--force-node-install: force Node.js install stage insetup-vue-env--skip-yarn-install: skip yarn global install insetup-vue-env--skip-project-install: skip project dependency install insetup-vue-env--auto-emulator <true|false>: deprecated (Google emulator auto-download flow removed)--adb-path <path>: custom adb path/command (or use envQUICKTVUI_ADB_PATH)--device-ip <ip[:port]>: preferred real device endpoint foradb connect--device <serial>: explicit target adb serial forsetup-android-env/run-esapp--allow-non-tv-device <true|false>: allow phone/tablet target in multi-device mode (defaultfalse)--avd-name <name>: deprecated (Google AVD flow removed)--headless: deprecated (Google AVD flow removed)--runtime-version <version>: pin runtime version for hub-first download mode--runtime-channel <release|debug>: choose fallback channel when hub download fails (defaultrelease, auto-fallback todebugwhen release metadata is pending/unavailable)--runtime-url <url>: use custom runtime apk url (skip hub/fallback metadata resolution)--server-host <ip>: override debug server host IP--force-runtime-install: force reinstall runtime--skip-runtime-setup: skip runtime setup insetup-android-env/run-dev--auto-load-local-bundle <true|false>: auto trigger runtime to load local bundle inrun-dev--port <n>: dev server port used byrun-devauto load (default38989)--skip-env-check: skip environment stage inrun-dev--base-url <url>: ESDebugServer base URL fordebug-*commands (defaulthttp://127.0.0.1:38989)--plugin-base-url <url>: explicit plugin server base URL override forplugin-*commands- If
--plugin-base-urlis omitted, plugin commands first try the adb-connected device service URL; if the host cannot be inferred or no adb device is connected, provide the service address explicitly (for examplehttp://192.168.1.100:36366) - Plugin server endpoints are POST-only; the same paths may return
404forGET --mode <create|update>: mode forplugin-create-project--template-repo <url>: custom plugin template repo forplugin-create-project--package-name <pkg>: Java package name for plugin project/module/component generation--workspace-root <path>: workspace root used to injectbuild:android-plugin--description <text>: feature description forplugin-create-module/plugin-create-component--class-name <name>: explicit generated class name for plugin module/component--view-class-name <name>: explicit View class name forplugin-create-component--view-base-class <name>: Android base View class forplugin-create-component--methods <json|csv>: exported module method list forplugin-create-module--props <json|csv>: component prop list forplugin-create-component--events <json|csv>: component event list forplugin-create-component--functions <json|csv>: component function list forplugin-create-component--register <true|false>: whether to patchApplication#onCreateregistration (defaulttrue)--app-file <path>: explicit Application source file to patch--src-root <path>: explicit Android source root such asapp/src/main/java--docs-dir <path>: explicitdocs/componentoutput directory--native-tag-name <name>: explicit kebab-case native tag for generated component--wrapper-tag-name <name>: explicit kebab-case wrapper tag for generated component--client-id <id>: target clientId fordebug-context/debug-events/debug-native-logs/debug-screenshot--hash <hash>: optional target hash fordebug-targets/debug-context/debug-native-logs--limit <n>: result limit fordebug-events/debug-native-logs--kind <kind>: event kind filter fordebug-events--since-seq <n>: sinceSeq filter fordebug-events--refresh <true|false>: refresh native logs before reading (defaulttrue)--output <path>: output file path fordebug-screenshot--include-data <true|false>: include base64 screenshot payload indebug-screenshotoutput--timeout-ms <n>: request timeout fordebug-*commands (default15000)--runtime-package <pkg>: runtime package forrun-esapp(defaultcom.extscreen.runtime)--esapp-uri <uri>: raw launch URI (esapp://)--esapp-query <json>: extra query params JSON merged in structured mode--pkg --ver --min-ver --repository --uri --from --args --exp --flags --use-latest: structuredesapp://action/startparams--enabled <true|false>: value forplugin-enable-api(defaulttrue)--abi <abi>: target ABI forplugin-upload-so(default: read fromro.product.cpu.abi)--file <path>: local zip/apk file forplugin-upload-soorplugin-upload-plugin--file-name <name>: override multipart upload filename for plugin uploads
Typical flow
quicktvui-ai init
quicktvui-ai doctorThen reload your AI agent so it rescans local skills.
init/update also auto-maintains Gemini global context files:
- updates
~/.gemini/GEMINI.mdwith QuickTVUI@.../SKILL.mdbridge block - ensures
~/.gemini/settings.jsoncontainscontext.fileNameentries:GEMINI.md,AGENTS.md,SKILL.md,CONTEXT.md
Create project with network fallback
quicktvui-ai create-project quick-tv-appThis command:
- Tries to clone
quicktvui-templatefrom GitHub. - Falls back to the bundled local template if clone fails.
- Updates
package.json(name,version). - Ensures
@quicktvui/aiexists indevDependencies. - Installs dependencies (
yarn install, ornpm installfallback).
Configure Android env (device + runtime)
quicktvui-ai setup-android-env --project ./quick-tv-appThis command:
- Detects Android SDK root (auto creates a default SDK root when missing).
- Detects Android SDK/adb tools.
@quicktvui/ai-clidoes not bundle adb. - Device selection rule:
- if only one device is connected, skip TV/phone distinction
- if multiple devices are connected, classify TV-like vs phone/tablet and require target serial selection
- emulator is treated as TV-like device
- In non-interactive mode, requires explicit
--device <serial>when adb devices are connected. - If sdkmanager/avdmanager is missing, it auto-downloads and installs official Android Command-line Tools.
- If adb is missing, it auto-installs
platform-tools(with size estimate + sdkmanager progress). - If no connected device exists, it asks for real-device IP and runs
adb connect. - If still no device exists, it stops and asks user to manually install/start emulator (recommended: https://mumu.163.com) or connect device first.
- In multi-device mode, non-TV target requires confirmation (or
--allow-non-tv-device true). - Installs runtime APK (hub first, then gitee/github fallback with SHA256 verification) and configures debug server host.
- If runtime already exists, asks whether to reinstall runtime before run.
- Launches runtime app and waits it enters running state.
Configure Vue env (Node + package manager)
quicktvui-ai setup-vue-env --project ./quick-tv-appThis command:
- Ensures Node.js LTS (macOS/Windows auto install).
- Ensures
yarnis installed globally. - Installs project dependencies (
yarn installornpm installfallback).
Configure All Dev Envs
quicktvui-ai setup-all-env --project ./quick-tv-appThis command runs setup-vue-env and setup-android-env sequentially.
Run development server
quicktvui-ai run-dev --project ./quick-tv-appThis command:
- Runs
setup-android-envby default. - Starts project dev script (
yarn dev,pnpm dev, ornpm run dev). - Waits for local server port (default
38989) and auto triggers runtime to load local bundle. - Supports
run-esappstructured options (--pkg/--ver/--repository/...) or--esapp-urito override auto launch URI. - If you need to confirm whether the quick app really loaded successfully or whether runtime reported an error, run
quicktvui-ai runtime-status --device <serial>.
Run ES app by protocol
# structured mode (recommended for AI)
quicktvui-ai run-esapp --project ./quick-tv-app --pkg es.hello.world --from cmd
# local dev bundle
quicktvui-ai run-esapp --project ./quick-tv-app --pkg es.hello.world --uri 192.168.1.10:38989
# remote repository + pinned version
quicktvui-ai run-esapp --project ./quick-tv-app --pkg liulipeng/com.zoo --ver 1.0.0 --repository http://repo.quicktvui.com/repository/rpk
# raw URI passthrough (full compatibility)
quicktvui-ai run-esapp --esapp-uri 'esapp://action/start?from=cmd&pkg=es.hello.world&uri=assets://hello.rpk'Full protocol reference: docs/esapp-protocol.md
After run-esapp, if you need to confirm whether launch succeeded or inspect the latest runtime-side load error, run:
quicktvui-ai runtime-status --device <serial>Read runtime debug data without MCP
If MCP is unavailable but ESDebugServer is already running, AI can still read debug data directly through quicktvui-ai.
quicktvui-ai debug-targets --base-url http://127.0.0.1:38989
quicktvui-ai debug-context --client-id <clientId>
quicktvui-ai debug-events --client-id <clientId> --limit 100
quicktvui-ai debug-native-logs --client-id <clientId> --limit 100
quicktvui-ai debug-screenshot --client-id <clientId> --project ./quick-tv-appNotes:
debug-targetsreturns the current/ai/targetslist fromESDebugServer.debug-eventsreads recent unified runtime events (console / exception / network / screenshot / native-log).debug-native-logsreads Android native logs for the selected target.debug-screenshotsaves the latest screenshot to<project>/.quicktvui-ai/debug-screenshots/by default and prints the saved file path.
Debug TV plugin server without MCP
If the AI needs to inspect or upload plugin assets on TV and only CLI execution is available, use this order:
quicktvui-ai plugin-enable-api --device <serial>
quicktvui-ai plugin-check --device <serial>
quicktvui-ai plugin-status --device <serial>
quicktvui-ai runtime-status --device <serial>
quicktvui-ai plugin-upload-so --device <serial> --tag eskit.so.ffmpeg.command --pkg eskit.so.ffmpeg.command --file docs/plugin/armeabi-v7a.zip
quicktvui-ai plugin-upload-plugin --device <serial> --pkg eskit.plugin.imagequality --file docs/plugin/plugin-general-debug.apk
quicktvui-ai plugin-delete-so --device <serial> --pkg eskit.so.ffmpeg.command --abi armeabi-v7a
quicktvui-ai plugin-delete-plugin --device <serial> --pkg eskit.plugin.imagequality
quicktvui-ai plugin-server-ui --device <serial>Notes:
plugin-enable-apisends Toolkit broadcasteskit.sdk.core.ACTION_TOOLKIT_SETTINGwithRESTFUL_API=true.plugin-checktreatsuploadSo/uploadPlugin/deleteSo/deletePluginreturning400missing-parameter errors as expected health signals.plugin-statusreturns the full/statusview, including runtime-loaded state (installedSoList/installedPluginList), uploaded records (uploadedSoList/uploadedPluginList), and compatible legacy fields.runtime-statusalso reads/status, but surfacesdata.rpkLoadStatusfirst and falls back todata.loadStatusfor recent load state and latest error messages after quick app/plugin load.plugin-delete-so/plugin-delete-plugincan delete one uploaded record or clear all records with--pkg all; deleting currently loaded bytes may still require a host/runtime restart to take effect.plugin-server-uistarts a local HTML dashboard for status, upload, delete, and clear actions without needing handwritten curl commands.plugin-upload-soauto-detectsro.product.cpu.abifrom the selected device when--abiis omitted.- If the selected device host cannot be inferred, the CLI will ask for the service address in interactive mode; if you leave it blank, the command stops. In non-interactive mode, pass
--plugin-base-urlexplicitly. /api/v1/hello//api/v1/status//api/v1/uploadSo//api/v1/uploadPlugin//api/v1/deleteSo//api/v1/deletePluginall usePOST; do not useGETto probe them.- Default test identifiers are
eskit.so.ffmpeg.commandandeskit.plugin.imagequality. - Plugin-related TV validation requires runtime
>= v2.9.1585; if the detected runtime on the selected TV is lower, ask whether to uninstall and reinstall runtime before continuing.
Scaffold Android plugin projects/modules/components
Use this workflow when AI needs to create or package Android plugin code without manually editing every file:
quicktvui-ai plugin-create-project plugin/demo-plugin \
--workspace-root . \
--package-name com.qtapp.plugin.demo
quicktvui-ai plugin-build plugin/demo-plugin
quicktvui-ai plugin-create-module \
--project plugin/demo-plugin \
--description "展示设备信息" \
--methods "showInfo,getInfo"
quicktvui-ai plugin-create-component \
--project plugin/demo-plugin \
--description "展示二维码" \
--props '[{"name":"content","type":"String","description":"二维码内容"}]' \
--events onRendered \
--functions refreshNotes:
plugin-create-projectwrites.kyy-plugin-project.jsonand injectsbuild:android-pluginwhen the plugin lives under a workspace subdirectory.- For long-lived or releasable plugins, prefer a visible root path such as
plugin/demo-plugin; do not default plugin projects to hidden directories like.ai-test/*. plugin-builduses fixed priority:build:android-plugin->build:plugin->build->./gradlew assembleGeneralDebug.plugin-create-modulegenerates code againstcom.quicktvui.sdk.base.module.IEsModule.plugin-create-componentgenerates code againstcom.quicktvui.sdk.base.component.IEsComponent/IEsComponentView, createsdocs/component/<kebab-name>.md, and keeps tags in kebab-case.
Generate LLM install prompt
quicktvui-ai prompt --lang zhInstaller scripts
scripts/install(bash)scripts/install.ps1(PowerShell)
