SuperAPI AI Directory

flowus-cli

Coding & development

View repository

Updated 10-16 09:34

About this skill

FlowUs CLI

Use the FlowUs CLI (flowus) to interact with the FlowUs V2 API, manage pages, blocks, databases, search, Markdown page content, and files.

Do not assume old FlowUs skill names such as flowus-auth, flowus-page, or flowus:flowus-login.

Look things up before answering

The CLI is self-documenting. Always prefer running these commands over guessing syntax or relying on memorized knowledge:

  • flowus --help - list global options and top-level commands.
  • flowus help <command...> - show usage, options, examples, and agent notes for any command or subcommand.
  • flowus --json doctor - inspect local authentication and configuration state when auth or base URL selection is unclear.
  • flowus --json whoami - verify the active FlowUs identity.
  • flowus --json markdown get <page-id> - retrieve page content as Markdown. Use this to read page content.

Install

The installer downloads the standalone flowus binary and does not require npm or Node.js on the target machine.

curl -fsSL https://cdn2.flowus.cn/flowus-cli/install | bash

Use FLOWUS_INSTALL_DIR=/path/to/bin to choose the install directory, or FLOWUS_VERSION=v0.1.6 to install a specific release.

Authentication

  • The CLI automatically uses FLOWUS_TOKEN when it is set.
  • Check FLOWUS_TOKEN first. If it is already set, prefer using it instead of telling the user to run flowus login.
  • Credential precedence: --token, then FLOWUS_TOKEN, then saved login credentials.
  • Base URL precedence: --base-url, then FLOWUS_BASE_URL, then saved login base URL, then the default API URL.
  • Saved credentials live at ~/.flowus/credentials.json by default. FLOWUS_CONFIG_DIR changes the directory.
  • flowus login / flowus logout - log the CLI in or out. Use flowus login --browser for desktop OAuth sessions and flowus login --manual for SSH, server, headless, and CI environments.

Safety and output rules

  • Use --json for stable machine-readable stdout.
  • Human diagnostics and warnings belong on stderr.
  • Keep JSON request bodies in local files and pass them with --body <file>.
  • Keep Markdown replacement content in local files and pass it with --file <file>.
  • Do not print or save bearer tokens outside the FlowUs CLI credential store.
  • Do not call the FlowUs V2 API with curl; use flowus --json api call only when no domain command covers the operation.
  • Before create, update, replace, or append operations, confirm IDs, file paths, URLs, and body files come from user-authorized input.
  • The CLI does not support FlowUs data deletion commands.
  • markdown put is destructive because it replaces page content.

flowus api

Run flowus help api, flowus help api ls, and flowus help api call for full syntax. Prefer domain commands when one exists. Use api ls to discover public endpoints and api call for documented endpoints not yet wrapped by the CLI.

# List supported public endpoints
flowus api ls

# GET
flowus --json api call GET /v2/users/me

# GET with path params
flowus --json api call GET /v2/users/:user_id --param user_id=u1

# PATCH with JSON body and header
flowus --json api call PATCH /v2/pages/:page_id \
  --param page_id=p1 \
  --body patch.json \
  --header 'If-Match=W/"version"'

Pages, blocks, and databases

Use domain commands for common FlowUs objects. Run flowus help <command...> before constructing write commands.

# Pages
flowus --json page get <page_id>
flowus --json page create --body page.json
flowus --json page update <page_id> --body patch.json

# Blocks
flowus --json block get <block_id>
flowus --json block children <block_id>
flowus --json block append <block_id> --body children.json
flowus --json block update <block_id> --body patch.json

# Databases
flowus --json database get <database_id>
flowus --json database query <database_id> --body query.json
flowus --json database create --body database.json
flowus --json database update <database_id> --body patch.json

Markdown page content

Prefer flowus markdown get / flowus markdown put for large page content. Use block commands for precise block-level edits.

# Read a page as Markdown
flowus --json markdown get <page_id>

# Replace a page from a Markdown file
flowus --json markdown put <page_id> --file page.md

markdown put replaces page content. Confirm the page ID and Markdown file path come from user-authorized input before using it.

Search

Use text search for exact words, titles, and known phrases. Use semantic search for intent or meaning.

flowus --json search text "roadmap" --page-size 10
flowus --json search semantic "pages about quarterly planning"

Both commands also accept --body <file> for advanced JSON search payloads.

Files

Uploading creates a FlowUs-hosted file object. Append the returned oss_name and size to a block with block append-file; --size is required with --oss-name. Use external URLs only when the file should stay hosted outside FlowUs storage, and do not pass --size for external URLs.

flowus --json file upload ./roadmap.pdf --parent-page <page_id>
flowus --json block append-file <block_id> --oss-name <oss_name> --size <bytes>
flowus --json block append-file <block_id> --external-url https://example.com/file.pdf