| Crates.io | actr-cli |
| lib.rs | actr-cli |
| version | 0.1.11 |
| created_at | 2025-11-09 11:05:23.628359+00 |
| updated_at | 2026-01-22 09:52:31.702418+00 |
| description | Command line tool for Actor-RTC framework projects |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1924011 |
| size | 925,069 |
中文 | English
actr-cli is the command line tool for Actor-RTC framework projects. It bootstraps projects, manages service dependencies, discovers services on the network, and generates code from Protocol Buffers definitions.
init, install, discovery, gen, and check.init (Rust and Swift) and gen are functional today.install and discovery depend on service components that are not registered in
ContainerBuilder::build, so they will fail with "not registered" errors until the
container wiring is implemented.check in src/main.rs is a placeholder implementation.echo and data-stream templates.protoc in PATHrustfmt in PATH (skip with actr gen --no-format)Rust codegen:
protoc-gen-prost in PATH (used by --prost_out)protoc-gen-actrframework in PATH
actr gen attempts to build and install it from an Actr workspace that
contains crates/framework-protoc-codegen.Swift init/codegen:
protoc-gen-swiftprotoc-gen-actrframework-swiftxcodegenproject.yml present in the project root for xcodegen generatecargo build --release
Or install the binary into your Cargo bin directory:
cargo install --path .
Create a Rust project:
actr init my-service --signaling ws://127.0.0.1:8080
cd my-service
actr gen
Create a Swift project:
actr init my-app --signaling ws://127.0.0.1:8080 --language swift --template echo
# Or use the data-stream template
actr init my-app --signaling ws://127.0.0.1:8080 --language swift --template data-stream
actr initInitialize a new project. If required fields are missing, the command will prompt interactively.
Flags:
--template <name>: project template (echo, data-stream)--project-name <name>: project name when initializing in the current directory--signaling <url>: signaling server URL (required)-l, --language <rust|python|swift|kotlin>: target language (default: rust)Examples:
# New directory
actr init my-service --signaling ws://127.0.0.1:8080
# Current directory
actr init . --project-name my-service --signaling ws://127.0.0.1:8080
# Swift
actr init my-app --signaling ws://127.0.0.1:8080 -l swift --template echo
actr installInstall service dependencies from Actr.toml or add new dependencies by package spec.
Flags:
--force: reserved (not wired yet)--force-update: reserved (not wired yet)--skip-verification: reserved (not wired yet)Examples:
# Install dependencies listed in Actr.toml
actr install
# Add a dependency
actr install actr://user-service@1.0.0/
actr discoveryDiscover services on the network and optionally add them to Actr.toml.
This command is interactive and will prompt for selection and actions.
Flags:
--filter <pattern>: service name filter (e.g. user-*)--verbose: reserved (not wired yet)--auto-install: install the selected service without promptingExample:
actr discovery --filter user-*
actr docGenerate static HTML documentation for the project, including project overview, API (Proto) reference, and configuration guide.
Flags:
-o, --output <path>: Output directory (default: docs)Example:
actr doc
# Or specify output directory
actr doc -o my-docs
After generation, you can preview the documentation locally:
python3 -m http.server --directory docs 8080
actr genGenerate code from proto files.
Flags:
-i, --input <path>: input proto file or directory (default: proto)-o, --output <path>: output directory (default: src/generated)--clean: remove the output directory before generating--no-scaffold: skip user code scaffold generation--overwrite-user-code: overwrite existing user code files--no-format: skip rustfmt--debug: keep intermediate generated files-l, --language <rust|python|swift|kotlin>: target language (default: rust)Examples:
# Rust (defaults)
actr gen
# Rust with explicit paths
actr gen -i proto -o src/generated
# Swift
actr gen -l swift -i protos/remote/echo-service/echo.proto -o MyApp/Generated
Notes:
rustfmt and cargo check automatically unless --no-format is set.xcodegen generate and requires project.yml.actr checkThe CLI currently exposes a placeholder check command that prints the provided
flags. The full CheckCommand implementation exists in src/commands/check.rs
but is not wired into the CLI entrypoint yet.
Actr.toml)Actr.toml is used by multiple commands (notably install and gen) and should
define the Actor type under [package.actr_type].
Minimal example:
edition = 1
exports = []
[package]
name = "example-service"
description = "An Actor-RTC service"
[package.actr_type]
manufacturer = "acme"
name = "example-service"
[dependencies]
# "acme+other-service" = {}
[system.signaling]
url = "ws://127.0.0.1:8080"
Apache-2.0. See LICENSE.