agnesoft/agdb/agdb-api
Claude Code and agent skill by agnesoft/agdb
- community
Checking that the SKILL.md file is still in the repository.
Navigate agdb API structure, endpoints, authentication, and client libraries. Use this skill when building API clients, writing server tests, understanding endpoint behavior, or working with API transpilations to other languages.
Install
npx vskill@latest install agnesoft/agdb/agdb-apiSKILL.md
agdb API Skill
Use this skill when:
- Understanding agdb server API structure and endpoints
- Writing tests for agdb_server routes
- Explaining API behavior to implement in client libraries
- Planning API client generators or transpilations
- Debugging authentication/authorization flows
- Building wrappers or SDKs for other languages
- Interacting with the server programmatically (always use the Rust SDK, never raw JSON)
Primary sources in this repository:
agdb_api/src/client.rs— Rust API client (all endpoint methods)agdb_server/openapi.json— OpenAPI 3.1.0 specification (complete contract)agdb_server/src/routes/— Route implementations (auth, validation, errors)agdb_server/tests/— Integration testsagdb_api/src/— Rust client source packageagdb_api/typescript/— TypeScript client packageagdb_api/php/— PHP client package
API organization
The agdb server exposes a REST API at /api/v1 (or {basepath}/api/v1 when basepath is configured) organized into four endpoint families:
Admin routes (/api/v1/admin/...)
Require admin authentication. Manage all databases, users, and server state.
- Database management:
/admin/db/{owner}/{db}/... POST /add— Create database (body:DbKind—Memory,Mapped,File)GET /audit— View database audit log →DbAuditPOST /backup— Create backup snapshotPOST /clear— Clear resources (body:ClearAudit | ClearBackup | ClearAll)POST /convert— Change storage type (body:DbKind)POST /copy— Copy database (body:{new_name})DELETE /delete— Permanently delete database and filesPOST /optimize— Defragment storage, returnsServerDatabasewith new sizePOST /optimize_shrink_to_fit— Defragment and shrink file on diskDELETE /remove— Disassociate from server (keep data files)POST /rename— Rename/move database (body:{new_name})POST /restore— Restore from backupPOST /rollback— Rollback to previous WAL checkpointPOST /exec— Execute immutable queries →Vec<QueryResult>POST /exec_mut— Execute mutable queries →Vec<QueryResult>GET /user/list— List database users →Vec<DbUser>PUT /user/{username}/add— Add database user (body:DbUserRole)DELETE /user/{username}/remove— Remove database user
- User management:
/admin/user/... POST /{username}/add— Create user (body:{password})PUT /{username}/change_password— Change password (body:{password})GET /list— List all users and sessions →Vec<UserStatus>POST /{username}/logout— Logout user (all sessions on this node)POST /{username}/logout?session={session}— Logout specific sessionPOST /logout_all— Logout all users on this nodeDELETE /{username}/delete— Delete user and all owned databases
- Server management:
/admin/... POST /shutdown— Graceful server shutdownPOST /set_log_level?new_level={level}— Set log level (trace,debug,info,warn,error,off)GET /status— Server status and metrics →AdminStatus
User routes (/api/v1/user/...)
Require user authentication. User manages own account.
POST /login— Authenticate → token string (body:{username, password})POST /logout— Logout current sessionPOST /logout?session=others— Logout all other sessionsPOST /logout?session=all— Logout all sessionsPOST /logout?session={session}— Logout specific session by idPUT /change_password— Change own password (body:{password})GET /status— Own status and sessions →UserStatus
Database routes (/api/v1/db/{owner}/{db}/...)
Require user authentication and appropriate role.
Same structure as admin database routes but scoped to owner/accessible databases:
| Role | Allowed operations | |
|---|---|---|
| Read | exec, audit | |
| Write | Everything Read + exec_mut | |
| Admin | Everything Write + backup, restore, rollback, convert, optimize, clear, user/add, user/remove |
Additionally:
POST /add— Create database (owner must be self)DELETE /delete— Delete (owner only)DELETE /remove— Remove (owner only)POST /rename— Rename (owner only)POST /copy— Copy (owner scope)GET /list— List accessible databases →Vec<ServerDatabase>(no{owner}/{db}path params)
Cluster routes (/api/v1/cluster/...)
Propagate operations across all cluster nodes. These endpoints replicate the action to every node via the Raft log.
POST /user/login— Authenticate cluster-wide → token valid on all nodesPOST /user/logout— Logout cluster-widePOST /user/logout?session=others|all|{id}— Logout variants across clusterPOST /admin/user/{username}/logout— Admin logout user across clusterPOST /admin/user/{username}/logout?session={session}— Admin logout specific session across clusterPOST /admin/user/logout_all— Logout all users across clusterGET /status— Cluster node statuses →Vec<ClusterStatus>
Health check
GET /api/v1/status— Server health (no auth required), returns HTTP 200
Authentication & authorization
Token-based authentication
- Call
POST /user/loginorPOST /cluster/user/loginwith{username, password}. - Server returns a token string.
- Include token in
Authorization: Bearer <token>header for subsequent requests. - Token expires after
token_expiry_seconds(configurable, default 3600, range 60–86400). - Expired tokens return
401 Unauthorized. - Each login creates a new session; multiple sessions per user are allowed.
Roles and permissions
Users can have roles on databases:
- Admin: Full control (all operations, including backup, restore, rollback, user management)
- Write: Read + modify data (exec_mut)
- Read: Query only (exec, audit)
Admin users have server-wide admin access and are required for user and server operations.
Common error codes
| Code | Meaning | |
|---|---|---|
200 | Success with a response body (GET, exec, exec_mut) | |
201 | Created (create-like POST/PUT operations) | |
204 | No content (DELETE and other successful no-body operations) | |
400 | Bad request (malformed input) | |
401 | Unauthorized (missing/expired token, invalid credentials) | |
403 | Forbidden (insufficient permissions / wrong role) | |
404 | Not found (user, database, or resource does not exist) | |
461 | Password too short (<8 chars) | |
462 | User name too short (<3 chars) | |
463 | User already exists | |
464 | User not found | |
465 | Database already exists | |
467 | Invalid database name |
Client libraries
Rust client (agdb_api::AgdbApi)
Hand-written, fully typed. Methods map directly to endpoints. This is the recommended way to interact with the server programmatically.
Location: agdb_api/src/client.rs
Package name: agdb_api
Cargo features:
api(default) — enables derive macros, tokio, and the full clientderive— agdb derive macros re-exported
Method naming convention: {family}_{resource}_{action}
admin_db_add,admin_db_exec_mut,admin_user_adddb_add,db_exec,db_exec_mut,db_backup,db_restorecluster_user_login,cluster_statususer_login,user_logout,user_status
Custom HTTP client: Implement the HttpClient trait to replace ReqwestClient with any HTTP library. The trait defines delete, get, post, put methods and exec for query batches, which defaults to JSON via post.
Query encoding: ReqwestClient sends exec/exec_mut batches and receives their results in agdb's binary serialization (BINARY_CONTENT_TYPE, application/vnd.agdb.api.v1) instead of JSON. Servers that predate it answer 415; the client then uses JSON until the server is unreachable or answers 502–504 (e.g. restarted with a newer version).
TypeScript client
Generated from OpenAPI. Includes models and request types.
Location: agdb_api/typescript/src/
Package name: @agnesoft/agdb_api
PHP client
Generated from OpenAPI using openapi-generator.
Location: agdb_api/php/lib/
Package name: agnesoft/agdb-api
URL: https://packagist.org/packages/agnesoft/agdb_api
Server configuration reference
The server reads a YAML-like config file (default: agdb_server.yaml). First run creates a default config.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/agdb-api/SKILL.md
Popularity
- Repository stars
- 137
- Repository forks
- 7
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/agnesoft/agdb/agdb-api)