CLI Reference
The aster command-line tool provides utilities for managing profiles, enrolling nodes, generating contracts, invoking services, and exploring remote peers interactively. Servers are started from Python code using AsterServer; the CLI provides the client-side tools for connecting, testing, and generating typed client libraries.
Installation
Section titled “Installation”The CLI ships as a separate package, aster-cli, which depends on aster-rpc:
pip install aster-cliThis installs both the framework and the aster command-line tool. Or install from a source checkout:
pip install -e cli/Commands
Section titled “Commands”aster contract gen
Section titled “aster contract gen”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.
aster contract gen --service my_module:MyServiceClass --out .aster/manifest.jsonArguments:
| 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. |
The manifest is checked at AsterServer startup. If a service’s live contract_id does not match the committed manifest, the server refuses to start. This prevents accidental wire-breaking changes.
Example workflow:
# Generate manifestaster contract gen --service myapp.services:TaskService --out .aster/manifest.json
# Commit the manifestgit add .aster/manifest.json && git commit -m "Update contract manifest"
# Server validates on startuppython producer.py # fails if interface changed without updating manifestaster trust keygen
Section titled “aster trust keygen”Generate cryptographic keys for the Aster trust model.
# Generate a root keypair (operator's offline machine)aster trust keygen root --out root.key
# Extract the public key from a root keypairaster trust keygen pubkey --in root.key --out root_pub.keyThe root keypair file is JSON containing private_key and public_key as hex strings. The public key file contains just the hex-encoded 32-byte public key.
aster trust sign
Section titled “aster trust sign”Sign enrollment credentials for consumers or producers.
# Sign a consumer enrollment credentialaster trust sign consumer \ --root-key root.key \ --type policy \ --expires 30d \ --out consumer.token
# Sign with specific attributesaster trust sign consumer \ --root-key root.key \ --type policy \ --attr team=billing \ --attr tier=premium \ --expires 90d \ --out consumer.tokenArguments:
| Argument | Description |
|---|---|
--root-key PATH |
Path to the root keypair file. |
--type TYPE |
Credential type: policy (long-lived) or ott (one-time token). |
--expires DURATION |
Expiry: relative (30d, 24h) or absolute ISO 8601 (2025-12-31T23:59:59). Default: 30 days. |
--attr KEY=VALUE |
Attribute key-value pair. May be specified multiple times. |
--endpoint-id HEX |
Bind the credential to a specific endpoint ID. |
--out PATH |
Output path for the signed credential JSON. |
aster enroll node
Section titled “aster enroll node”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.
# Enroll a producer nodeaster enroll node \ --profile prod \ --role producer \ --name billing-producer
# Enroll a consumer nodeaster enroll node \ --profile prod \ --role consumer \ --name analytics-consumer \ --identity .aster-identityArguments:
| 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 reads the root private key from the OS keyring (stored by aster profile create), generates or reuses the node’s secret key, computes the EndpointId, signs a credential, and appends a [[peers]] entry to the identity file.
aster profile
Section titled “aster profile”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.
# Create a new profile (generates root keypair, stores private key in keyring)aster profile create prod
# List all profilesaster profile list
# Switch active profileaster profile use prod
# Show profile detailsaster profile show prod
# Delete a profileaster profile delete stagingaster config show
Section titled “aster config show”Display the resolved configuration with provenance tracking. Equivalent to calling AsterConfig.from_env().print_config().
aster config showaster config show --jsonaster call
Section titled “aster call”Invoke a unary RPC method on a remote service from the command line. One-shot, non-interactive.
aster call <ADDRESS> <SERVICE.METHOD> '<JSON>'Example:
aster call aster1Qm... MissionControl.getStatus '{"agent_id": "edge-node-7"}'Uses the proxy client with JSON serialization mode. No type definitions or codegen needed.
Limitations:
- Shared services only. Session-scoped services (
scoped="session") require a persistent session connection thataster calldoesn’t establish. Useaster shellor the proxy client for those.- Unary methods only. Streaming methods (
server_stream,client_stream,bidi_stream) need the shell or proxy client.aster callis request-response.
aster shell
Section titled “aster shell”Interactive shell for exploring and invoking services on a remote peer.
aster shell <ADDRESS>Provides cd, ls, describe, ./methodName for navigation and invocation. Tab completion for service names, methods, and arguments.
aster contract gen-client
Section titled “aster contract gen-client”Generate a typed client library from a running service or exported manifest.
# From a live serviceaster contract gen-client aster1Qm... --out ./clients --package my_client
# From an exported manifestaster contract gen-client ./Service.aster.json --out ./clients --package my_clientArguments:
| 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 |
Target language. Default: python. |
aster contract export
Section titled “aster contract export”Export a contract manifest to a portable .aster.json file for sharing.
aster contract export --manifest .aster/manifest.json -o ./exports/aster contract import
Section titled “aster contract import”Import a .aster.json file into the local contract store.
aster contract import ./TaskManager.aster.jsonaster contract verify
Section titled “aster contract verify”Verify an exported .aster.json matches the local manifest.
aster contract verify ./TaskManager.aster.jsonaster join
Section titled “aster join”Claim a handle on the @aster registry.
aster join --handle myname --email me@example.comaster verify
Section titled “aster verify”Complete email verification for a claimed handle.
aster verify --code 123456aster publish
Section titled “aster publish”Publish a service to the @aster registry for discovery.
aster publish TaskManageraster discover
Section titled “aster discover”Search the @aster registry for published services.
aster discover taskaster access
Section titled “aster access”Manage access control for published services.
aster access grant @alice --service TaskManager --role readeraster access revoke @alice --service TaskManageraster access list --service TaskManageraster mcp
Section titled “aster mcp”Start an MCP (Model Context Protocol) server that exposes Aster services as tools for AI agents.
aster mcp <ADDRESS>Profile system
Section titled “Profile system”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 the key aster-root-<profile-name>. The private key never touches the filesystem.
.aster-identity file
Section titled “.aster-identity file”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.