cli
LobeHub CLI (@lobehub/cli) development guide — commands, subcommands, architecture.
npx skills add lobehub/lobehub --skill cli --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# LobeHub CLI Development Guide ## Overview LobeHub CLI (`@lobehub/cli`) is a command-line tool for managing and interacting with LobeHub services. Built with Commander.js + TypeScript. - **Package**: `apps/cli/` - **Entry**: `apps/cli/src/index.ts` - **Binaries**: `lh`, `lobe`, `lobehub` (all aliases for the same CLI) - **Build**: tsup - **Runtime**: Node.js / Bun ## Architecture ``` apps/cli/src/ ├── index.ts # Entry point, registers all commands ├── api/ │ ├── client.ts # tRPC client (type-safe backend API) │ └── http.ts # Raw HTTP utilities ├── auth/ │ ├── credentials.ts # Encrypted credential storage (AES-256-GCM) │ ├── refresh.ts # Token auto-refresh │ └── resolveToken.ts # Token resolution (flag > stored) ├── commands/ # All CLI commands (one file per command group) │ ├── agent.ts # Agent CRUD + run │ ├── config.ts # whoami, usage │ ├── connect.ts # Device gateway connection + daemon │ ├── doc.ts # Document management │ ├── file.ts # File management │ ├── generate/ # Content generation (text/image/video/tts/asr) │ ├── kb.ts # Knowledge base management │ ├── login.ts # OIDC Device Code Flow auth │ ├── logout.ts # Clear credentials │ ├── memory.ts # User memory management │ ├─
- Overview
- Architecture
- Command Groups
- Adding a New Command
- 1. Create Command File
- 2. Register in Entry Point
- 3. Add Tests
- Conventions
- Output Patterns
- Table Output
- JSON Output
- Authentication
- Confirmation Prompts
- Storage Locations
Run a command in dev mode (from apps/cli/) cd apps/cli && bun run dev -- <command> This is equivalent to: From cloud repo root bun run dev Server starts on http://localhost:3011 (or configured port) cd apps/cli && bun run dev -- login --server http://localhost:3011 cd apps/cli && bun run dev -- task list cd apps/cli && bun run dev -- task create -i "Test task" -n "My Task" cd apps/cli && bun run dev -- agent list
What does the cli skill do?
LobeHub CLI (@lobehub/cli) development guide — commands, subcommands, architecture.
How do I install it?
Run `npx skills add lobehub/lobehub --skill cli --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From lobehub/lobehub, a repository with 81,252 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.