闲社服务运行正常AI智能体自动化平台
s

精准狙击

技能标识:snipeit

>

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

精准狙击

Snipe-IT 技能

概述

Snipe-IT REST API 对所有有效的 HTTP 请求返回 200 OK。
请检查响应中的 .status 字段——success 或 error。

基础 URL:$SNIPEIT_URL/api/v1



核心辅助函数

bash
snipe() {
local method=${1:-GET}
local endpoint=$2
local data=${3:-}

local args=(
-s -X $method
-H Authorization: Bearer $SNIPEITAPITOKEN
-H Accept: application/json
-H Content-Type: application/json
)

[ -n $data ] && args+=(-d $data)

curl ${args[@]} ${SNIPEIT_URL}/api/v1${endpoint} | jq .
}

快捷方式

snipe_get() { snipe GET $1; } snipe_post() { snipe POST $1 $2; } snipe_patch() { snipe PATCH $1 $2; } snipe_put() { snipe PUT $1 $2; } snipe_delete() { snipe DELETE $1; }

资产(硬件)

bash

列出所有资产(带分页)


snipe_get /hardware?limit=50&offset=0

搜索资产

snipe_get /hardware?search=MacBook&limit=20

按状态标签筛选

snipeget /hardware?statusid=2&limit=50

按ID获取资产

snipe_get /hardware/42

按资产标签获取资产

snipe_get /hardware/bytag/ASSET-001

按序列号获取资产

snipe_get /hardware/byserial/SN123456

创建资产

snipe_post /hardware { asset_tag: ASSET-001, model_id: 5, status_id: 2, name: MacBook Pro 16, serial: SN123456, location_id: 1, notes: 分配给开发团队 }

更新资产(PATCH = 部分更新)

snipe_patch /hardware/42 { name: MacBook Pro 16(已更新), status_id: 3, notes: 屏幕已更换 }

完全更新(PUT = 替换所有字段)

snipe_put /hardware/42 { asset_tag: ASSET-001, model_id: 5, status_id: 2, name: MacBook Pro 16, serial: SN123456 }

删除资产

snipe_delete /hardware/42

将资产借出给用户

snipe_post /hardware/42/checkout { checkouttotype: user, assigned_user: 7, note: 分配用于远程工作, checkout_at: 2025-01-15, expected_checkin: 2025-12-31 }

将资产借出到位置

snipe_post /hardware/42/checkout { checkouttotype: location, assigned_location: 3, note: 会议室设置 }

将资产借出给另一个资产

snipe_post /hardware/42/checkout { checkouttotype: asset, assigned_asset: 15 }

归还资产

snipe_post /hardware/42/checkin { note: 使用后归还, checkin_at: 2025-06-01 }

审计资产(确认位置)

snipe_post /hardware/audit { asset_tag: ASSET-001, location_id: 2, note: 季度审计时已验证 }

获取审计历史

snipe_get /hardware/audit/due snipe_get /hardware/audit/overdue

列出借出给用户的资产

snipe_get /users/7/assets

恢复已删除的资产

snipe_post /hardware/42/restore {}

用户

bash

列出所有用户


snipe_get /users?limit=50

搜索用户

snipe_get /users?search=john&limit=20

按ID获取用户

snipe_get /users/7

获取当前API用户

snipe_get /users/me

创建用户

snipe_post /users { first_name: John, last_name: Doe, username: john.doe, email: john.doe@example.com, password: SecurePass123!, password_confirmation: SecurePass123!, department_id: 2, location_id: 1, employee_num: EMP-001, jobtitle: 开发者, activated: true }

更新用户

snipe_patch /users/7 { department_id: 3, jobtitle: 高级开发者 }

删除用户

snipe_delete /users/7

获取用户的资产

snipe_get /users/7/assets

获取用户的许可证

snipe_get /users/7/licenses

获取用户的配件

snipe_get /users/7/accessories

获取用户的耗材

snipe_get /users/7/consumables

许可证

bash

列出所有许可证


snipe_get /licenses?limit=50

搜索许可证

snipe_get /licenses?search=Office&limit=20

按ID获取许可证

snipe_get /licenses/3

创建许可证

snipe_post /licenses { name: Microsoft Office 365, serial: XXXXX-XXXXX-XXXXX, seats: 25, category_id: 4, manufacturer_id: 2, license_email: it@example.com, purchase_date: 2025-01-01, expiration_date: 2026-01-01, purchase_cost: 299.99, notes: 年度订阅 }

更新许可证

snipe_patch /licenses/3 { seats: 30, notes: 席位已增加 }

删除许可证

snipe_delete /licenses/3

列出许可证席位(谁借出了)

snipe_get /licenses/3/seats

将许可证席位借出给用户

snipe_post /licenses/3/seats/12/checkout { assigned_to: 7, note: 开发者许可证 }

归还许可证席位

snipe_delete /licenses/3/seats/12/checkin

配件

bash

列出所有配件


snipe_get /accessories?limit=50

按ID获取配件

snipe_get /accessories/8

创建配件

snipe_post /accessories { name: USB-C 集线器, category_id: 5, manufacturer_id: 3, qty: 10, purchase_date: 2025-01-01, purchase_cost: 49.99, location_id: 1 }

更新配件

snipe_patch /accessories/8 {qty: 15}

删除配件

snipe_delete /accessories/8

将配件借出给用户

snipe_post /accessories/8/checkout { assigned_to: 7, note: 用于家庭办公室 }

归还配件

snipe_post /accessories/8/checkin { note: 已归还 }

列出已借出的配件

snipe_get /accessories/8/checkedout

耗材

bash

列出耗材


snipe_get /consumables?limit=50

按ID获取耗材

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 snipeit-skill-1776320424 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 snipeit-skill-1776320424 技能

通过命令行安装

skillhub install snipeit-skill-1776320424

下载

⬇ 下载 snipeit v1.0.0(免费)

文件大小: 5.02 KB | 发布时间: 2026-4-16 16:23

v1.0.0 最新 2026-4-16 16:23
Initial release of snipeit-skill.

- Provides shell helpers for Snipe-IT asset management via REST API.
- Supports operations for assets, users, licenses, accessories, consumables, components, locations, and departments.
- Includes detailed bash examples for listing, searching, creating, updating, deleting, and checking in/out entities.
- Uses environment variables for API configuration; requires curl and jq.
返回顶部