بنقرة واحدة
cli-backend-testing
CLI + Backend integration testing workflow. Use when verifying backend
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
CLI + Backend integration testing workflow. Use when verifying backend
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Set up and use 1Password CLI (op). Use when installing the CLI, enabling
Guide for adding new AI function examples, for testing specific features against the actual provider APIs.
Use when editing worker/src/constants/default-model-prices.json, packages/shared/src/server/llm/types.ts, pricing tiers, tokenizer IDs, or matchPattern regexes for OpenAI, Anthropic, Bedrock, Vertex, Azure, or Gemini model pricing.
Fixes broken typing checks detected by ty, make typing, or make check-repo. Use when typing errors appear in local runs, CI, or PR logs.
Add documentation for a new AI provider — usage docs, env vars, Docker
Guide for adding new AI provider packages to the AI SDK. Use when creating
| name | cli-backend-testing |
| name_zh | cli-backend-testing |
| description | CLI + Backend integration testing workflow. Use when verifying backend |
| description_zh | CLI + 后端 集成 测试 workflow. Use when verifying 后端 |
| category | dev-tools |
| tags | ["ai","api","backend","cli","database"] |
| source | null |
| language | en |
| needs_review | false |
| slug | cli-backend-testing |
| version | 1.0.0 |
| created | 2026-06-12 |
| updated | 2026-06-12 |
| inputs | [{"name":"request","type":"string","required":true,"description":"User request or task description"}] |
| output | {"format":"markdown","description":"Generated content based on the user request"} |
| author | AI-SKILL |
| license | MIT |
Use this skill when you need to work with cli-backend-testing.
User request or task description.
Generated content based on the user request.
Follow the guidelines in this skill when working on related tasks. Ensure you understand the requirements and constraints before proceeding.
Standard workflow for verifying backend changes using the LobeHub CLI (lh) against a local dev server.
| Requirement | Details |
|---|---|
| Dev server | localhost:3011 (Next.js) |
| CLI source | lobehub/apps/cli/ |
| CLI dev mode | Uses LOBEHUB_CLI_HOME=.lobehub-dev for isolated credentials |
| Auth | Device Code Flow login to local server |
All CLI dev commands run from lobehub/apps/cli/. Subsequent examples use $CLI:
CLI="LOBEHUB_CLI_HOME=.lobehub-dev bun src/index.ts"
curl -s -o /dev/null -w '%{http_code}' http://localhost:3011/ 2> /dev/null
pnpm run dev:next
To restart (pick up server-side code changes):
lsof -ti:3011 | xargs kill
pnpm run dev:next
Important: Server-side code changes in the submodule (lobehub/apps/server/src/, lobehub/src/server/, lobehub/packages/) require a server restart. Next.js hot-reload may not pick up changes in submodule packages.
cat lobehub/apps/cli/.lobehub-dev/settings.json 2> /dev/null
"serverUrl": "http://localhost:3011": skip to Step 3.! cd lobehub/apps/cli && LOBEHUB_CLI_HOME=.lobehub-dev bun src/index.ts login --server http://localhost:3011
Login requires interactive browser authorization (OIDC Device Code Flow), so the user must run it themselves via
!prefix. Credentials persist inlobehub/apps/cli/.lobehub-dev/.
CLI runs from source, so CLI-side code changes take effect immediately without rebuilding.
cd lobehub/apps/cli
$CLI <command>
$CLI task delete < id > -y
$CLI agent delete < id > -y
$CLI task list
$CLI task create -n "Root Task" -i "Test instruction"
$CLI task create -n "Child Task" -i "Sub instruction" --parent T-1
$CLI task view T-1
$CLI task tree T-1
$CLI task edit T-1 --status running
$CLI task comment T-1 -m "Test comment"
$CLI task delete T-1 -y
$CLI agent list
$CLI agent view <agent-id>
$CLI agent run <agent-id> -m "Test prompt"
$CLI doc list
$CLI doc create -t "Test Doc" -c "Content here"
$CLI doc view <doc-id>
$CLI kb list
$CLI kb tree <kb-id>
$CLI model list
$CLI provider list
$CLI provider test <provider-id>
1. Make code changes (service/model/router/type)
|
2. Run unit tests (fast feedback)
bunx vitest run --silent='passed-only' '<test-file>'
|
3. Restart dev server (if server-side changes)
lsof -ti:3011 | xargs kill && pnpm run dev:next
|
4. CLI verification (end-to-end)
$CLI <command>
|
5. Clean up test data
| Change Location | Restart? |
|---|---|
lobehub/apps/server/src/ (routers, services, modules) | Yes |
lobehub/src/server/ (agent-hono, workflows-hono) | Yes |
lobehub/packages/database/ (models) | Yes |
lobehub/packages/types/ | Yes |
lobehub/packages/prompts/ | Yes |
lobehub/apps/cli/ (CLI code) | No |
src/ (cloud overrides) | Yes |
| Issue | Solution |
|---|---|
No authentication found | Run login --server http://localhost:3011 |
UNAUTHORIZED on API calls | Token expired; re-run login |
ECONNREFUSED | Dev server not running; start with pnpm run dev:next |
| CLI shows old data/behavior | Server needs restart to pick up code changes |
EADDRINUSE on port 3011 | Server already running; kill with lsof -ti:3011 | xargs kill |
| Login opens wrong server | Must use --server http://localhost:3011 flag (env var doesn't work) |
Do not use this skill for tasks outside its scope or when simpler alternatives are available.
# 使用 cli-backend-testing 技能
skill = load_skill("cli-backend-testing")
result = skill.execute()
print(result)