Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计异常

bknd-api-discoverybknd API discovery 搜索

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

318

周安装

13

GitHub Stars

3

下载量

103
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:bknd-api-discovery(bknd API discovery 搜索)
来源仓库:https://github.com/cameronapak/bknd-skills
仓库路径:skills/bknd-api-discovery
安装命令:
npx skills add https://github.com/cameronapak/bknd-skills --skill bknd-api-discovery
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/cameronapak/bknd-skills --skill bknd-api-discovery

简介

bknd-api-discovery 用于探索 Bknd 自动生成的 REST API 端点,适合在 Codex、Claude、Cursor、Gemini CLI 中理解接口模式和集成细节。

  • 适用场景包括浏览可用实体结构、查看字段映射关系、调试路由注册问题及构建 OpenAPI 草稿文档。
  • 核心能力是提供程序化列出注册路由的能力,辅助理解 endpoint 命名约定和参数传递规则。
  • 使用方式需先启动 Bknd 实例,再通过 SDK 或浏览器访问 admin panel 获取直观视图。
  • 建议在集成第三方服务前使用此技能梳理现有接口,避免重复造轮子或命名冲突。

SKILL.md

API Discovery

Explore and understand Bknd's auto-generated REST API endpoints.

Prerequisites

  • Running Bknd instance (local or deployed)
  • Access to admin panel (optional but helpful)
  • Basic understanding of REST APIs

When to Use UI Mode

  • Browsing available entities and their fields
  • Viewing schema structure visually
  • Quick endpoint exploration via browser

UI steps: Admin Panel > Data > Entities

When to Use Code Mode

  • Listing all registered routes programmatically
  • Understanding endpoint patterns for integration
  • Debugging route registration issues
  • Building API documentation

Understanding Bknd's API Structure

Bknd auto-generates REST endpoints for all configured modules:

┌─────────────────────────────────────────────────────────────┐
│                    Bknd API Structure                       │
├─────────────────────────────────────────────────────────────┤
│  /api/data      → CRUD for all entities                     │
│  /api/auth      → Authentication (login, register, logout)  │
│  /api/media     → File uploads and serving                  │
│  /api/system    → System operations                         │
│  /flow          → Flow management and triggers              │
│  /admin         → Admin UI (if enabled)                     │
└─────────────────────────────────────────────────────────────┘

Code Approach

Step 1: List All Routes (CLI)

Use the debug command to list all registered routes:

bknd debug routes

Output:

GET     /admin/*
GET     /api/auth/me
POST    /api/auth/password/login
POST    /api/auth/logout
POST    /api/auth/register
GET     /api/data/:entity
POST    /api/data/:entity
GET     /api/data/:entity/:id
PATCH   /api/data/:entity/:id
DELETE  /api/data/:entity/:id
POST    /api/media/upload
GET     /api/media/:path
...

Step 2: Data API Endpoints

All entities get CRUD endpoints automatically:

MethodPathDescriptionSDK Method
GET/api/data/:entityList recordsapi.data.readMany(entity)
POST/api/data/:entity/queryList (complex query)api.data.readMany(entity, query)
GET/api/data/:entity/:idGet single recordapi.data.readOne(entity, id)
GET/api/data/:entity/:id/:refGet related recordsapi.data.readManyByReference(...)
POST/api/data/:entityCreate record(s)api.data.createOne/Many(entity, data)
PATCH/api/data/:entity/:idUpdate singleapi.data.updateOne(entity, id, data)
PATCH/api/data/:entityUpdate manyapi.data.updateMany(entity, where, data)
DELETE/api/data/:entity/:idDelete singleapi.data.deleteOne(entity, id)
DELETE/api/data/:entityDelete manyapi.data.deleteMany(entity, where)
POST/api/data/:entity/fn/countCount recordsapi.data.count(entity, where)
POST/api/data/:entity/fn/existsCheck existenceapi.data.exists(entity, where)

Example: Explore posts entity

# List all posts
curl http://localhost:7654/api/data/posts

# Get post by ID
curl http://localhost:7654/api/data/posts/1

# Get with query params
curl "http://localhost:7654/api/data/posts?limit=10&sort[created_at]=desc"

# Get with relations
curl "http://localhost:7654/api/data/posts?with[]=author&with[]=comments"

# Complex query via POST
curl -X POST http://localhost:7654/api/data/posts/query \
  -H "Content-Type: application/json" \
  -d '{"where": {"status": "published"}, "limit": 10}'

Step 3: Auth API Endpoints

MethodPathDescription
GET/api/auth/meCurrent user info
POST/api/auth/:strategy/loginLogin (e.g., /api/auth/password/login)
POST/api/auth/registerRegister new user
POST/api/auth/logoutLogout
GET/api/auth/:strategy/redirectOAuth redirect
GET/api/auth/:strategy/callbackOAuth callback

Example:

# Check current user
curl http://localhost:7654/api/auth/me \
  -H "Authorization: Bearer $TOKEN"

# Login
curl -X POST http://localhost:7654/api/auth/password/login \
  -H "Content-Type: application/json" \
  -d '{"email": "user@test.com", "password": "pass123"}'

# Register
curl -X POST http://localhost:7654/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email": "new@test.com", "password": "pass123"}'

Step 4: Media API Endpoints

MethodPathDescription
POST/api/media/uploadUpload file
GET/api/media/:pathServe/download file

Example:

# Upload file
curl -X POST http://localhost:7654/api/media/upload \
  -H "Authorization: Bearer $TOKEN" \
  -F "file=@image.png"

# Serve file
curl http://localhost:7654/api/media/uploads/image.png

Step 5: Flow Endpoints

MethodPathDescription
GET/flowList all flows
GET/flow/:nameGet flow details
GET/flow/:name/runManually run flow
*Custom trigger pathHTTP trigger endpoints

Example:

# List flows
curl http://localhost:7654/flow

# Run flow manually
curl http://localhost:7654/flow/my-flow/run

Step 6: Programmatic Route Discovery

Access route information from your code:

import { App } from "bknd";

const app = new App({ /* config */ });
await app.build();

// Get Hono server instance
const server = app.server;

// Routes are registered on the Hono instance
// Use bknd debug routes for listing

Step 7: Discover Entity Schema

Query the system to understand available entities:

import { Api } from "bknd";

const api = new Api({ host: "http://localhost:7654" });

// List available entities by checking which respond
const entities = ["posts", "users", "comments", "categories"];

for (const entity of entities) {
  const { ok } = await api.data.readMany(entity, { limit: 1 });
  if (ok) {
    console.log(`Entity exists: ${entity}`);
  }
}

Step 8: Response Format Discovery

All endpoints return consistent response format:

Success (list):

{
  "data": [
    { "id": 1, "title": "Post 1" },
    { "id": 2, "title": "Post 2" }
  ],
  "meta": {
    "total": 50,
    "limit": 20,
    "offset": 0
  }
}

Success (single):

{
  "data": { "id": 1, "title": "Post 1" }
}

Error:

{
  "error": {
    "message": "Record not found",
    "code": "NOT_FOUND"
  }
}

UI Approach: Admin Panel

Step 1: Access Admin Panel

Navigate to: http://localhost:7654/admin

Step 2: Browse Entities

  1. Click Data in sidebar
  2. View list of all entities
  3. Click entity to see:

- All fields with types - Relationships - Sample data

Step 3: View Entity Structure

Admin panel shows:

  • Field names and types
  • Required vs optional fields
  • Default values
  • Relation configurations

Step 4: Test Queries

Admin panel provides:

  • Data browser for each entity
  • Filter/sort interface
  • Create/edit forms
  • Relationship navigation

Query Parameter Reference

Data Endpoints

ParameterExampleDescription
limit?limit=10Max records to return
offset?offset=20Skip N records
sort[field]?sort[created_at]=descSort by field
where[field]?where[status]=publishedFilter by field
with[]?with[]=authorInclude relation
join[]?join[]=authorJoin relation (same result)
select[]?select[]=id&select[]=titleSelect specific fields

Complex Queries (POST)

curl -X POST http://localhost:7654/api/data/posts/query \
  -H "Content-Type: application/json" \
  -d '{
    "where": {
      "status": "published",
      "views": { "$gt": 100 }
    },
    "sort": { "created_at": "desc" },
    "limit": 10,
    "offset": 0,
    "with": ["author", "category"]
  }'

SDK Method to Endpoint Mapping

import { Api } from "bknd";
const api = new Api({ host: "http://localhost:7654" });

// Method                        → Endpoint
api.data.readMany("posts")       // GET  /api/data/posts
api.data.readOne("posts", 1)     // GET  /api/data/posts/1
api.data.createOne("posts", {})  // POST /api/data/posts
api.data.updateOne("posts", 1, {})// PATCH /api/data/posts/1
api.data.deleteOne("posts", 1)   // DELETE /api/data/posts/1

api.auth.login("password", {})   // POST /api/auth/password/login
api.auth.register({})            // POST /api/auth/register
api.auth.logout()                // POST /api/auth/logout
api.auth.me()                    // GET  /api/auth/me

api.media.upload(file)           // POST /api/media/upload

Testing Endpoints

Quick Health Check

# Check if API is running
curl http://localhost:7654/api/auth/me
# Returns user info or 401

Explore Available Data

# Try common entity names
for entity in posts users comments products orders; do
  echo "Testing $entity..."
  curl -s -o /dev/null -w "%{http_code}" http://localhost:7654/api/data/$entity
  echo ""
done

Debug Script

async function discoverApi(host: string) {
  const api = new Api({ host });

  console.log("API Discovery Report");
  console.log("===================");

  // Test auth
  const { ok: authOk } = await api.auth.me();
  console.log(`Auth endpoint: ${authOk ? "working" : "requires auth"}`);

  // Test common entities
  const testEntities = ["posts", "users", "comments", "products"];
  for (const entity of testEntities) {
    const { ok, meta } = await api.data.readMany(entity, { limit: 1 });
    if (ok) {
      console.log(`Entity "${entity}": ${meta?.total ?? "?"} records`);
    }
  }
}

discoverApi("http://localhost:7654");

Common Pitfalls

Wrong Base Path

Problem: 404 errors on API calls

Fix: Use correct base paths:

# WRONG
curl http://localhost:7654/data/posts
curl http://localhost:7654/posts

# CORRECT
curl http://localhost:7654/api/data/posts

Auth Strategy in Path

Problem: Login fails

Fix: Include strategy name:

# WRONG
curl -X POST http://localhost:7654/api/auth/login

# CORRECT (password strategy)
curl -X POST http://localhost:7654/api/auth/password/login

Query vs GET Params

Problem: Complex queries don't work via GET

Fix: Use POST for complex queries:

# Limited filtering via GET
curl "http://localhost:7654/api/data/posts?where[status]=published"

# Complex filtering via POST
curl -X POST http://localhost:7654/api/data/posts/query \
  -H "Content-Type: application/json" \
  -d '{"where": {"$or": [{"status": "published"}, {"featured": true}]}}'

Entity Name Mismatch

Problem: 404 on entity endpoints

Fix: Use exact entity names (case-sensitive, usually lowercase):

# WRONG
curl http://localhost:7654/api/data/Posts
curl http://localhost:7654/api/data/post

# CORRECT
curl http://localhost:7654/api/data/posts

Missing Content-Type

Problem: POST/PATCH returns 400

Fix: Include Content-Type header:

# WRONG
curl -X POST http://localhost:7654/api/data/posts \
  -d '{"title": "Test"}'

# CORRECT
curl -X POST http://localhost:7654/api/data/posts \
  -H "Content-Type: application/json" \
  -d '{"title": "Test"}'

Endpoint Quick Reference

ModuleBase PathKey Operations
Data/api/dataCRUD for all entities
Auth/api/authLogin, register, logout, me
Media/api/mediaUpload, serve files
Flows/flowList, view, run flows
Admin/adminAdmin UI

DOs and DON'Ts

DO:

  • Use bknd debug routes to list all endpoints
  • Check admin panel for visual schema exploration
  • Use POST /query endpoint for complex filters
  • Include Content-Type header on POST/PATCH
  • Test endpoints with curl before implementing

DON'T:

  • Forget /api/ prefix on API paths
  • Mix up entity names (case matters)
  • Use GET for complex queries with nested operators
  • Assume entity names - verify they exist first
  • Forget auth strategy in login path (/api/auth/password/login)

Related Skills

  • bknd-client-setup - Set up SDK in frontend
  • bknd-crud-read - Query data with filtering
  • bknd-custom-endpoint - Create custom API endpoints
  • bknd-login-flow - Implement authentication
  • bknd-local-setup - Set up local development

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

39.37%
按下载量换算41

Claude

28.38%
按下载量换算29

Cursor

19.29%
按下载量换算20

Gemini CLI

10.08%
按下载量换算10

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills