ziniao-department

Original🇨🇳 Chinese
Translated

Ziniao Department Management: Query, create, modify, delete, and sort departments. Used when users need to view the organizational structure, create/modify/delete departments, or adjust department sorting.

1installs
Added on

NPX Install

npx skill4agent add ziniao-open/skills ziniao-department

SKILL.md Content (Chinese)

View Translation Comparison →

Department Management

CRITICAL — MUST use the Read tool to read
../ziniao-shared/SKILL.md
before starting, which contains authentication, error handling, and security rules
CRITICAL — Before executing any Shortcuts, be sure to use the Read tool to read their corresponding references/ documentation. Blindly calling commands directly is prohibited.

Core Scenarios

View Organizational Structure

When users want to understand the company's department structure, use
--tree
to display the hierarchical relationship:
bash
ziniao-cli department list --tree
Output tree structure:
├── 技术部 (id: 15868464646076)
│   ├── 前端组 (id: 15954943062431)
│   └── 后端组 (id: 15954943062432)
└── 市场部 (id: 15868464646077)

Create Department

hierarchy
is automatically calculated by the CLI (parent department level +1), users don't need to worry about it:
bash
# Create a sub-department under an existing department (parentId must be an existing department ID, passing 0 is not supported)
ziniao-cli department create --name "华东区" --parent-id 15868464646076
--parent-id
cannot be set to 0; it must be an existing parent department ID. To query available parent department IDs, execute
department list --tree
first.

Dangerous Operations

Deleting a department is a
high-risk-write
operation and requires confirmation. Deleting a parent department will cascade delete all sub-departments, and this operation is irreversible. It is recommended to check for sub-departments or employees before deletion:
bash
ziniao-cli department list --tree          # Check sub-departments
ziniao-cli staff list --department-id xxx  # Check for employees
ziniao-cli department delete --id xxx      # Execute deletion (confirmation required)

Shortcuts

CommandDescriptionDetailed Documentation
department list
Query department list
references/ziniao-department-list.md
department create
Add new department
references/ziniao-department-create.md
department update
Modify departmentOnly send modified fields:
--id xxx --name "New Name"
department delete
Delete department (sub-departments and employee affiliations will be cleared)
high-risk-write
,
--yes
skips confirmation
department reorder
Adjust sorting
--parent-id xxx --order "id1,id2,id3"

Universal API Coverage

All department interfaces can also be called via the universal api command:
bash
ziniao-cli api /superbrowser/rest/v1/erp/department/list
ziniao-cli api /superbrowser/rest/v1/erp/department/add --data '{"name":"xxx","parentId":"<父部门ID>","hierarchy":"0"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/update --data '{"id":"xxx","name":"新名"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/delete --data '{"id":"xxx"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/order --data '{"parentId":"xxx","order":["id1","id2"]}'