Skip to content

CLI reference

The aster CLI supports contract inspection, credential signing, and calls to running services. Use it when you need to check an interface or exercise a peer without writing a client application. Servers run through the SDK in the language you choose.

Task Requires a remote peer? Starting command
Record a Python service’s interface No; service module must be importable aster contract gen
Create an operator root or sign credentials No; trusted signing key required aster trust or aster enroll node
Inspect and call a service Yes; address and any required credentials aster shell or aster call
Publish or request access through @aster Yes; configured registry service and identity aster publish or aster access

The CLI is distributed separately as aster-cli; its dependency declaration allows a range of aster-rpc versions. Installing it does not establish that its commands match your SDK. A matching public CLI package and a clean-host walkthrough are not qualified by these docs. Check the installed parser before using the command examples:

Terminal window
python -m pip show aster-cli aster-rpc
aster --help
aster trust sign --help

The package installation command is:

Terminal window
python -m pip install aster-cli

Run it in a separate environment when evaluating package compatibility. Confirm the resolved SDK and native package against your language installation. For maintainers with a matching source checkout, python -m pip install -e cli/ installs that checkout’s CLI; the checkout and its dependencies must be selected together. The reference below describes inspected command behavior and does not establish the availability of a hosted registry service.

Generate a contract manifest for one or more services. This computes the deterministic contract_id for each service version and writes it to a JSON manifest file. No network connection or credentials required.

Terminal window
aster contract gen --service my_module:MyServiceClass --out .aster/manifest.json

Arguments:

Argument Description
--service MODULE:CLASS Python import path to the @service-decorated class. May be specified multiple times.
--out PATH Output path for the manifest JSON file. Default: .aster/manifest.json.

Python AsterServer checks .aster/manifest.json in its working directory when the file exists. A listed service whose live contract_id differs prevents startup. Services absent from the manifest are skipped, so include every interface you intend to guard. Review contract changes and application behavior together.

Example workflow:

Terminal window
# Generate manifest
aster contract gen --service myapp.services:TaskService --out .aster/manifest.json
# Commit the manifest
git add .aster/manifest.json && git commit -m "Update contract manifest"
# Server validates on startup
python producer.py # fails if interface changed without updating manifest

Generate cryptographic keys for the Aster trust model.

Terminal window
# On the operator's signing machine; also writes root.pub
aster trust keygen --out-key root.key

The root keypair file contains private_key and public_key as hex strings. The companion public-key file contains the hex-encoded public key. Provision the public key independently to nodes; keep the private key on the signing machine. See the trust model.

Sign a consumer policy credential using the operator’s root:

Terminal window
aster trust sign \
--root-key root.key \
--type policy \
--attributes '{"aster.role":"operator"}' \
--out consumer.token
Argument Description
--root-key PATH Root keypair JSON file
--type TYPE producer, policy, or ott; defaults to producer, so choose explicitly
--attributes JSON Attribute object; method permissions must match the declared requirements
--endpoint-id HEX Bind to an endpoint; required for producer credentials
--expires ISO8601 Absolute expiry; omission defaults to 30 days
--out PATH Credential JSON destination

ott creates a one-time token. Enforcing one-time use requires the server’s replay policy and nonce storage. A signed credential alone does not install admission enforcement. Prefer aster enroll node when you need an identity file pairing an endpoint key with its credential.

Generate (or reuse) a node keypair, sign an enrollment credential, and write or update the .aster-identity file. This is the primary operator workflow for adding nodes to a mesh.

Terminal window
# Enroll a producer node
aster enroll node \
--profile prod \
--role producer \
--name billing-producer
# Enroll a consumer node
aster enroll node \
--profile prod \
--role consumer \
--name analytics-consumer \
--identity .aster-identity

Arguments:

Argument Description
--profile NAME Profile to use (determines root key). Default: active profile.
--role ROLE Node role: producer or consumer.
--name NAME Human-readable name for the peer entry.
--identity PATH Path to the .aster-identity file. Default: .aster-identity in current directory.
--expires DURATION Credential expiry. Default: 30 days.

The command resolves the signing key from the profile/keyring or a --root-key file, generates or reuses the node’s secret key, computes the EndpointId, signs a credential, and appends a [[peers]] entry to the identity file.

--capabilities sets the credential’s aster.role value. Optional --attributes takes comma-separated key=value pairs here; trust sign uses JSON instead. --expires accepts 30d, 24h, or an absolute ISO timestamp. Protect the output file because it contains the endpoint secret as well as the credential. Producer identity entries do not enable Python producer mesh admission; that protocol is unavailable in the Python runtime.

Manage operator profiles. Profiles represent deployment meshes (dev, staging, prod) and store the root public key. The root private key is stored in the OS keyring.

Terminal window
# Create a new profile (generates root keypair, stores private key in keyring)
aster profile create prod
# List all profiles
aster profile list
# Switch active profile
aster profile use prod
# Show profile details
aster profile show prod
# Delete a profile
aster profile delete staging

Invoke a unary RPC method on a remote service from the command line. One-shot, non-interactive.

Terminal window
aster call <ADDRESS> <SERVICE.METHOD> '<JSON>'

Example:

Terminal window
aster call aster1Qm... MissionControl.getStatus '{"agent_id": "edge-node-7"}'

Accepts JSON input and uses the discovered contract to encode an XLANG payload. Local type definitions are not required.

The CLI can open a session for a one-shot call to a session-scoped service. A one-shot command does not preserve that session across separate invocations. Use an SDK session when several calls must share state.

Interactive shell for exploring and invoking services on a remote peer.

Terminal window
aster shell <ADDRESS>

Provides cd, ls, describe, ./methodName for navigation and invocation. Tab completion for service names, methods, and arguments.

Generate a typed client library from a running service or exported manifest.

Terminal window
# From a live service
aster contract gen-client aster1Qm... --out ./clients --package my_client --lang python
# From an exported manifest
aster contract gen-client ./Service.aster.json --out ./clients --package my_client --lang python

Arguments:

Argument Description
SOURCE aster1... ticket, .aster.json file path, or @handle/Service.
--out DIR Output directory for generated files.
--package NAME Package/module name. Default: derived from source.
--lang LANG Required target language: python or typescript.

Export a contract manifest to a portable .aster.json file for sharing.

Terminal window
aster contract export --manifest .aster/manifest.json -o ./exports/

Import a .aster.json file into the local contract store.

Terminal window
aster contract import ./TaskManager.aster.json

Verify an exported .aster.json matches the local manifest.

Terminal window
aster contract verify ./TaskManager.aster.json

The following commands call a running @aster service. They require its address, compatible service contracts, and the operator or consumer identity needed for the operation. They do not start a registry. These docs do not qualify a public hosted service or its email delivery.

Supply --aster ADDRESS, set ASTER_SERVICE_ADDR, or configure [aster_service].node_id in the CLI profile file. Direct-address call and shell do not require this hosted-service workflow.

Claim a handle on the @aster registry.

Terminal window
aster join --handle myname --email me@example.com

Complete email verification for a claimed handle.

Terminal window
aster verify 123456

Publish a service to the @aster registry for discovery.

Terminal window
aster publish TaskManager

Search the @aster registry for published services.

Terminal window
aster discover task

Manage registry access records for published services. This does not establish that the target producer implements delegated admission. Python producers do not accept @aster enrollment tokens; use their direct consumer-credential workflow for RPC access.

Terminal window
aster access grant TaskManager @alice --role reader --aster "$ASTER_SERVICE_ADDR"
aster access revoke TaskManager @alice --aster "$ASTER_SERVICE_ADDR"
aster access list TaskManager --aster "$ASTER_SERVICE_ADDR"

Start an MCP (Model Context Protocol) server that exposes Aster services as tools for AI agents.

Terminal window
aster mcp <ADDRESS>

Profiles are stored in ~/.aster/config.toml:

active_profile = "prod"
[profiles.dev]
root_pubkey = "<hex>"
created_at = "2025-01-15T10:30:00"
[profiles.prod]
root_pubkey = "<hex>"
created_at = "2025-01-20T14:00:00"

The corresponding root private keys are stored in the OS keyring under service aster and key root_privkey:<profile-name>. An explicit root-key file is also supported by signing commands; protect that file if you use it.

The .aster-identity file is a TOML file containing a node’s secret key and enrollment credentials. It is generated by aster enroll node and consumed by AsterServer and AsterClient at startup.

See Configuration for the file format and how it integrates with AsterConfig.

See configuration and MCP integration for related workflows.