Skip to main content
The palyra CLI is the primary operator interface for the Palyra platform. It serves as a unified entry point for bootstrapping installations, managing the background daemon, interacting with AI agents via the Agent Control Protocol (ACP), and performing administrative tasks such as secret management and policy evaluation crates/palyra-cli/src/args/mod.rs#109-140.

High-Level Role and Communication

The CLI acts as a gRPC and HTTP client to the palyrad daemon. It abstracts complex multi-step workflows (like onboarding or skill auditing) into single commands. While most commands communicate with a running daemon, some (like setup, init, and doctor) operate directly on the local filesystem or system environment crates/palyra-cli/src/lib.rs#77-90.

Communication Architecture

The CLI utilizes a generated proto-client layer to interact with various daemon subsystems. Sources: crates/palyra-cli/src/lib.rs#15-59, crates/palyra-cli/src/lib.rs#140-143, crates/palyra-cli/src/commands/mod.rs#1-49

Command Hierarchy

The CLI is built using clap and organized into a deeply nested hierarchy of subcommands. The root Cli struct defines global options like --config, --profile, and --state-root which are shared across all operations crates/palyra-cli/src/lib.rs#76-89.
Command GroupPurposePrimary Entities
setup / initInstallation and environment bootstrapping.InitModeArg, InitTlsScaffoldArg
gateway / daemonLifecycle and health of the palyrad process.JournalCheckpointModeArg
acpBridge for IDEs and external tools via stdio.AcpBridgeArgs, AcpShimArgs
routines / cronManagement of scheduled and event-driven tasks.CronScheduleTypeArg
skillsPackaging, auditing, and installing WASM plugins.SkillsPackageCommand, SkillManifest
tuiInteractive terminal interface for agent chat.TuiCommand
Sources: crates/palyra-cli/src/args/mod.rs#46-107, crates/palyra-cli/tests/help_snapshots/root-help-unix.txt#5-54

Subsystem Integration

The CLI maps high-level intent to specific internal crates and logic:
  1. Identity & Security: Commands like pairing and auth utilize palyra-identity for device handshakes and palyra-auth for credential management crates/palyra-cli/src/lib.rs#112-115.
  2. Vault & Secrets: The secrets command interfaces with palyra-vault to store and retrieve encrypted sensitive data using platform-specific backends crates/palyra-cli/src/lib.rs#122-125.
  3. Policy Enforcement: The policy command allows operators to test Cedar policies against specific contexts using palyra-policy crates/palyra-cli/src/lib.rs#115-115.

CLI-to-Code Mapping

The following diagram bridges the CLI command structure to the underlying Rust modules and data structures. Sources: crates/palyra-cli/src/lib.rs#76-125, crates/palyra-cli/src/args/mod.rs#1-45

Cross-Platform Parity

To ensure consistent behavior across Linux, macOS, and Windows, the CLI uses a CliParityMatrix. This system compares command output snapshots (e.g., root-help-unix.txt vs root-help-windows.txt) to prevent regression in the operator experience across different operating systems crates/palyra-cli/tests/help_snapshots.rs#4-7. Sources: crates/palyra-cli/tests/help_snapshots.rs#75-120, crates/palyra-cli/tests/help_snapshots/root-help-unix.txt#1-112

Detailed Documentation

For more in-depth information on specific CLI components, refer to the following child pages:

Child Pages