zsxq-shared

Original🇨🇳 Chinese
Translated

Knowledge Planet CLI Shared Basics: Authentication login/logout, view authentication status, diagnose configuration. Triggered when users need to log in for the first time, log out, view authentication status, or encounter authentication errors.

18installs
Added on

NPX Install

npx skill4agent add unnoo/zsxq-skill zsxq-shared

Tags

Translated version includes tags in frontmatter

SKILL.md Content (Chinese)

View Translation Comparison →

zsxq-cli Sharing Rules

This skill guides you on how to operate Knowledge Planet resources via zsxq-cli and what precautions to take.

Authentication

zsxq-cli uses OAuth 2.0 Device Authorization Grant Flow (RFC 8628) for authentication. The token is stored in the system Keychain and is permanently valid.

Login

bash
# Initiate login (an authorization link will be output; users open and authorize it on mobile/browser)
zsxq-cli auth login
Login process:
  1. The command outputs a
    verification_uri
    link and
    user_code
  2. Users open the link on mobile or browser and complete authorization
  3. The CLI automatically polls, and saves the token automatically after authorization is completed
When you help users log in as an AI Agent, run
zsxq-cli auth login
in the background, read the output, provide the authorization link to the user, and wait for the user to complete authorization.

View Authentication Status

bash
zsxq-cli auth status        # Display current logged-in account in table format
zsxq-cli auth status --json # Output in JSON format

Logout

bash
zsxq-cli doctor             # Diagnose whether configuration and authentication are normal

Configuration Diagnosis

bash
zsxq-cli doctor             # Check CLI configuration and keychain authentication status
zsxq-cli config show        # Display version information and current configuration
zsxq-cli config show --json # In JSON format

Direct API Calls

When Shortcuts cannot meet your needs, you can directly call the underlying MCP tools:
bash
zsxq-cli api list                           # List all available MCP tools and parameters
zsxq-cli api call <tool> --params '<json>'  # Call the specified tool
zsxq-cli api raw --method GET --path /v3/users/self
Examples:
bash
zsxq-cli api call get_self_info --params '{}'
zsxq-cli api call search_groups --params '{"keyword":"Go语言"}'
zsxq-cli api call get_user_footprints --params '{"user_id":"123456","group_id":"123456789"}'

# Recommendation: Use the explicit-parameter raw subcommand for general HTTP APIs
zsxq-cli api raw --method GET --path /v2/groups/123456789/topics --query '{"count":10}'

Security Rules

  • Token is the login credential, it is prohibited to output it in plaintext in the terminal or share it with others
  • Must confirm user intent before performing write/delete operations (posting, commenting, creating notes, etc.)
  • When unsure about group_id / topic_id, use query commands to confirm first, then execute write operations

Common Error Handling

ErrorCauseSolution
authentication failed (HTTP 401)
Token is invalid or expiredRe-run
zsxq-cli auth login
not logged in
Login not completedRun
zsxq-cli auth login
--group-id is required
Missing required parameterFirst query group_id with
zsxq-cli group +list
--topic-id is required
Missing required parameterFirst query topic_id with
zsxq-cli group +topics
or
topic +search