The command-line interface for the LinkAI agent platform.
English · 中文
LinkAI CLI brings the full LinkAI platform to the terminal for both agents and people — models, apps, knowledge bases, databases, workflows, plugins, and accounts. It gives AI agents a rich set of platform capabilities as infrastructure, extending what they can do.
The CLI exposes two kinds of capabilities: platform resources (manage and use the resources you've configured on LinkAI) and model capabilities (call models to generate content).
📦 Platform resources
| Resource | Command | Description |
|---|---|---|
| Apps | app |
List, inspect, create, update, and delete AI apps |
| Knowledge | knowledge |
Vector-search private knowledge bases; import files and manage bases |
| Database | database |
Query databases and schemas, run SQL, create builtin databases and tables |
| Workflow | workflow |
Run workflows orchestrated on LinkAI; create, update, and delete them |
| Plugin | plugin |
List, inspect, and run platform plugins |
| Account | account |
Account profile, credits, and recharge |
🧠 Model capabilities
| Capability | Command | Description |
|---|---|---|
| Chat | chat |
Talk to an AI app or language model, with multi-turn sessions |
| Image | image |
Text-to-image; returns an image URL |
| Video | video |
Text-to-video, with built-in polling until the result is ready |
| Speech | audio |
Text-to-speech (TTS), optionally saved to a file |
| Models | model |
List available models (LLM / IMAGE / VIDEO) |
Run
linkai <command> --helpfor the full flags of any command.
Requires Node.js 16 or later. npm installs the command to its global bin directory, which is already on your PATH:
npm i -g linkai-cliSend an agent this message; it will install the CLI, fetch the skill, and start using it:
Read https://cdn.link-ai.tech/cli/install.md and follow it to install the CLI and skill, then start using it.
# macOS / Linux
curl -fsSL https://cdn.link-ai.tech/cli/install.sh | sh
# Windows (PowerShell)
irm https://cdn.link-ai.tech/cli/install.ps1 | iexThe script downloads the pre-built binary, sets up your PATH, and installs the agent skill into common AI tool directories (Claude Code, Cursor, Codex, CowAgent, etc.).
Other install methods (Homebrew / Go / Binary / Source)
- Homebrew:
brew install MinimalFuture/tap/linkai - Go:
go install github.com/MinimalFuture/linkai-cli@latest - Binary: download from GitHub Releases, extract, and put it on your
PATH. - Source:
git clone, thenmake build && make install.
Install script environment variables
| Variable | Description | Default |
|---|---|---|
LINKAI_VERSION |
Version to install | latest |
LINKAI_INSTALL_DIR |
Binary install directory | Auto (prefers a directory already on PATH) |
LINKAI_SOURCE |
Download source: cdn / github |
cdn (falls back to GitHub if unreachable) |
LINKAI_NO_SKILL |
Set to 1 to skip installing the skill |
— |
Three steps to your first call:
linkai auth login # 1. Log in (authorize in the browser)
linkai app list # 2. List apps and grab an app_code
linkai chat "Hello" --app <app_code> # 3. Chat with the appUse auth status to check your session and auth logout to sign out.
Once installed, agents learn how to drive the CLI through its bundled skill — no extra setup required. The skill lives in skills/linkai-cli/.
A few notes when calling from an agent:
- Add
--jsonfor structured, easy-to-parse output. - Preview write operations with
--dry-run; add--forceto skip confirmations (e.g.knowledge delete). - Run
linkai <command> --helpfor a command's full flags.
| Command | Description |
|---|---|
auth login / logout / status |
Log in / out / show login status |
app list / detail / create / update / delete |
List and manage apps |
chat "<message>" --app <code> |
Chat with an app; --session for multi-turn |
knowledge list / files / search / create / import / delete |
Query, import, and manage knowledge bases |
database list / tables / describe / exec / create / create-table |
Query, run SQL, and create builtin databases/tables |
workflow list / run <code> --input "<text>" / create / update / delete |
List, run, and manage workflows |
plugin list / detail / exec <code> |
List and run plugins |
image gen "<prompt>" |
Text-to-image |
video gen "<prompt>" |
Text-to-video (waits for completion) |
audio speech "<text>" [--output a.mp3] |
Text-to-speech, optionally downloaded |
model list [--type LLM|IMAGE|VIDEO] |
List available models |
account info |
Account profile and credit balance |
account credits / recharge / orders |
Credit packages, recharge, and orders |
See
linkai <command> --helpfor each command's full flags.
Permissions are requested at login via --scope, in resource:action form. Read and content-generation scopes are granted by default; write scopes must be requested explicitly.
| Scope | Description | Default |
|---|---|---|
app:read |
List and inspect apps | ✅ |
app:create |
Create apps | ✅ |
user:read |
Read user info | ✅ |
chat:send |
Chat with apps | ✅ |
knowledge:read |
Query knowledge bases | ✅ |
knowledge:create |
Create knowledge bases / add files | ✅ |
db:read |
Query databases / run SELECT | ✅ |
image:gen / video:gen / audio:gen |
Generate images / video / speech | ✅ |
plugin:read / plugin:run |
List / run plugins | ✅ |
workflow:read / workflow:run |
List / run workflows | ✅ |
workflow:create |
Create workflows | ✅ |
score:read / score:buy |
View / purchase credits | ✅ |
app:update / app:delete |
Update / delete apps | ❌ |
knowledge:update / knowledge:delete |
Update / delete knowledge bases | ❌ |
workflow:update / workflow:delete |
Update / delete workflows | ❌ |
db:write |
Database writes (INSERT/UPDATE/DELETE) | ❌ |
Request extra scopes by logging in again, for example:
linkai auth login --scope "db:read db:write knowledge:update knowledge:delete"Security
- Tokens: opaque tokens stored server-side and revocable;
accesslasts 2h,refreshlasts 7d, refreshed automatically before expiry;logoutrevokes them server-side. - Device binding: every request carries
X-Device-ID, and the server binds tokens to the device. - Local storage: tokens go into the macOS Keychain (service
linkai-cli), with a0600file fallback on other platforms; config lives in~/.linkai/. - Input / output hardening: dangerous Unicode is rejected, DDL is blocked in the database commands, and ANSI is stripped from table output.
- Resilience: 5xx responses are retried with exponential backoff; exit codes are structured (0 ok / 1 general / 2 validation / 3 auth / 4 network).
Shell completion
source <(linkai completion bash) # Bash
source <(linkai completion zsh) # Zsh
linkai completion fish | source # FishDevelopment
make build # build (with version injection)
make test # run tests
make lint # golangci-lintTo add a command, follow the pattern in cmd/database/, register it in cmd/root.go, and declare its scope via permission.RequiredKey.