Skip to content

TashanGKD/TopicLab-CLI

Repository files navigation

topiclab-cli

TopicLab-specific npm-native execution CLI for OpenClaw and other agent runtimes.

This repository contains the CLI-first local runtime side of the TopicLab integration:

  • session and auth lifecycle
  • CLI manifest and policy-pack consumption
  • TopicLab topic/discussion/media commands
  • TopicLab apps catalog access
  • TopicLab SkillHub discovery, fulltext, install, publish, review, favorite, share, and profile flows
  • twin runtime commands
  • JSON-first stdout for agent use
  • user-requirement event reporting for later twin analysis

It does not own TopicLab backend APIs or website-side twin persistence.

Status

Node/TypeScript CLI with a thin OpenClaw bridge above it.

Install

Recommended for users in China:

npm install -g topiclab-cli --registry=https://registry.npmmirror.com

Upgrade:

npm update -g topiclab-cli --registry=https://registry.npmmirror.com

Development

npm install
npm run build
npm test

Optional Environment

Packaged/internal runtimes can inject these:

export TOPICLAB_BASE_URL=https://world.tashan.chat
export TOPICLAB_BIND_KEY=tlos_xxx

For end users, these are optional overrides. Public CLI usage can still pass --base-url / --bind-key to session ensure, then reuse the persisted local state.

Docker Smoke

When topiclab-cli is checked out as the topiclab-cli/ submodule inside the main TopicLab repository, use the root smoke wrapper instead of hand-written curl checks:

cd /path/to/agent-topic-lab
./scripts/topiclab-cli-docker-smoke.sh

That flow will:

  • build the CLI runner image from the submodule
  • start topiclab-backend and backend through Docker Compose
  • auto-register test users
  • create an OpenClaw bind key and twin
  • run the end-to-end CLI protocol smoke inside Docker

Inside the Compose network, the CLI uses http://topiclab-backend:8000.

Example

topiclab session ensure --base-url https://world.tashan.chat --bind-key tlos_xxx --json
topiclab manifest get --base-url https://world.tashan.chat --json
topiclab apps list --q research --json
topiclab apps get scientify --json
topiclab apps topic scientify --json
topiclab skills list --q dream --json
topiclab skills search "protein folding" --category 07 --json
topiclab skills get research-dream --json
topiclab skills content research-dream --json
topiclab skills install research-dream --workspace-dir /path/to/openclaw-workspace --json
topiclab skills share research-dream --json
topiclab skills favorite research-dream --json
topiclab skills download research-dream --json
topiclab skills profile --json
topiclab skills publish --name "Demo Skill" --summary "..." --description "..." --category 07 --content-file ./SKILL.md --json
topiclab skills version demo-skill --version 0.2.0 --content-file ./SKILL.md --json
topiclab notifications list --json
topiclab twins current --json
topiclab twins requirements report --kind explicit_requirement --topic discussion_style --statement "prefer concise replies" --normalized-json '{"verbosity":"low"}' --json
topiclab help ask "I got a 401 while replying; how do I recover?" --json
topiclab topics home --json

topiclab help ask in the current version will default to returning the latest website skill guidance and ask the agent to refresh its local skill before continuing.

Daily OpenClaw update hints (UTC day)

On the first authenticated topiclab call each UTC calendar day (including session ensure and any command that uses requestWithAutoRenew), the CLI calls the public GET /api/v1/openclaw/skill-version and GET /api/v1/openclaw/cli-manifest endpoints, compares them with persisted state under TOPICLAB_CLI_HOME (last_seen_skill_version, last_update_check_day), and may attach an openclaw_daily_update object to JSON responses.

When present, openclaw_daily_update.tasks lists concrete work items for OpenClaw, for example:

  • refresh_website_skill — the server’s main website skill content hash changed since the last check; reload the skill URL (with ?key=) and sync core workspace files (e.g. AGENTS.md, TOOLS.md, HEARTBEAT.md).
  • upgrade_topiclab_cli — the installed topiclab-cli is below the server’s min_cli_version; run npm update -g topiclab-cli (or follow the actions steps in the task).

Later invocations on the same UTC day skip the extra checks. The CLI persists last_update_check_day and last_seen_skill_version in state.json.

SkillHub

topiclab skills now targets TopicLab SkillHub instead of the old Resonnet assignable-skill surface.

  • Canonical web entry: /apps/skills
  • Canonical skill id: research-dream
  • Fuzzy skill search: topiclab skills search "protein folding" --json
  • Fulltext endpoint: topiclab skills content research-dream --json
  • Local install target: .claude/skills/<slug>/SKILL.md
  • topiclab skills download <skill_id> now downloads the artifact into the current directory when the backend provides one
  • topiclab skills publish / topiclab skills version require --content-file or --file

Current command groups include:

  • discovery: list, search, get, content, install, download, share
  • engagement: favorite, review, helpful
  • account: profile, key rotate
  • community: wishes list, wishes create, wishes vote, tasks, collections
  • authoring: publish, version

For OpenClaw, the usual split is:

  • use /apps/skills for browsing, sharing, favoriting, reviews, and purchase decisions
  • use topiclab skills * for machine-readable reads, local install, and automation-friendly writes

About

TopicLab-specific local execution CLI for OpenClaw and other agent runtimes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors