mcpField
Z
ziniao-staff

ziniao-staff

github.com/ziniao-openOther85.0k installsUpdated 8w ago
Repository

About ziniao-staff

ziniao-staff is a CLI skill for employee administration with ziniao-cli. It provides commands for searching, creating, updating, changing employee status, and transferring departments, with readable filters and enum mappings.

Key features

  1. 01Filter employee listings
  2. 02Create and update employees
  3. 03Enable, disable, or remove employees
  4. 04Transfer employees between departments
  5. 05Map enums to readable options

Use cases

  1. 01Find employees by name, role, or department
  2. 02Create an employee with login settings
  3. 03Disable multiple employees
  4. 04Move an employee to another department

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ziniao-open/skills --skill ziniao-staff

After installing, type/ziniao-staffin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
ziniao-staff-create.md
ziniao-staff-enable-disable.md
ziniao-staff-list.md

Details

From the project README

员工管理

CRITICAL — 开始前 MUST 先用 Read 工具读取 ../ziniao-shared/SKILL.md,其中包含认证、错误处理和安全规则 CRITICAL — 所有 Shortcuts 在执行之前,务必先用 Read 工具读取其对应的 references/ 说明文档,禁止直接盲目调用命令。

核心场景

查询员工

支持多种筛选条件,枚举值已映射为人类可读。注意:默认返回包含已删除员工,取 ID 做后续操作时建议加 --status active。

ziniao-cli staff list --name "张三" --status active --format table
ziniao-cli staff list --role boss --page-all
ziniao-cli staff list --department-id 15868464646076
创建员工

原始 API 需要 20+ 字段的嵌套 JSON,CLI 简化为核心 flag + 智能默认值(--department-id 必填):

ziniao-cli staff create --username "zhangsan" --name "张三" --password "Pass123!" --role-id 16691047257645 --department-id 15868464646076

智能默认值:authDevide=1(全设备授权)、authClient=全部允许、isLimitLogin=0。 登录日期默认发送有效日期:loginLimitStartDate=今天、loginLimitEndDate=2099-12-31,也可通过 --login-start-date / --login-end-date 指定。

启用/禁用/删除

原始 API 是一个接口通过 status 字段区分,CLI 拆为 3 个语义化命令:

ziniao-cli staff enable --id 16524289555087
ziniao-cli staff disable --id "id1,id2,id3"   # 支持批量
ziniao-cli staff remove --id 16524289555087    # high-risk-write

枚举映射

flag可选值对应 API 值
--statusactive / disabled / deleteddelflag: 0/1/2
--roleboss / manager / employee / adminlevel: 0/1/2/3
--device-authauto / first / approve / phoneauthDevide: 1/2/3/4
--allow-clientswindows,mac,web,android,ios,linux,miniapp 或 allauthClient 嵌套对象

Shortcuts

命令说明详细文档
staff list查询员工列表references/ziniao-staff-list.md
staff create新增员工references/ziniao-staff-create.md
staff update修改员工只发修改字段:--id xxx --name "新名",底层路径 /superbrowser/rest/v2/erp/staff/modify
staff enable启用员工references/ziniao-staff-enable-disable.md
staff disable禁用员工同上
staff remove删除员工high-risk-write
staff transfer调岗--staff-id xxx --department-id yyy

通用 api 覆盖

ziniao-cli api /superbrowser/rest/v1/erp/staff/list --data '{"page":1,"limit":10}'
ziniao-cli api /superbrowser/rest/v2/erp/staff/add --data '{...}'
ziniao-cli api /superbrowser/rest/v2/erp/staff/modify --data '{...}'
ziniao-cli api /superbrowser/rest/v1/erp/staff/status --data '{"staffIds":["xxx"],"status":"1"}'
ziniao-cli api /superbrowser/rest/v1/erp/staff/department --data '{"staffIds":["xxx"],"departmentIds":["yyy"]}'

Comments

Markdown supported