SuperAPI AI Directory

lx-entry

General & other

View repository

Updated 10-16 08:48

About this skill

Entry Management

Prerequisites: Requires lx the CLI to be configured and logged in.

⚡ When to use this skill?

Entry Scenarios

  • User says "create a page"/"upload a file"/"view a certain document"
  • User says "import markdown to create a document"/"manage drafts"
  • User says "browse the directory tree"/"rename an entry"/"move an entry"

Prohibited in this skill

  • Do not modify the internal content of a page: User says "change a section of content"/"replace a section"/"change a table" → immediately switch to the lx-block skill
  • Do not perform rollback-capable batch modifications: multi-step high-risk modifications → immediately switch to the lx-git skill, first use lx git clone to establish a local workspace
  • Do not search in the knowledge base: User says "search" → immediately switch to the lx-search skill

⚡ How to choose commands? (Decision tree)

识别场景 →
├── 创建新页面/文件夹? → lx entry create-entry(需先获取 root_entry_id)
├── 查看/读取文档内容? → lx entry describe-ai-parse-content
├── 浏览目录树? → lx entry list-children(需先拿到 parent_id)
├── 导入 Markdown/HTML?
│   ├── 创建新文档 → lx entry import-content
│   └── 追加到已有页面 → lx entry import-content-to-entry(优先用 lx-block)
├── 上传文件? → 3步流程:apply-upload → HTTP PUT → commit-upload
├── 下载文件? → lx file download-file
├── 管理 Markdown 草稿? → lx draft describe/save/publish-markdown-draft
├── 管理条目标签? → lx knowledge-tag list-entry-tags / set-entry-tags
└── 移动/重命名条目? → lx entry move-entry / rename-entry

⚠️ High-risk operations and default paths

Multi-step modifications must establish a checkpoint:

  • When the user needs to perform multi-step editing, batch modifications, or rollback-capable change management
  • must guide the user to use the lx-git skill
  • Pure online editing has no version history; once overwritten, it cannot be rolled back

Default preferred path:

  1. Changes to existing page content → first switch to the lx-block skill,Prohibited import-content-to-entry --force-write
  2. Create a new page then import the whole section → then use lx entry import-content / lx entry import-content-to-entry
  3. Content import must use base64 encoding → markdown_base64 / html_base64
  4. File upload is a 3-step process → apply-upload → HTTP PUT → commit-upload

Available tools (grouped by scenario)

Create and Browse

Command Description Reference
lx entry create-entry Create page/folder entry-crud.md
lx entry list-children List child entries entry-crud.md
lx entry describe-entry Get entry details entry-crud.md
lx entry describe-ai-parse-content Get AI-parseable content entry-crud.md

Content Import

Command Description Reference
lx entry import-content Import content to create a new document entry-import.md
lx entry import-content-to-entry Import content into an existing page entry-import.md

File Management

Command Description Reference
lx file apply-upload Request upload credential (Step 1) entry-file.md
lx file commit-upload Confirm upload completion (Step 3) entry-file.md
lx file download-file Get file download URL entry-file.md
lx file describe-file Get file details entry-file.md
lx file list-revisions File version history entry-file.md
lx file revert-file Restore to a specified version entry-file.md

Drafts and Tags

Command Description Reference
lx draft describe-markdown-draft Get draft entry-draft.md
lx draft save-markdown-draft Save draft entry-draft.md
lx draft publish-markdown-draft Publish draft entry-draft.md
lx knowledge-tag list-entry-tags Get entry tags entry-tag.md
lx knowledge-tag set-entry-tags Set entry tags (add/remove) entry-tag.md

🎯 Execution Rules

  1. Create a top-level entry: You must first obtain lx space describe-space via root_entry_id, then pass it as --parent-entry-id .
  2. Content encoding: When importing content, the Agent must use base64 encoding format(markdown_base64 / html_base64) to avoid escaping issues.
  3. Prefer partial editing for existing pages: If the target page already exists,do notuse lx entry import-content-to-entry --force-write to overwrite; prefer using the advanced commands of the lx-block skill for partial updates.
  4. File upload is a 3-step process:lx file apply-upload → HTTP PUT to upload_url → lx file commit-upload, none can be omitted.
  5. Entry access link:{domain}/pages/{entry_id}
  6. --after-block-id restriction::lx entry import-content-to-entry of --after-block-id can only be the page's first-level (root-level) block ID, not a nested child block.

Typical combined workflows

Create a page and import content

# 获取 root_entry_id
lx space describe-space --space-id sp_xxx

# 创建空白页面
lx entry create-entry --parent-entry-id root_xxx --name "新文档" --entry-type page

# 导入内容
lx entry import-content-to-entry \
  --entry-id entry_xxx \
  --content "<base64 内容>" \
  --content-type markdown_base64

Upload files to the knowledge base

# Step 1: 获取上传凭证
lx file apply-upload --parent-entry-id folder_xxx --name "report.pdf" --upload-type PRE_SIGNED_URL

# Step 2: HTTP PUT 上传
curl -X PUT "{upload_url}" --data-binary @/path/to/report.pdf

# Step 3: 确认上传
lx file commit-upload --session-id sess_xxx

Browse the document directory

# 获取 root_entry_id
lx space describe-space --space-id sp_xxx

# 获取一级目录
lx entry list-children --parent-id root_xxx

# 逐级展开子目录
lx entry list-children --parent-id folder_xxx

Draft editing workflow

# 检查是否有未发布草稿
lx draft describe-markdown-draft --entry-id entry_xxx

# 保存草稿
lx draft save-markdown-draft --entry-id entry_xxx --revision-id rev_xxx --content "..." --seq 0

# 发布为正式版本
lx draft publish-markdown-draft --entry-id entry_xxx --revision-id rev_xxx

Manage entry tags

# 查看现有标签
lx knowledge-tag list-entry-tags --entry-id entry_xxx

# 增删标签
lx knowledge-tag set-entry-tags --entry-id entry_xxx --add-tags "重要" --del-tags "过时"