apps/cli/README.md
LobeHub command-line interface.
| Task | Command |
|---|---|
| Run in dev mode | bun run dev -- <command> |
| Build the CLI | bun run build |
Link lh/lobe/lobehub into your shell | bun run cli:link |
| Remove the global link | bun run cli:unlink |
bun run build only generates dist/index.js.lh available in your shell, run bun run cli:link.lh, run rehash in zsh.By default the CLI connects to https://app.lobehub.com. To point it at a different server (e.g. a local instance):
| Method | Command | Persistence |
|---|---|---|
| Environment variable | LOBEHUB_SERVER=http://localhost:4000 bun run dev -- <command> | Current command only |
| Login flag | lh login --server http://localhost:4000 | Saved to ~/.lobehub/settings.json |
Priority: LOBEHUB_SERVER env var > settings.json > default official URL.
| Shell | Command |
|---|---|
zsh | source <(lh completion zsh) |
bash | source <(lh completion bash) |
| Shell | Command |
|---|---|
zsh | source <(bun src/index.ts completion zsh) |
bash | source <(bun src/index.ts completion bash) |
lh agent <Tab> shows agent subcommands instead of top-level commands.source <(...) command to reload it in the current shell session.lh binary by itself.which lh
lh --help
lh agent <TAB>