
Security News
White House Authorizes Private Companies to Conduct Offensive Cyber Operations
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.
连接 AI Agent 与企业内部 API 的标准化桥梁。
所有命令统一通过 npx dakin 免安装执行,无需全局安装:
npx dakin <命令> [参数...]
npx会自动下载并执行最新版本的dakin,始终使用最新功能,无需手动升级。
# 1. 配置认证 Key
npx dakin config set-key
# 2. 列出可用系统
npx dakin list
# 3. 浏览接口
npx dakin guard # 查看 guard 系统下的子系统
npx dakin guard open # 查看 open 子系统下的操作
npx dakin guard open getApp --help # 查看 getApp 操作的参数详情
# 4. 调用接口
npx dakin guard open getApp --client-id 123 --env local
# 5. 搜索接口
npx dakin find "员工"
npx dakin <系统> <子系统> <操作> [参数...]
根据 manifest 命令树解析并执行业务接口调用。
| 示例 | 说明 |
|---|---|
npx dakin list | 列出所有可用系统(名称 + 描述) |
npx dakin guard | 查看 guard 系统下的子系统列表 |
npx dakin guard open | 查看 open 子系统下的操作列表 |
npx dakin guard open getApp --help | 查看 getApp 操作的参数详情 |
npx dakin guard open getApp --client-id 123 | 调用接口 |
config — 认证与配置管理| 子命令 | 说明 |
|---|---|
config set-key [key] | 设置全局 API Key(不传参数则交互式输入) |
config show | 查看当前配置(Key 脱敏显示) |
config clean | 清除所有配置 |
npx dakin config set-key
npx dakin config show
config env — 多环境管理支持 dev / test / pre / prod 四套环境,默认 prod。
| 子命令 | 说明 |
|---|---|
env list | 列出所有环境(🔑 表示已配 Key,* 表示当前默认) |
env set <name> [url] [--key <key>] | 添加/更新环境 |
env remove <name> | 删除环境 |
env use <name> | 切换默认环境 |
npx dakin config env set dev https://api-dev.giikin.cn --key sk-dev-xxx
npx dakin config env use local
npx dakin config env list
find — 搜索接口npx dakin find "用户" # 关键词搜索
npx dakin find "订单" --limit 5 # 限制返回数量
npx dakin find "员工" --env dev # 指定环境
command — 查看命令详情npx dakin command 1046 # 查看 apiId=1046 的完整命令详情
npx dakin command 1046 --plain # 纯文本格式
update — 检查版本更新npx dakin update --check
mcp-server — MCP 模式启动 MCP Server 供 AI IDE(Cursor、Claude Code、Kiro)集成:
npx dakin mcp-server
IDE 配置示例(Claude Code):
{
"mcpServers": {
"dakin": {
"command": "npx",
"args": ["dakin", "mcp-server"],
"autoApprove": [
"find_api",
"get_command",
"list_systems",
"get_system_info",
"debug_manifest",
"check_update"
]
}
}
}
说明:
call_api不在autoApprove列表中,调用业务接口需用户手动确认,避免误操作。 可通过--env切换环境(如--env dev),不指定则使用currentEnv(默认prod)。
MCP 工具列表:
| 工具名 | 说明 |
|---|---|
find_api | 关键词搜索接口(返回摘要,需配合 get_command 获取参数) |
get_command | 获取接口完整参数列表和调用示例(find_api → call_api 的必要桥梁) |
call_api | 调用业务接口(需用户确认,自动处理域名路由、认证、参数转换) |
list_systems | 列出可用系统及网关域名 |
get_system_info | 查看系统详情(子系统、API 数量) |
debug_manifest | 诊断工具:查看 manifest 概要(版本、系统、API 分布) |
check_update | 检查 CLI 工具是否有新版本(查 npm registry),引导用户升级 |
| 选项 | 说明 |
|---|---|
-e, --env <env> | 指定环境(local/dev/test/pre/prod),本次生效不修改配置 |
-v, --verbose | 输出完整请求/响应详情到 stderr |
-o, --output <mode> | 输出格式(json | plain),默认 json |
--raw | 仅输出 data 字段 |
-h, --help | 显示帮助 |
| 变量 | 说明 |
|---|---|
DAKIN_API_KEY | 临时覆盖 API Key,优先级高于配置文件 |
位置:~/.dakin/config.json
{
"apiKey": "dk-xxx",
"currentEnv": "prod",
"environments": {
"local": { "url": "http://localhost:8009" },
"dev": { "url": "https://api-dev.giikin.cn", "apiKey": "sk-dev-xxx" },
"test": { "url": "https://api-test.giikin.cn" },
"pre": { "url": "https://api-pre.giikin.com" },
"prod": { "url": "https://api.giikin.com" }
}
}
url — 元数据 API 地址(manifest、routes、find 等端点)apiKey — 该环境的 API Key(可选,未配则回退到全局 apiKey)/apim/cli/v1/routes 端点自动下发,无需手动配置| 缓存文件 | 内容 | 策略 |
|---|---|---|
~/.dakin/manifest.json | 命令树(系统/子系统/操作) | 版本号对比,304 零传输 |
~/.dakin/routes.json | 系统 → 网关地址映射 | 随 manifest 版本变化自动刷新 |
~/.dakin/params.json | apiId → 参数定义 | 随 manifest 版本变化自动清理 |
首次调用(4 次 HTTP):
manifest → routes → getCommand → 业务调用
后续调用(2 次 HTTP):
manifest (304) → 业务调用
(routes + params 命中本地缓存)
npx dakin guard open getApp --client-id 123 --verbose
输出示例:
============================================================
[VERBOSE] >>> GET http://localhost:8009/apim/cli/v1/manifest?version=202606241624
[VERBOSE] 请求头:
Content-Type: application/json
Authorization: Bearer dk-ai-p-****
[VERBOSE] <<< 304
============================================================
============================================================
[VERBOSE] >>> POST http://localhost:8009/guard/open/rpc/v1/open/getApp
[VERBOSE] 请求头:
Content-Type: application/json
Authorization: Bearer dk-ai-p-****
[VERBOSE] 请求体:
{"clientId":"123"}
[VERBOSE] <<< 200 OK
[VERBOSE] 响应体:
{"code":200,"data":{...}}
============================================================
# Linux/Mac — 单引号
npx dakin guard basic somePostApi --body '{"fieldCodes":["val1","val2"]}'
# Windows Git Bash — 双引号 + 转义
npx dakin guard basic somePostApi --body "{\"fieldCodes\":[\"val1\",\"val2\"]}"
cd cli
pnpm install
pnpm build
pnpm test
开发模式(文件变更自动编译):
pnpm dev
发布 snapshot 版本:
pnpm publish:snapshot
FAQs
企业统一 CLI 工具 — 连接 AI Agent 与企业内部 API 的标准化桥梁
We found that dakin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A new federal program will let vetted U.S. cybersecurity firms help investigate and disrupt foreign cybercrime groups under government direction.

Research
/Security News
The campaign amassed more than 75,000 installs by targeting Russian-speaking users seeking access to blocked services.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.