astrale-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAstrale CLI
Astrale CLI
astraleThe rendered command help is authoritative for flags and defaults:
bash
astrale --help
astrale <command> --help- Binary:
astrale - Package:
@astrale-os/cli - Runtime: Node 22 or newer; source development defaults to Node 26 and also supports Node 24 and Bun
- Dev entrypoint:
bun cli/bin/astrale.ts <command>
astrale命令帮助的渲染结果是标志和默认值的权威参考:
bash
astrale --help
astrale <command> --help- 二进制文件:
astrale - 包:
@astrale-os/cli - 运行环境:Node 22或更高版本;源码开发默认使用Node 26,同时支持Node 24和Bun
- 开发入口:
bun cli/bin/astrale.ts <command>
Command Surface
命令范围
Primary commands:
bash
astrale status
astrale whoami
astrale use <name>
astrale get <target>
astrale query [sources...]
astrale introspect <origin-or-path>
astrale mutate
astrale call <path> [key=value...]
astrale token
astrale logs
astrale view [target-or-view]
astrale ui ...
astrale instance ...
astrale domain ...
astrale identity ...
astrale auth ...
astrale idp ...
astrale admin ...Kernel-touching commands share , , , ,
, , , , , and where
applicable. The CLI creates one public Kernel , and its Client session owns
remote routing, fresh credentials, and one safe stale-route retry.
--format--json--raw--url-i/--instance--timeout--as--creds--anonymous--debugCallastrale uiUse to omit a caller credential even when a local or bookmark-default identity exists.
It cannot be combined with or ; required callables reject anonymous requests.
--anonymous--as--creds核心命令:
bash
astrale status
astrale whoami
astrale use <name>
astrale get <target>
astrale query [sources...]
astrale introspect <origin-or-path>
astrale mutate
astrale call <path> [key=value...]
astrale token
astrale logs
astrale view [target-or-view]
astrale ui ...
astrale instance ...
astrale domain ...
astrale identity ...
astrale auth ...
astrale idp ...
astrale admin ...涉及Kernel的命令会共享、、、、、、、、和(适用时)。CLI会创建一个公开的Kernel ,其客户端会话拥有远程路由、全新凭据以及一次安全的陈旧路由重试机制。
--format--json--raw--url-i/--instance--timeout--as--creds--anonymous--debugCallastrale ui即使存在本地或书签默认身份,也可使用省略调用者凭据。它无法与或组合使用;必填的可调用对象会拒绝匿名请求。
--anonymous--as--credsUI Projects
UI项目
Astrale UI is one tree-shakeable runtime package plus consumer-owned pattern,
block, and theme source. Initialize a React and Tailwind CSS v4 project with the exact
published UI release:
bash
astrale ui init --preset astrale
astrale ui list chart
astrale ui add pattern/chart/line-basic
astrale ui add theme/observatory
astrale ui add ./my-playground-export.css
astrale ui doctor
astrale ui doctor --project ./apps/web
astrale ui preset apply compactInitialization writes Base UI + Nova shadcn configuration, theme and preset CSS
imports, and . The lock records the exact package version,
Git tag, resolved commit SHA, shadcn version, Base UI version, preset, and hashes
of installed source. Registry metadata, included manifests, and item files are
always read from that single commit snapshot.
astrale-ui.lock.jsonRun without item arguments for an interactive picker. In CI,
provide canonical addresses explicitly. Ordinary add refuses locally edited
installed files; review those files, then use only when
replacement is intentional. leaves project files and the lock
unchanged. Use when registry metadata is needed by a
script or agent.
astrale ui add--overwrite --yes--dry-runastrale ui list --jsonPatterns, blocks, and themes are application-owned source after installation. A
theme is copied to and activated through one relative
import in the configured host stylesheet; local playground exports require no
registry fetch or shadcn invocation. Composition root
, inline , controlled values/actions, and stable
anatomy remain open to the host. The package owns reusable runtime behavior;
neither the CLI nor the SDK embeds the UI package or Base UI.
components/astrale/theme/classNamestyledata-slotAstrale UI是一个可摇树优化的运行时包,加上由使用者维护的模式、区块和主题源码。使用以下命令初始化一个基于React和Tailwind CSS v4的项目,匹配已发布的UI版本:
bash
astrale ui init --preset astrale
astrale ui list chart
astrale ui add pattern/chart/line-basic
astrale ui add theme/observatory
astrale ui add ./my-playground-export.css
astrale ui doctor
astrale ui doctor --project ./apps/web
astrale ui preset apply compact初始化操作会写入Base UI + Nova shadcn配置、主题和预设CSS导入,以及。该锁文件记录了确切的包版本、Git标签、解析后的提交SHA、shadcn版本、Base UI版本、预设,以及已安装源码的哈希值。注册表元数据、包含的清单和项目文件始终从该单一提交快照中读取。
astrale-ui.lock.json不带项目参数运行会启动交互式选择器。在CI环境中,请明确提供规范地址。普通的add操作会拒绝覆盖本地已编辑的安装文件;如需替换,请先检查这些文件,仅在有意替换时使用。不会修改项目文件和锁文件。当脚本或Agent需要注册表元数据时,请使用。
astrale ui add--overwrite --yes--dry-runastrale ui list --json模式、区块和主题在安装后归应用程序所有。主题会被复制到,并通过配置的宿主样式表中的一个相对导入激活;本地游乐场导出无需获取注册表或调用shadcn。宿主可自由控制组合根的、内联、受控值/操作以及稳定的结构。包负责可复用的运行时行为;CLI和SDK均不会嵌入UI包或Base UI。
components/astrale/theme/classNamestyledata-slotPaths
路径
Use canonical Kernel V2 Paths:
| Form | Example |
|---|---|
| Domain root | |
| Class | |
| Static callable | |
| Instance callable | |
| Node ID | |
| Active caller shorthand | |
Static dispatch uses one colon before the method. Instance dispatch uses .
is expanded by the CLI before signing when it appears at the head of a
call Path or a bare value. It is not rewritten inside ,
stdin JSON, URLs, or arbitrary substrings.
::@selfkey=@self--databash
astrale get @self --json
astrale call /:blog.example:class.Author:list limit=10
astrale call @self::deactivate使用标准的Kernel V2路径:
| 格式 | 示例 |
|---|---|
| 域根 | |
| 类 | |
| 静态可调用对象 | |
| 实例可调用对象 | |
| 节点ID | |
| 当前调用者简写 | |
静态调度在方法前使用一个冒号。实例调度使用。当出现在调用路径的开头或的裸值中时,CLI会在签名前将其展开。它不会在、标准输入JSON、URL或任意子字符串中重写。
::@selfkey=@self--databash
astrale get @self --json
astrale call /:blog.example:class.Author:list limit=10
astrale call @self::deactivateInstances And Domains
实例与域
astrale instancebash
astrale instance create my-app
astrale instance status my-app
astrale instance status staging --bookmarked
astrale instance use my-app
astrale instance bookmark staging --url https://kernel.example.com
astrale instance forget stagingUse explicit in scripts. affects an
admin-managed instance; removes only the local bookmark.
reports Admin-owned lifecycle by default; add
to probe one local bookmark's exact issuer, JWKS, and TLS trust instead.
Without a deployed Admin Domain, cannot fetch managed
instances (key-backed identities have no Admin token). Use
.
-i <instance>instance deleteinstance forgetinstance status--bookmarkedastrale instance listastrale instance list --bookmarkedThe CLI is connect-only: it does not build or run domains. The SDK's
binary owns , , , and deploy workflows.
astrale-domaindevprodbuildastrale domain install- Default: install a published catalog origin or URL through the admin control plane onto an admin-managed instance.
- : call the public Kernel install syscall with a running domain URL. This works for any instance you can authenticate to and owns the explicit identity-override consent prompt.
--direct
bash
astrale domain install crm.example -i staging
astrale domain install https://crm.example --direct -i staging
astrale domain uninstall crm.example -i stagingA replacement cannot change an installed Domain issuer. If that identity
change is intentional, uninstall the origin first and then install it again.
Uninstall removes the installed Domain but never deletes business data. It
requires typing the exact origin interactively (or in automation), and
is refused by the Kernel while dependents or business data remain.
--yesBookmarks retain their own TLS trust (). probes OIDC and
JWKS with that exact CA. If two bookmarks point to the same normalized URL with
different CA settings, the CLI warns and
shows each bookmark's , issuer, and default identity.
--cainstance useinstance list --bookmarked --jsoncaFileA deployment-only Publication change does not inherently require reinstalling
the Domain. Reinstall or run a schema plan only when installation/schema intent
actually changes.
astrale instancebash
astrale instance create my-app
astrale instance status my-app
astrale instance status staging --bookmarked
astrale instance use my-app
astrale instance bookmark staging --url https://kernel.example.com
astrale instance forget staging在脚本中使用显式的。会影响管理员管理的实例;仅移除本地书签。默认报告管理员拥有的生命周期;添加可探测本地书签的确切颁发者、JWKS和TLS信任。如果未部署Admin Domain,无法获取托管实例(密钥身份没有Admin令牌)。请使用。
-i <instance>instance deleteinstance forgetinstance status--bookmarkedastrale instance listastrale instance list --bookmarkedCLI仅负责连接:它不构建或运行域。SDK的二进制文件负责、、和部署工作流。
astrale-domaindevprodbuildastrale domain install- 默认模式:通过管理控制平面将已发布的目录源或URL安装到管理员管理的实例上。
- 模式:使用运行中的域URL调用公开的Kernel安装系统调用。这适用于任何您可以进行身份验证的实例,并会触发明确的身份覆盖同意提示。
--direct
bash
astrale domain install crm.example -i staging
astrale domain install https://crm.example --direct -i staging
astrale domain uninstall crm.example -i staging替换操作无法更改已安装域的颁发者。如果有意更改身份,请先卸载源,然后重新安装。卸载操作会移除已安装的域,但绝不会删除业务数据。它要求交互式输入确切的源(或在自动化中使用),并且当存在依赖项或业务数据时,Kernel会拒绝该操作。
--yes书签保留自己的TLS信任()。会使用该确切的CA探测OIDC和JWKS。如果两个书签指向同一标准化URL但CA设置不同,CLI会发出警告,且会显示每个书签的、颁发者和默认身份。
--cainstance useinstance list --bookmarked --jsoncaFile仅部署的发布变更本质上不需要重新安装域。仅当安装/架构意图实际更改时,才需要重新安装或运行架构计划。
Identity And Delegation
身份与委托
astrale auth loginastrale identity createbash
astrale identity create alice
astrale identity register alice \
--class /:accounts.example:class.User \
--props '{"accounts.example:class.User.property.name":"Alice"}' \
-i stagingThere is no caller-chosen storage : Kernel V2 Node IDs are opaque. The
proof is bound to the exact provision fingerprint and target Kernel audience.
For an application-owned Identity Class, direct Kernel submission is correctly
denied unless the caller owns that Class. Name the Domain's authorizing
registration callable explicitly; the CLI sends the same self-proven request
through it and stores only the admitted target-bound result:
--pathbash
astrale identity register operator \
--class /:operations.example:class.Operator \
--props '{"operations.example:class.Operator.property.name":"Operator"}' \
--via /:operations.example:function.provisionOperator \
-i stagingastrale token--creds--audience--rawbash
TOKEN=$(astrale token --raw -i staging)
astrale call /:notes.example:class.Note:list --creds "$TOKEN" -i stagingastrale auth tokenastrale auth loginastrale identity createbash
astrale identity create alice
astrale identity register alice \
--class /:accounts.example:class.User \
--props '{"accounts.example:class.User.property.name":"Alice"}' \
-i staging没有调用者可选的存储:Kernel V2节点ID是不透明的。证明与确切的配置指纹和目标Kernel受众绑定。对于应用程序拥有的身份类,除非调用者拥有该类,否则Kernel会直接拒绝提交。请明确指定域的授权注册可调用对象;CLI会通过它发送相同的自证明请求,并仅存储被认可的目标绑定结果:
--pathbash
astrale identity register operator \
--class /:operations.example:class.Operator \
--props '{"operations.example:class.Operator.property.name":"Operator"}' \
--via /:operations.example:function.provisionOperator \
-i stagingastrale token--creds--audience--rawbash
TOKEN=$(astrale token --raw -i staging)
astrale call /:notes.example:class.Note:list --creds "$TOKEN" -i stagingastrale auth tokenGraph Reads
图读取
get
getget
getgetjson
{ "id": "opaque-id", "class": "/:notes.example:class.Note", "props": {} }Nodes do not carry synthetic , , or backend fields.
It does not infer operations or children.
path__labelsclassIdbash
astrale get @note --json
astrale get /:notes.example:class.Note
astrale get /:kernel.astrale.ai --schemaastrale describegetcallintrospect--schemagetjson
{ "id": "opaque-id", "class": "/:notes.example:class.Note", "props": {} }节点不包含合成的、或后端字段。它不会推断操作或子节点。
path__labelsclassIdbash
astrale get @note --json
astrale get /:notes.example:class.Note
astrale get /:kernel.astrale.ai --schemaastrale describegetcallintrospect--schemaintrospect
introspectintrospect
introspectintrospectbash
astrale introspect kernel.astrale.ai
astrale introspect /:kernel.astrale.ai --bundle
astrale introspect /:kernel.astrale.ai:class.Identity:whoisA method or Function Path projects that callable's input/output from the
installed bundle. is not a flag.
astrale call --describeintrospectbash
astrale introspect kernel.astrale.ai
astrale introspect /:kernel.astrale.ai --bundle
astrale introspect /:kernel.astrale.ai:class.Identity:whois方法或函数路径会从已安装的包中投影该可调用对象的输入/输出。不是一个标志。
astrale call --describequery
queryquery
queryqueryastrale.graph.query/v6{ kind: "graph", graph: { nodes, edges }, page?: { next } }page.next--cursor- Positional Paths create Path source terms.
- selects Nodes implementing one exact Class.
--definition <path> - adds one exact expansion; direction is
--edge <class>,outgoing, orincoming.incident - is finite and defaults to 100.
--limit - resumes the same caller-bound query scope.
--cursor - and
--astadmit a complete canonical Query V6 document.--file
bash
astrale query /:notes.example:class.Note --limit 50 --json
astrale query --definition /:notes.example:class.Note --limit 50 --json
astrale query @note \
--edge /:notes.example:class.references \
--direction outgoing --limit 25 --json
astrale query --file query.v6.json --cursor "$CURSOR"Raw Cypher, recursive depth, and historical children/edges selector JSON are
not portable Kernel V2 contracts and are not accepted.
astrale lsquery--edgequeryastrale.graph.query/v6{ kind: "graph", graph: { nodes, edges }, page?: { next } }page.next--cursor- 位置路径创建路径源术语。
- 选择实现一个确切类的节点。
--definition <path> - 添加一个确切的扩展;方向为
--edge <class>、outgoing或incoming。incident - 是有限的,默认值为100。
--limit - 恢复相同的调用者绑定查询范围。
--cursor - 和
--ast接受完整的标准Query V6文档。--file
bash
astrale query /:notes.example:class.Note --limit 50 --json
astrale query --definition /:notes.example:class.Note --limit 50 --json
astrale query @note \
--edge /:notes.example:class.references \
--direction outgoing --limit 25 --json
astrale query --file query.v6.json --cursor "$CURSOR"原生Cypher、递归深度和历史子节点/边选择器JSON不是可移植的Kernel V2契约,不会被接受。
astrale ls--edgequeryMutations
变更操作
astrale mutateastrale.graph.mutation/v3{ preconditions, operations }--data--file--dry{ nodes, edges }bash
astrale mutate --file mutation.v3.json
astrale mutate --data '{"preconditions":[],"operations":[]}' --dryThe result is . Historical PatchData arms and
are not emulated.
{ createdNodes }createdEdgesastrale mutateastrale.graph.mutation/v3{ preconditions, operations }--data--file--dry{ nodes, edges }bash
astrale mutate --file mutation.v3.json
astrale mutate --data '{"preconditions":[],"operations":[]}' --dry结果为。不会模拟历史PatchData的arms和。
{ createdNodes }createdEdgesCalls
调用
astrale call--datakey=value{}--dry-run--outputastrale introspect <path>bash
astrale call /:blog.example:class.Author:list limit=10
astrale call /:blog.example:class.Author:create \
--data '{"name":"Ada"}' --json
astrale call /:assets.example:class.Asset:render id=123 --output asset.pngTop-level values coerce booleans, null, numbers, arrays, and
objects. Use for nested or digits-only string values.
key=value--dataastrale call--datakey=value{}--dry-run--outputastrale introspect <path>bash
astrale call /:blog.example:class.Author:list limit=10
astrale call /:blog.example:class.Author:create \
--data '{"name":"Ada"}' --json
astrale call /:assets.example:class.Asset:render id=123 --output asset.png顶级值会强制转换为布尔值、null、数字、数组和对象。对于嵌套或纯数字的字符串值,请使用。
key=value--dataJournal
日志
astrale logs{ records, cursor? }bash
astrale logs -i staging --limit 50
astrale logs --topic op:function.failed
astrale logs --topic-prefix op:function. --followUse , , , or an opaque as needed.
retains one Client session and advances only with returned cursors.
Application-service console buffers are not part of this command.
Machine output retains the admitted structured object, including invocation root and
parent identifiers, and also keeps the compatibility projection of .
Machine output is NDJSON with one complete admitted record per line; YAML follow is rejected.
--principal--since--until--cursor--followcorrelationcorrelationIdinvocationId--followastrale logs{ records, cursor? }bash
astrale logs -i staging --limit 50
astrale logs --topic op:function.failed
astrale logs --topic-prefix op:function. --follow根据需要使用、、或不透明的。会保留一个客户端会话,并仅通过返回的游标推进。应用程序服务控制台缓冲区不属于此命令。机器输出保留已接受的结构化对象,包括调用根和父标识符,同时保留对的兼容性投影。机器输出为NDJSON,每行一个完整的已接受记录;不支持YAML格式的follow输出。
--principal--since--until--cursor--followcorrelationcorrelationIdinvocationId--followViews And Browser Sessions
视图与浏览器会话
astrale viewbash
astrale view @customer --list
astrale view @customer --snapshot
astrale view /:crm.example:view.dashboard --target @customer
astrale view --sessions
astrale view --close <session-id>astrale browserastrale browser --checkagent-browserastrale viewbash
astrale view @customer --list
astrale view @customer --snapshot
astrale view /:crm.example:view.dashboard --target @customer
astrale view --sessions
astrale view --close <session-id>astrale browserastrale browser --checkagent-browserOutput And Automation
输出与自动化
- TTY defaults are human-readable.
- emits one JSON document for finite commands;
--jsonemits an NDJSON stream.logs --follow - unwraps scalars and writes raw binary bytes.
--raw - selects finite structured rendering;
--format yaml|jsonsupports JSON/NDJSON only.logs --follow - Use for automation.
--ci --no-prompt - Use explicit ,
-i, and--asrather than ambient state.--timeout - Pipe large JSON through stdin; command-line argument size is limited by the operating system.
- TTY默认输出为人类可读格式。
- 为有限命令输出一个JSON文档;
--json输出NDJSON流。logs --follow - 展开标量并写入原始二进制字节。
--raw - 选择有限的结构化渲染;
--format yaml|json仅支持JSON/NDJSON。logs --follow - 自动化环境中使用。
--ci --no-prompt - 使用显式的、
-i和--as,而非环境状态。--timeout - 通过标准输入传输大型JSON;命令行参数大小受操作系统限制。
Debugging
调试
Start with:
bash
astrale status
astrale instance active
astrale auth status
astrale whoamiAdd for full Kernel error diagnostics. A missing and an
authorization-masked graph Node may intentionally be indistinguishable. For
callable input/output shape, use .
--debugastrale introspect <path>从以下命令开始:
bash
astrale status
astrale instance active
astrale auth status
astrale whoami添加以获取完整的Kernel错误诊断信息。缺失的图节点和授权掩码的图节点可能在故意设计上无法区分。如需查看可调用对象的输入/输出形状,请使用。
--debugastrale introspect <path>Storage
存储
State lives under , or by default:
ASTRALE_HOME~/.astraletext
config.json
instances.json
identities.json
idps/
idp-sessions/
keys/
browser.json
browser/Optional roots are , , and
.
ASTRALE_HOMEASTRALE_KEYS_DIRASTRALE_DATA_DIR状态存储在下,默认路径为:
ASTRALE_HOME~/.astraletext
config.json
instances.json
identities.json
idps/
idp-sessions/
keys/
browser.json
browser/可选根目录包括、和。
ASTRALE_HOMEASTRALE_KEYS_DIRASTRALE_DATA_DIRSource Map
源码映射
- Entry:
cli/bin/astrale.ts - Program and shared options:
cli/src/program/ - Public Kernel connection boundary:
cli/src/connection/ - Query/Mutation document preparation:
cli/src/graph/ - Commands:
cli/src/commands/ - Shared presentation and local stores:
cli/src/lib/ - Studio bridge:
cli/studio/server/ - Tests: owner-local directories
__tests__/
- 入口:
cli/bin/astrale.ts - 程序和共享选项:
cli/src/program/ - 公开Kernel连接边界:
cli/src/connection/ - 查询/变更文档准备:
cli/src/graph/ - 命令:
cli/src/commands/ - 共享展示和本地存储:
cli/src/lib/ - Studio桥接:
cli/studio/server/ - 测试:所有者本地的目录
__tests__/