mcpField
H
hap-cli

hap-cli

github.com/mingdaocomProductivity13153 installsUpdated 5w ago
Repository

About hap-cli

A usage guide for hap-cli, a command-line interface to HAP enterprise platform functions. It covers areas from contacts and work sheets to workflows and permissions, and emphasizes checking the live command guide before operating.

Key features

  1. 01Access to contacts and departments
  2. 02Chat, groups, and activity operations
  3. 03Read and write work sheet records
  4. 04Manage workflows and approvals
  5. 05Inspect commands with hap guide

Use cases

  1. 01Looking up available hap commands
  2. 02Updating work sheet records carefully
  3. 03Managing organization tasks from the command line

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/mingdaocom/hap-skills --skill hap-cli

After installing, type/hap-cliin Claude Code to confirm it loaded.

Details

From the project README

hap-cli 使用导航

hap-cli(命令 hap)把 HAP 企业平台的后端能力封装成命令行,覆盖: 通讯录与部门、聊天消息与群组、动态、日程、工作表记录读写、视图与字段、 工作流与审批待办、自定义页面、角色权限、组织与应用管理、文件上传与分享。

第一步:确认 hap 已安装

hap --version

有版本号输出就跳到下一步。 报 command not found 就先装:

pip install hap-cli

装完再跑一次 hap --version 确认。如果 pip 装成功但 hap 仍然找不到,说明它被装进了 不在 PATH 上的 Python 环境,改用 python3 -m pip install --user hap-cli,或用 python3 -m hap_cli 代替 hap 调用。

装好后登录:

hap auth login          # 明道云 SaaS,会打开浏览器
hap auth whoami         # 确认登录成功、当前组织正确

私有部署、多环境多账号、组织与默认应用的设置,见下一步的 hap guide setup。

第二步:每次动手前先跑 hap guide

hap guide

它会给出当前这台机器上这一版 hap 的完整命令地图、可用的细分主题,以及最常踩的坑。 命令地图是现场生成的,永远和实际能跑的命令一致。

需要具体某方面的细节,按 hap guide 输出里列出的主题深入,例如写记录的取值格式、 登录与环境管理、从消息触达记录、什么时候该转交其它 skill。

铁律

不要凭记忆拼命令名或参数。

hap-cli 会自动升级,命令和参数会变。任何时候都以这两个为准:

  • hap guide —— 能做什么、该走哪条路
  • hap <命令> --help —— 这个命令的确切参数

写数据尤其要小心:不同字段类型的取值格式差别很大,而且传错基本不会报错, 服务端照样返回成功但数据是坏的。动手前先看 hap guide 里的记录写入主题, 写完读回确认。

Comments

Markdown supported