sxq. You can edit the project in your preferred IDE or with an AI coding agent, push changes back, build a preview, and deploy to production.
The CLI shares its name with superun’s in-product AI assistant, Suxiaoqiang, but they are different things. The assistant provides guidance in superun; the
sxq command manages a project from your terminal.Before you start
You need:- Node.js 18 or later;
- access to the superun project you want to link;
- the project’s
sessionId, shown in its superun project URL.
Install and log in
sxq login opens a browser for authorization and exchanges the temporary credential for a PAT. Starting with v1.1.2, it saves login credentials in macOS Keychain, Windows Credential Manager, or Linux Secret Service by default. Credentials are scoped to the API base URL. You can still import an existing token:
sxq login --pat, or through standard input using sxq login --stdin. The saved credential is replaced only after online validation succeeds. SUPERUN_PAT overrides the saved credential; when set, sxq login validates it without opening a browser or saving it locally. Empty or malformed values fail explicitly. Unset the variable to use the saved credential. Avoid passing PATs as command-line arguments that can appear in shell history.
On headless Linux without a session D-Bus, the CLI falls back to a local plaintext credential file and warns you; its Unix file mode is 0600. A locked, unreadable, or broken system store stops the command instead of silently switching to plaintext. Unlock or repair the store, or inject SUPERUN_PAT from a secret manager. Keep npm optional dependencies enabled when installing the CLI so its native platform binding is available.
If the system store is usable but empty, log in again. The CLI does not read or migrate old plaintext tokens and removes the current host’s old plaintext login credential. sxq logout deletes the current API environment’s credential from the selected local store. It does not revoke the server PAT or unset SUPERUN_PAT.
Personal access tokens (PAT)
Create, set an expiry, and delete personal access tokens in your account (follow the in-product entry). Use them so the CLI, scripts, or third-party tools can call open APIs as you.- When you create a token you can pick 30 / 90 / 365 days, or never expire.
- The plaintext token is shown only once at creation — copy it immediately. Later lists never show the secret again.
- Deleting a token in the account invalidates any copy already stored in the CLI or
SUPERUN_PAT; create a new token and sign in again. sxq logoutonly clears the local credential. It does not revoke the server token. To retire a token, delete it in the account.
sxq login --pat, --stdin, or SUPERUN_PAT).
CLI updates
Starting with v1.1.1, the CLI checks npm update policy on the first command each day.latest prompts for an update; if the installed version is below the maintainer’s required tag, the CLI upgrades automatically and reruns the original command. sxq upgrade, sxq logout, --version, and --help remain directly available. Registry outages retain the cached policy; clients without a cache proceed. This policy cannot govern older CLI versions that do not contain the upgrade gate.
Link and pull a project
Create an empty directory, link it to the remote project, and pull its files:Work safely with Git
.sxq/attachments.json stores the remote baseline last synchronized in the current directory; it is not a Git index. The .sxq/ directory is intentionally excluded from Git, so switching branches changes the source files without switching this baseline. Files that are older, different, or absent on the new branch can look like intended modifications or deletions even when nobody changed or removed them manually.
Git projects allow pushes only from main by default. If the project uses another primary branch, configure it with:
sxq link and sxq pull separately in every worktree so each directory maintains its own .sxq baseline. Never copy .sxq between repositories, worktrees, branches, or partial source directories, and never force-add it to Git.
sxq push -f bypasses only the branch restriction; it does not prove that the current files match your intent. Use it only after confirming the exact branch and reviewing the complete plan. It cannot bypass safety checks for reset, rebase, rewritten history, or a mismatched worktree.
Edit and push changes
After editing locally, push the changes back to superun:sxq push pulls remote changes first. If a file cannot be merged cleanly, the command stops and writes Git-style <<<<<<<, =======, and >>>>>>> conflict markers into the file.
After pulling and merging, the CLI lists every added (+), modified (M), and deleted (D) file and asks for y/N confirmation. -y keeps the plan visible but skips the input prompt; use it only after those exact paths have been reviewed and authorized. Do not use -f -y as a generic retry after a failed push.
Resolve every conflict, remove the markers, test the result, and run sxq push again. If the plan is unexpected—especially if many files suddenly appear as M or D—cancel instead of continuing. Files matched by the project’s .gitignore, plus built-in entries such as node_modules, dist, and .git, are not synchronized.
Preview and deploy
Update the frontend preview and wait for the build to finish.front is the default target and can be omitted:
The legacy
sxq publish command remains available and behaves like sxq preview front.Apply database migrations
Create migration files undersupabase/migrations/ using this format:
yyyyMMddHHmmss timestamp, for example:
sxq push; the CLI blocks them.
Command reference
For CI or an AI agent, add
-y only after the complete push plan has been reviewed and authorized. Without -y, a non-interactive push stops before submitting instead of waiting indefinitely. Production releases always require the user to confirm in the browser.
Suxiaoqiang CLI on npm
View the published package and current version.
Source code
Read the complete reference or report an issue.

