fz-lyle/dsh-deveco-cli

DevEco CLI将DevEco Studio工具链统一封装为一个CLI,内置ohpm、hvigor、hdc、emulator、hilog,同时集成HarmonyOS技能安装、项目脚手架、本地HarmonyOS文档检索和MCP服务。

Project Overview项目介绍

DevEco CLI is a unified command line entry for HarmonyOS application development, and it is also distributed as a native DeepSeek Harness plugin. It wraps the DevEco Studio toolchain into a single CLI, with built-in access to tools like ohpm, hvigor, hdc, emulator, and hilog. It supports scaffolding HarmonyOS projects, searching and reading local HarmonyOS documentation, running MCP services, and integrating with AI agents. As a native DSH plugin, it registers a structured deveco_cli tool that DSH agents can call with JSON parameters. Before installation, users need to make sure they have Node.js 22 or higher installed on their system, along with required DevEco toolchain matching their system. For DSH users, installing the plugin is as simple as running two commands to add the plugin and launch DSH web interface.

The standard workflow for independent use starts with installing the CLI globally via npm, then creating a new HarmonyOS app with the devecocli create command. After navigating into the new project directory, developers can build the app, start an emulator, and filter error logs with simple, consistent commands. AI agent users can initialize DevEco CLI skills for supported agents like OpenCode and AtomCode, then configure MCP for their local project with the devecocli init command. On Windows, users working with OpenCode are recommended to set PowerShell 7 as their default terminal to avoid common exit issues after running build commands. This tool is built for HarmonyOS developers who prefer working from the command line or use AI agents to assist with their daily development work.

DevEco CLI is released under the open source MIT license, so it is free to use for both personal and commercial projects. It supports all three major desktop platforms: macOS, Windows, and Linux, but there are a few platform-specific requirements users need to note. On macOS, DevEco Studio must be installed to either ~/Applications or /Applications directory for auto-detection to work. On Linux, DevEco Studio is not supported, so users must install the DevEco Command Line Tools to use the CLI. Non-default installation paths can be specified via environment variables, which also supports switching between multiple installed versions of the DevEco toolchain. Users can update the CLI to the latest version at any time by running the devecocli update command after initial installation.

这是面向HarmonyOS应用开发的统一命令行工具,同时打包为DeepSeek Harness原生插件。它将DevEco Studio工具链统一封装为CLI,内置ohpm、hvigor、hdc、emulator、hilog等开发工具,支持HarmonyOS项目脚手架生成、本地开发文档检索,还为多种AI智能体提供技能集成入口,作为DSH原生插件会注册deveco_cli工具供Agent结构化调用。

典型工作流从创建项目开始,开发者安装后可通过devecocli create快速生成应用脚手架,进入项目目录后可执行编译、启动模拟器、查看错误日志等操作,也支持检索和阅读本地HarmonyOS开发文档。它还支持为OpenCode、AtomCode等多种AI智能体初始化技能,为当前HarmonyOS项目配置MCP服务。对于HarmonyOS开发者来说,它既可以独立作为命令行开发入口,也能为AI辅助开发提供工具支持。

本工具要求Node.js 22及以上版本,支持macOS、Windows、Linux平台,需要提前安装DevEco Studio 6.0.0及以上版本或对应版本的Command Line Tools,非默认安装路径可通过环境变量指定工具链根。工具采用MIT许可协议开源,免费供个人和商业使用,首次使用前需要通过npm全局安装,Linux平台必须安装Command Line Tools才能正常使用。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin add @ah-plugins/dsh-deveco-cli

把 fz-lyle/dsh-deveco-cli 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

DevEco CLI

一个面向 HarmonyOS 应用开发的统一命令行入口。

NPM Version NPM Downloads Node.js Platform DevEco Studio Command Line Tools License

DevEco CLI 将 DevEco Studio 工具链统一封装为一个 CLI,内置 ohpm、hvigor、hdc、emulator、hilog,同时集成 HarmonyOS 技能安装、项目脚手架、本地 HarmonyOS 文档检索和 MCP 服务。

关于数据采集与隐私(遥测打点内容、存储加密、上报及关闭方式),请参阅 PRIVACY.md。

快速开始

前置要求

  • 操作系统为 macOS 、 Windows 或 Linux(需配置对应环境变量)
  • 安装Node.js,推荐使用22及以上版本
  • DevEco Studio >= 6.0.0 或 Command Line Tools >= 26.0.0
    • macOS:必须安装在 ~/Applications 或 /Applications 目录下。

安装

npm install -g @ah-plugins/dsh-deveco-cli@latest

安装后可以通过以下命令更新到最新版本:

devecocli update

最短工作流

devecocli create --app-name MyApp
cd MyApp
devecocli run
devecocli log --level E

文档检索

devecocli docs search List
devecocli docs read harmonyos-guides/application-models/arkts-page-start-overview

更多命令和参数可通过 devecocli --help 或各子命令的 --help 查看。

环境变量

devecocli 当需要使用非默认安装路径、多版本并存时固定选型,Command Line Tools或在Linux下运行时,可通过以下环境变量显式指定工具链根:

名称 说明
DEVECO_CLI_STUDIO_PATH 显式指定 DevEco Studio 安装根,优先级最高
DEVECO_CLI_CLT_PATH 显式指定 Command Line Tools 安装根

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-background-plugin 下一个 Next dsh-cost →