cli

Documents LobeHub CLI commands, architecture, and development conventions for terminal-based platform management.

Updated Jan 27, 2026
One-click install
npx skills add https://github.com/SmallAi-API/smaihub --skill cli-smallai-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cli
Source: https://github.com/SmallAi-API/smaihub/tree/main/.agents/skills/cli
Command: npx skills add https://github.com/SmallAi-API/smaihub --skill cli-smallai-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers working with the LobeHub CLI (@lobehub/cli) need accurate knowledge of its command groups, authentication flow, workspace scoping, and coding conventions to use or extend the tool without reading the entire codebase. ## Core Features & Use Cases - Command Reference: Covers all command groups including agent, generate, kb, doc, file, memory, topic, message, skill, plugin, model, provider, search, and workspace, with detailed per-command options in the references directory. - Development Guide: Explains how to add new Commander.js commands, register them in the entry point, follow output conventions (--json, --yes, --limit), and write tests. - Auth & Environment Setup: Documents OIDC Device Code Flow login, encrypted credential storage, dev-mode isolation via LOBEHUB_CLI_HOME, and workspace scope resolution order. - Use Case: A developer adding a new lh task command can follow the documented pattern to create the command file, wire up the tRPC client, and test against a local dev server. ## Quick Start Ask the assistant to explain how to add a new command to the LobeHub CLI or how to run a specific command like lh agent run against a local dev server.

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 and follow the standard output conventions like --json and --limit options.

How do I authenticate the LobeHub CLI with a local dev server?

Run bun run dev -- login --server http://localhost:3011 from apps/cli to start the OIDC Device Code Flow. Authorize in the browser, and credentials are saved to apps/cli/.lobehub-dev/ isolated from production config.

How does workspace scope resolution work in the LobeHub CLI?

Scope resolves in order: an explicit --workspace flag, the LOBEHUB_WORKSPACE_ID env var, the scope persisted by lh workspace use, then personal content. The persisted scope is bound to the account and server and is invalidated if either changes.

Why does lh generate download fail with my generation ID?

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

Can I use the LobeHub CLI with API-key auth and workspaces?

API-key auth carries no local account identity, so lh workspace use cannot persist a scope under it. Pass the LOBEHUB_WORKSPACE_ID environment variable instead to target a workspace.