cli

Documents LobeHub CLI commands, architecture, and development conventions for Commander.js-based tooling.

74|11|Updated Jul 4, 2024
One-click install
npx skills add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill cli-opensourceagi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli
Source: https://github.com/OpenSourceAGI/qwksearch-research-agent/tree/main/apps/qwk-in-lobe/.agents/skills/cli
Command: npx skills add https://github.com/OpenSourceAGI/qwksearch-research-agent --skill cli-opensourceagi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers working on the LobeHub CLI (@lobehub/cli) need a single reference covering its command structure, tRPC-based architecture, authentication flow, and coding conventions to add or modify commands consistently. ## Core Features & Use Cases - Command Reference: Detailed documentation for all command groups including agent, generate, kb, doc, file, memory, model, provider, skill, plugin, topic, message, and search. - Development Guide: Step-by-step instructions for adding new commands, registering them in the entry point, and writing tests. - Auth & Dev Workflow: Covers OIDC Device Code Flow login, encrypted credential storage, and isolated dev mode via LOBEHUB_CLI_HOME. - Use Case: When adding a new CLI command, follow the documented pattern of creating a command file in apps/cli/src/commands/, registering it in index.ts, and adding tests alongside. ## Quick Start Ask the assistant to explain how to add a new command to the LobeHub CLI or to look up the options for a specific lh command such as lh agent run.

Frequently Asked Questions about cli

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

FAQPage Schema
How do I add a new command to the LobeHub CLI?

Create a command file in apps/cli/src/commands/ exporting a register function that uses Commander.js, then import and call it in apps/cli/src/index.ts. Add a test file alongside the command following the existing conventions.

How does LobeHub CLI authentication work?

The CLI uses OIDC Device Code Flow via the lh login command. Tokens are stored encrypted with AES-256-GCM in ~/.lobehub/credentials.json and auto-refreshed, with getTrpcClient() resolving tokens for authenticated API calls.

How do I test the LobeHub CLI against a local dev server?

Run bun run dev -- login --server http://localhost:3011 from apps/cli to authenticate against the local server. Dev mode uses LOBEHUB_CLI_HOME=.lobehub-dev to isolate credentials from the production ~/.lobehub/ directory.

Why does lh generate download fail with my generation ID?

The download and status commands require the asyncTaskId, a UUID printed after '→ Task' in the image or video output, not the gen_xxx generation ID. Passing the generation ID causes a server error.

What output formats do LobeHub CLI commands support?

Most list and view commands support --json with optional field filtering, table output via printTable, -L/--limit for pagination, and --yes to skip confirmation prompts on destructive operations.