cli-backend-testing

Run LobeHub CLI end-to-end tests against a local dev server.

1|Updated May 9, 2026
One-click install
npx skills add https://github.com/duwenji/generative-ai-oss-tutorials --skill cli-backend-testing-duwenji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli-backend-testing
Source: https://github.com/duwenji/generative-ai-oss-tutorials/tree/main/sandbox/lobe-chat/.agents/skills/cli-backend-testing
Command: npx skills add https://github.com/duwenji/generative-ai-oss-tutorials --skill cli-backend-testing-duwenji

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It reduces the risk of broken backend API changes by providing an end-to-end way to verify routers, services, models, and CLI behavior against a local dev server.

Core Features & Use Cases

  • End-to-end CLI verification: Confirms that LobeHub CLI commands correctly exercise backend TRPC endpoints on a running local server.
  • Test data lifecycle management: Provides repeatable cleanup steps to remove tasks and agents created during verification.
  • Targeted dev workflow: Uses isolated dev credentials (LOBEHUB_CLI_HOME) and clarifies when a server restart is required for submodule changes.

Quick Start

Start the local dev server on port 3011, ensure the CLI is logged into http://localhost:3011, then run the CLI command sequence to verify the updated backend behavior.

Frequently Asked Questions about cli-backend-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test backend TRPC router changes against a local dev server using the CLI?

Run the LobeHub CLI commands against a local dev server on localhost:3011 to verify TRPC router, service, and model updates end-to-end, ensuring CLI output correctly exercises the modified backend API behavior.

What do I need to set up before running end-to-end CLI backend testing?

Before running end-to-end backend testing, start a local dev server on port 3011, complete the CLI device code flow authentication, and configure the LOBEHUB_CLI_HOME environment variable to isolate dev credentials.

How do I clean up test data after verifying backend API modifications via the CLI?

Clean up test data after CLI verification by running the repeatable cleanup steps provided to remove generated tasks and agents, ensuring the local dev server environment remains uncluttered for the next test cycle.

When do I need to restart the local dev server for backend testing?

Restart the local dev server when submodule changes are made to ensure the backend testing environment properly loads the updated code, while standard TRPC router or service updates can be verified without a full restart.

Does this backend testing approach support validating new API response structures?

Yes, this backend testing approach validates new API response structures by executing CLI commands against modified TRPC endpoints and verifying the CLI output matches the expected response structure changes.

Why use isolated dev credentials for CLI backend testing instead of standard authentication?

Isolated dev credentials via LOBEHUB_CLI_HOME prevent backend testing cycles from affecting your standard CLI configuration, ensuring test data cleanup remains scoped to the isolated environment and avoids polluting production credentials.