Flowus CLI
Use when an agent needs to call the FlowUs API through the FlowUs CLI, authenticate FlowUs, upload a file, create or update a page, query a database, search content, edit Markdown page content, or any task involving the `flowus` command.
- Skill ID
- next-space/flowus-skill/flowus-cli
- Publisher
- next-space
- Repository
- flowus-skill
- Installs
- 0
- Files
- 2
- Synced
- Sep 23, 2026
Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.
next-space/flowus-skill/flowus-cliInstalls these files- SKILL.md
- agents/openai.yaml
What this skill tells the agent
FlowUs CLI
Use the FlowUs CLI (flowus) for FlowUs V2 API work: pages, blocks, databases, search, Markdown content, and files.
The CLI source repository may be private. Do not ask the user to clone source code before using the CLI. Install or update the released binary from the official FlowUs CDN only after the user explicitly approves it.
Mandatory preflight
Complete this preflight before a remote FlowUs API call. CLI help, endpoint documentation, and offline planning do not require authentication.
- Inspect whether the CLI is available without installing or updating it:
if command -v flowus >/dev/null 2>&1; then
flowus version
else
echo "FlowUs CLI is not installed"
fiIf the CLI is missing or outdated, explain that the official installer is available at https://cdn2.flowus.cn/flowus-cli/install (or https://cdn2.flowus.cn/flowus-cli/install.ps1 on Windows). Do not download, execute, or update it until the user explicitly approves that action.
After approval, use only the official URL and a user-approved version. Download an installer to a temporary file; show its source, version, and SHA-256 hash; and compare it with an official checksum or signature before execution. If no official integrity data is available, stop and offer manual installation rather than executing an unverified installer. Remove temporary installer files after the attempt.
- If the CLI is installed, inspect authentication and active identity:
flowus --json doctor
flowus --json whoamiContinue only when the checks show authenticated FlowUs credentials. If authentication is missing or invalid, do not start a login flow automatically. Explain the available options and wait for the user's explicit choice:
- If
FLOWUS_TOKENis already set, rerunflowus --json doctorandflowus --json whoami; do not ask for another login. - Browser login:
flowus login --browser. - Manual setup for headless environments:
flowus --json login --manual. - Configure
FLOWUS_TOKENor saved credentials through an approved secret channel.
Do not run plain flowus login in agent sessions because it can block on an interactive method prompt. Do not make API calls or draw conclusions from incomplete data until authentication is verified. After the user explicitly approves a login method, run only that selected method and then rerun flowus --json doctor and flowus --json whoami.
Use this browser login command only after the user explicitly selects browser login:
flowus login --browserUse manual setup only after the user explicitly selects it for a headless or remote environment:
flowus --json login --manualIf a command is missing or help output looks stale, explain that flowus update can update the CLI and wait for explicit user approval before running it.
Useful install overrides:
FLOWUS_INSTALL_DIR- install directory.FLOWUS_VERSION- exact release version, such asv0.1.10.FLOWUS_CLI_RELEASE_BASE_URL- alternate release base URL for tests.
First rule: ask the CLI
The CLI is self-documenting. Prefer these commands over guessing syntax or request fields:
flowus --help- list global options and top-level commands.flowus help <command...>- show usage, options, examples, and notes for any command or subcommand.flowus api ls- list public API endpoints and request field hints.flowus api ls --plain- compact endpoint list for scanning.flowus api --docs <PATH> -X <METHOD>- show agent-readable Markdown docs for one endpoint, including parameters, examples, and safety notes.flowus api --spec <PATH> -X <METHOD>- show the exact embedded OpenAPI fragment for one endpoint.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 workspace- inspect the current workspace and credential boundary.flowus --json workspace directory- list the favorites, team, shared, and private sidebar sections.flowus --json fetch <link-or-id>- resolve a FlowUs link or ID and read the matching page, database, or block.flowus markdown get <page-id>- retrieve page content as Markdown.
If you are unsure about syntax, request body fields, pagination, auth source, or command coverage, run help first.
Credentials and configuration
The CLI resolves credentials in this precedence order:
--token <token>FLOWUS_TOKEN- saved login credentials in the FlowUs credential store
This is CLI resolution behavior, not authorization to expose a credential. Do not pass --token in agent commands, logs, or shared shells: it can leak via process listings or shell history. Do not ask users to paste bearer tokens into chat. Use preconfigured FLOWUS_TOKEN, saved credentials, or an approved secret channel; redact any credential that appears in command output.
If no credential is configured, offer browser login, manual setup, or an approved secret path and wait for the user to select one. After the selected login succeeds, rerun flowus --json doctor and flowus --json whoami.
OAuth refresh and sandbox permissions
A saved browser-OAuth credential may require write access to the credential store even for a read-only API command, because the CLI rotates and atomically persists tokens before sending the API request.
- If
error.codeiscredential_store_permission_deniedorneedsCredentialWritePermissionistrue, do not start login. Request narrowly scoped write access to the directory containingcredentialsPath, then rerunflowus --json doctorand the original command. Reauthentication cannot fix a local filesystem denial. - If the error code is
oauth_refresh_failedoroauth_refresh_rejectedandreauthorizationRequiredisfalse, retry the same command later; do not start login. - Offer login only when
reauthorizationRequiredorrefreshTokenExpiredistrue, or OAuth explicitly reports that the refresh token is invalid, expired, or revoked. - Older CLI versions may report only
Operation not permittedor OS error 1. With stored, refreshable OAuth credentials, treat this as probable credential-store sandbox denial and inspect the reported path and sandbox before assuming the token is revoked.
Never copy credentials.json into the workspace or expose its contents.
Common environment variables:
FLOWUS_TOKEN- bearer token for API calls.FLOWUS_BASE_URL- API base URL; default ishttps://api.flowus.cn.FLOWUS_CONFIG_DIR- config directory; default follows the FlowUs profile.FLOWUS_USER_AGENT- custom user agent suffix.
Do not print bearer tokens, write them into files, or paste them into request bodies. Do not call the FlowUs V2 API with curl; use the CLI so auth, product defaults, retries, and error formatting stay consistent.
Working rules
- Use
--jsonfor stable machine-readable stdout. - 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>. - Prefer domain commands over
api call;flowus api --docsnames a recommended domain command when one exists. - For paginated commands, inspect JSON output for cursors and repeat with the command's cursor option.
Write safety
Before any remote create, update, append, upload, replace, or raw API write:
- Confirm the exact target, operation, and expected impact (including record count, affected blocks, or uploaded files).
- Read the current target first when feasible. For a Markdown replacement, compare the existing content unless the user explicitly authorized a full replacement. Use
--if-matchwhen the CLI exposes a version or ETag. - If the user did not provide both an exact target and the intended content,
Use this skill in a project
Open any RiverX project, search the Skills panel for next-space/flowus-skill/flowus-cli, and install it in one click.
