본문으로 건너뛰기
cccskills
무료GitHub에 공개한국어 소개

cli

LobeHub CLI(`@lobehub/cli`)의 명령 구조와 인증, 워크스페이스 규칙을 살펴보고 명령을 추가하거나 유지보수하는 안내서입니다. 표와 JSON 출력, 설정 파일 위치, 로컬 개발 서버 연결 절차도 설명합니다.

원문원문 설명 보기

LobeHub CLI (@lobehub/cli) development guide — commands, subcommands, architecture.

lobehub/lobehub스타 83,504(GitHub 83,504 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • CLI에 명령이나 하위 명령 추가
  • 인증과 워크스페이스 동작 파악
  • 표 또는 JSON 출력 구현
  • 로컬 개발 서버에서 명령 시험

한국어 소개

할 수 있는 일

이 안내서는 LobeHub CLI(@lobehub/cli)의 구성과 명령을 추가하거나 유지보수하는 방법을 설명합니다. 로그인, 에이전트, 작업, 파일, 지식 베이스, 모델, 스킬 등 명령 그룹의 역할을 확인할 수 있습니다. 명령 파일을 만들고 진입점에 등록하는 방법, 표나 JSON으로 출력하는 방법, 인증 토큰을 얻는 방법, 확인 프롬프트를 다루는 방법도 예시와 함께 안내합니다. 워크스페이스 선택 규칙과 설정 파일 저장 위치, 로컬 개발 서버에 연결해 CLI를 실행하는 절차도 다룹니다.

이럴 때 유용합니다

기존 CLI에서 새 기능을 어디에 추가할지 찾거나, 명령마다 출력 및 인증 방식을 맞추고 싶을 때 참고할 수 있습니다. 로컬 환경과 프로덕션 환경의 설정을 구분해 개발하면서 문서에 나온 실행 예시를 확인할 때도 유용합니다.

사용 예시

  • “이 CLI에 새 하위 명령을 추가하는 방법을 알려 주세요.”
  • “이 목록 명령의 JSON 출력을 기존 형식에 맞춰 주세요.”
  • “개발 서버에 연결해 명령을 시험하는 방법을 정리해 주세요.”

주의 사항

CLI는 Node.js 또는 Bun에서 실행됩니다. 로컬 개발 서버를 사용하는 절차에는 서버 시작과 인증이 포함됩니다.

이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.

문서 점검

AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.

안전성전송·삭제·명령 실행 등을 명시하고 있는가
B일부 부족인증과 서버 연결을 다루지만 발췌 자료에는 확인 보호 절차가 충분히 나오지 않습니다.
도입의 용이성필요한 도구나 API 키가 적고 적혀 있는가
B일부 부족Node.js 또는 Bun이 필요하며 로컬 서버 사용에는 서버 시작과 인증도 필요합니다.

점수에는 넣지 않았습니다. 2026년 10월 26일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.

평가가 다르다고 생각되면 재검토를 요청하기

어느 항목이 왜 다르다고 생각하는지 적어 주세요. 로그인은 필요 없습니다. SKILL.md와 대조해 평가를 다시 만들고 이곳에 반영합니다.

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

포함된 파일(11)

  • SKILL.md17.0 KB
  • agents/openai.yaml43 B
  • references/agent.md9.0 KB
  • references/conversation.md4.1 KB
  • references/generate.md14.1 KB
  • references/goal.md9.4 KB
  • references/knowledge.md8.0 KB
  • references/memory.md3.5 KB
  • references/models-providers.md5.7 KB
  • references/search-config.md7.7 KB
  • references/skills-plugins.md3.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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 — parses argv, invokes program.ts
├── program.ts                # Builds the Commander program, registers every command
├── api/
│   ├── acceptance/           # `lh acceptance`: review loop, rounds (run/), plans, criteria, rubrics; `lh verify` aliases
│   ├── client.ts             # tRPC client (type-safe backend API)
│   └── http.ts               # Raw HTTP utilities
├── auth/
│   ├── credentials.ts        # Encrypted credential storage (AES-256-GCM)
│   ├── identity.ts           # Account fingerprint for machine-local state
│   ├── 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
│   ├── agent-group.ts        # Agent group CRUD
│   ├── agent-signal/         # Inspect and trigger Agent Signal source events
│   ├── artifact.ts           # Publish local HTML pages as artifacts
│   ├── bot.ts                # Bot integrations (channels, access policies, messengers)
│   ├── completion.ts         # Shell completion script output
│   ├── config.ts             # whoami, usage
│   ├── connect.ts            # Device gateway connection + daemon
│   ├── device.ts             # Manage connected devices
│   ├── doc.ts                # Document management
│   ├── doctor.ts             # Machine diagnostics (runtime, endpoints, credentials, readiness)
│   ├── eval.ts               # Evaluation workflows & benchmarks
│   ├── file.ts               # File management
│   ├── generate/             # Content generation (text/image/video/tts/asr)
│   ├── goal.ts               # Long-horizon Goal Graphs
│   ├── hetero.ts             # Run heterogeneous agent CLIs, stream their output
│   ├── kb.ts                 # Knowledge base management
│   ├── login.ts              # OIDC Device Code Flow / API key auth
│   ├── logout.ts             # Clear credentials
│   ├── man.ts                # CLI manual pages
│   ├── memory.ts             # User memory management
│   ├── message.ts            # Message management
│   ├── migrate/              # Import data from external tools (OpenClaw, ChatGPT, Claude, etc.)
│   ├── model.ts              # AI model management
│   ├── notify.ts             # Send a callback message to a topic to trigger the agent
│   ├── plugin.ts             # Plugin management
│   ├── project.ts            # Goal-oriented project management
│   ├── provider.ts           # AI provider management
│   ├── search.ts             # Global search
│   ├── session-group.ts      # Agent session group management
│   ├── skill.ts              # Agent skill management
│   ├── status.ts             # Gateway connectivity check
│   ├── task/                 # Agent task management (assignees, checkpoints, deps, review)
│   ├── thread.ts             # Message thread management
│   ├── topic.ts              # Conversation topic management
│   ├── trace/                # Inspect and replay recorded agent execution traces
│   ├── update.ts             # Self-update to the latest published version
│   ├── user.ts               # User account & settings
│   └── workspace.ts          # Workspace list/scope/members/usage/audit
├── daemon/
│   └── manager.ts            # Background daemon process management
├── tools/
│   ├── shell.ts              # Shell command execution (for gateway)
│   └── file.ts               # File operations (for gateway)
├── settings/
│   └── index.ts              # Persistent settings (~/.lobehub/)
├── utils/
│   ├── logger.ts             # Logging (verbose mode)
│   ├── format.ts             # Table output, JSON, timeAgo/timeUntil, truncate
│   └── agentStream.ts        # WebSocket streaming for agent runs and task follow
└── constants/
    └── urls.ts               # Official server & gateway URLs

Command Groups

CommandAliasDescription
lh login-Authenticate via OIDC Device Code Flow or API key
lh logout-Clear stored credentials
lh connect-Device gateway connection & daemon management
lh device-Manage connected devices
lh status-Quick gateway connectivity check
lh doctor-Diagnose machine readiness (runtime, endpoints, credentials, scope, device, agent)
lh agent-Agent CRUD, run, status
lh agent-group-Agent group CRUD
lh agent-signal-Inspect and trigger Agent Signal source events
lh hetero-Run heterogeneous agent CLIs (Claude Code, Codex, etc.), stream their output
lh goal-Run long-horizon Goal Graphs
lh project-Manage goal-oriented projects
lh task-Manage agent tasks (assignees, checkpoints, deps, review)
lh thread-Manage message threads
lh trace-Inspect and replay recorded agent execution traces
lh acceptance-Delivery acceptances: review loop, rounds, per-run check plans, criteria, rubrics
lh verify-Deprecated alias of lh acceptance commands
lh eval-Manage evaluation workflows and benchmarks
lh generategenContent generation (text, image, video, tts, asr, download)
lh doc-Document CRUD, batch-create, parse, topic linking
lh file-File list, view, delete, recent
lh artifact-Publish local HTML pages as artifacts
lh kb-Knowledge base CRUD, folders, docs, upload, tree view
lh memory-User memory CRUD + extraction
lh message-Message list, search, delete, count, heatmap
lh topic-Topic CRUD + search + recent
lh notify-Send a callback message to a topic and trigger the agent to process it
lh migrate-Import data from external tools (OpenClaw, ChatGPT, Claude, etc.)
lh bot-Manage bot integrations (channels, access policies, messengers)
lh skill-Skill CRUD + import (GitHub/URL/market)
lh model-Model CRUD, toggle, batch-toggle, clear
lh provider-Provider CRUD, config, test, toggle
lh plugin-Plugin install, uninstall, update
lh search-Global search across all types
lh session-group-Manage agent session groups
lh workspacewsWorkspace list, scope switch, members, invites, usage
lh user-Manage user account and settings
lh whoami-Current user info (including the resolved workspace scope)
lh usage-Monthly/daily usage statistics
lh man-Show a manual page for the CLI or a subcommand
lh completion-Output shell completion script
lh update-Update the CLI to the latest published version

Workspace Scope

Every command runs against one scope, resolved in this order:

  1. an explicit --workspace <id> on the commands that take it
  2. the LOBEHUB_WORKSPACE_ID env var
  3. the scope persisted by lh workspace use <id|slug>
  4. personal content (no workspace)

The persisted scope is bound to the account and server it was chosen under. If either changes — a different lh login, a --server switch — it is ignored and reported as stale rather than attaching a workspace header the new identity has no membership in. lh logout clears it. lh whoami and lh workspace current both print which of the four sources is in effect.

API-key auth carries no local account identity, so there is nothing to bind a saved scope to — those callers pass LOBEHUB_WORKSPACE_ID instead.

Adding a New Command

1. Create Command File

Create apps/cli/src/commands/<name>.ts:

import type { Command } from 'commander';
import { getTrpcClient } from '../api/client';
import { outputJson, printTable, truncate } from '../utils/format';

export function register<Name>Command(program: Command) {
  const cmd = program.command('<name>').description('...');

  // Subcommands
  cmd
    .command('list')
    .description('List items')
    .option('-L, --limit <n>', 'Maximum number of items', '30')
    .option('--json [fields]', 'Output JSON, optionally specify fields')
    .action(async (options) => {
      const client = await getTrpcClient();
      const result = await client.<router>.<procedure>.query({ ... });
      // Handle output
    });
}

2. Register in Entry Point

In apps/cli/src/index.ts:

import { registerNewCommand } from './commands/new';
// ...
registerNewCommand(program);

3. Add Tests

Create apps/cli/src/commands/<name>.test.ts alongside the command file.

Conventions

Output Patterns

All list/view commands follow consistent patterns:

  • --json [fields] - JSON output with optional field filtering
  • --yes - Skip confirmation for destructive ops
  • -L, --limit <n> - Pagination limit (default: 30)
  • -v, --verbose - Verbose logging

Table Output

const rows = items.map((item) => [item.id, truncate(item.title, 40), timeAgo(item.updatedAt)]);
printTable(rows, ['ID', 'TITLE', 'UPDATED']);

JSON Output

if (options.json !== undefined) {
  const fields = typeof options.json === 'string' ? options.json : undefined;
  outputJson(items, fields);
  return;
}

Authentication

Commands that need auth use getTrpcClient() which auto-resolves tokens:

const client = await getTrpcClient();
// client.router.procedure.query/mutate(...)

Confirmation Prompts

import { confirm } from '../utils/format';
if (!options.yes) {
  const ok = await confirm('Are you sure?');
  if (!ok) return;
}

Storage Locations

FilePathPurpose
Credentials~/.lobehub/credentials.jsonEncrypted tokens (AES-256-GCM)
Settings~/.lobehub/settings.jsonCustom server/gateway URLs
Workspace~/.lobehub/active-workspaceActive scope + the account/server it is bound to
Daemon PID~/.lobehub/daemon.pidBackground process PID
Daemon Status~/.lobehub/daemon.status.jsonConnection status JSON
Daemon Log~/.lobehub/daemon.logDaemon output log

The base directory (~/.lobehub/) can be overridden with the LOBEHUB_CLI_HOME env var (e.g. LOBEHUB_CLI_HOME=.lobehub-dev for dev mode isolation).

Key Dependencies

  • commander - CLI framework
  • @trpc/client + superjson - Type-safe API client
  • @lobechat/device-gateway-client - WebSocket gateway connection
  • @lobechat/local-file-shell - Local shell/file tool execution
  • picocolors - Terminal colors
  • ws - WebSocket
  • diff - Text diffing
  • fast-glob - File pattern matching

Development

Running in Dev Mode

Dev mode uses LOBEHUB_CLI_HOME=.lobehub-dev to isolate credentials from the global ~/.lobehub/ directory, so dev and production configs never conflict.

# Run a command in dev mode (from apps/cli/)
cd apps/cli && bun run dev -- <command>

# This is equivalent to:
LOBEHUB_CLI_HOME=.lobehub-dev bun src/index.ts <command>

Connecting to Local Dev Server

To test CLI against a local dev server (e.g. localhost:3011):

Step 1: Start the local server

# From cloud repo root
bun run dev
# Server starts on http://localhost:3011 (or configured port)

Step 2: Login to local server via Device Code Flow

cd apps/cli && bun run dev -- login --server http://localhost:3011

This will:

  1. Call POST http://localhost:3011/oidc/device/auth to get a device code
  2. Print a URL like http://localhost:3011/oidc/device?user_code=XXXX-YYYY
  3. Open the URL in your browser — log in and authorize
  4. Save credentials to apps/cli/.lobehub-dev/credentials.json
  5. Save server URL to apps/cli/.lobehub-dev/settings.json

After login, all subsequent bun run dev -- <command> calls will use the local server.

Step 3: Run commands against local server

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

Troubleshooting:

  • If login returns invalid_grant, make sure the local OIDC provider is properly configured (check OIDC_* env vars in .env)
  • If you get UNAUTHORIZED on API calls, your token may have expired — run bun run dev -- login --server http://localhost:3011 again
  • Dev credentials are stored in apps/cli/.lobehub-dev/ (gitignored), not in ~/.lobehub/

Switching Between Local and Production

# Dev mode (local server) — uses .lobehub-dev/
cd apps/cli && bun run dev -- <command>

# Production (app.lobehub.com) — uses ~/.lobehub/
lh <command>

The two environments are completely isolated by different credential directories.

Build & Test

# Build CLI
cd apps/cli && bun run build

# Unit tests
cd apps/cli && bun run test

# E2E tests (requires authenticated CLI)
cd apps/cli && bunx vitest run e2e/kb.e2e.test.ts

# Link globally for testing (installs lh/lobe/lobehub commands)
cd apps/cli && bun run cli:link

Detailed Command References

See references/ for each command group:

  • Agent: references/agent.md (CRUD, run, status)
  • Goals: references/goal.md (planning turn, state, events, lifecycle, decisions)
  • Content Generation: references/generate.md (text, image, video, tts, asr, download)
  • Knowledge & Files: references/knowledge.md (kb, file, doc)
  • Conversation: references/conversation.md (topic, message)
  • Memory: references/memory.md (memory management, extraction)
  • Skills & Plugins: references/skills-plugins.md (skill, plugin)
  • Models & Providers: references/models-providers.md (model, provider)
  • Search & Config: references/search-config.md (search, whoami, usage, workspace)

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

acceptance

무료요약 있음

실제 제품을 적절한 조작 환경에서 실행해 변경 사항을 검증하고, 사용자가 확인할 수 있는 증거를 모아 인수 보고서로 게시합니다. 기존 검증 계획을 확인하거나 점검 항목을 만들고, `lh` CLI로 결과를 게시할 수 있습니다.

  • 변경된 제품 동작을 실제로 확인하기
  • 스크린샷 등 검증 증거 수집하기
  • 검증 계획과 보고서 작성하기
lobehub/lobehub8.4만2026년 10월 26일 업데이트

add-model-provider

무료요약 있음

LobeHub에 AI 모델 제공자를 추가하는 과정을 안내합니다. 런타임 연동, 모델 정보와 설정, 브랜드 표시, 문서화 및 인수 확인을 다루며, 기존 제공자에 모델만 추가하는 경우와 새 연동이 필요한 경우를 구분합니다.

  • LobeHub에 새 AI 모델 제공자 추가하기
  • 제공자의 설정 안내나 설명 갱신하기
  • 모델 추가에 새 제공자 연동이 필요한지 판단하기
lobehub/lobehub8.4만2026년 10월 26일 업데이트

add-setting-env

무료요약 있음

서버 환경 변수로 사용자 설정의 기본값을 지정하도록 구현하는 절차를 안내합니다. 변수 검증, 서버 설정 구성, 사용자 저장소 반영부터 예시 환경 파일과 셀프 호스팅 문서 갱신까지 다룹니다.

  • 환경 변수로 사용자 설정 기본값 지정
  • 설정을 서버 구성과 사용자 저장소에 연결
  • 환경 변수 예시와 문서 갱신
lobehub/lobehub8.4만2026년 10월 26일 업데이트

agent-runtime-hooks

무료요약 있음

에이전트 실행 단계, 도구 호출, 사람의 승인, 컨텍스트 압축, 하위 에이전트 호출에 훅을 등록하는 방법을 안내합니다. 이벤트를 관찰하고 로컬 도구 결과를 모의하거나 설정에 따라 웹훅으로 도구 호출을 허용 또는 거부할 수 있습니다.

  • 에이전트 단계와 오류 기록
  • 테스트 중 도구 결과 모의
  • 웹훅으로 도구 호출 허용 또는 거부
lobehub/lobehub8.4만2026년 10월 26일 업데이트

agent-signal

무료요약 있음

에이전트의 이벤트 기반 백그라운드 작업을 설계하고 구현하도록 돕습니다. 소스, 시그널, 액션, 정책의 역할을 나누고 비동기 처리, 중복 실행 방지, 완료 기록과 관측 기능을 다룹니다.

  • 이벤트로 시작되는 백그라운드 작업 추가
  • 대화 요청과 작업을 분리
  • 액션의 중복 실행 방지
lobehub/lobehub8.4만2026년 10월 26일 업데이트

agent-testing-bot

무료요약 있음

실제 데스크톱 채팅 앱에서 봇 채널의 인수 테스트를 진행합니다. Discord, Slack, Telegram, WeChat, Lark, QQ에서 메시지를 보내고 응답을 기다린 뒤 결과 화면을 캡처합니다. iMessage는 BlueBubbles 브리지를 사용합니다.

  • 실제 Discord 채널에서 봇 응답 확인하기
  • Slack이나 Telegram 대화 경로 테스트하기
  • macOS 앱의 작업 결과 화면으로 기록하기
lobehub/lobehub8.4만2026년 10월 26일 업데이트

lobehub의 스킬 모두 보기

이 스킬의 문제 신고