Skip to main content
This page documents the CLI surface and implementation for managing automated workflows (Routines and Cron), the human-in-the-loop Approval system, and the management of external communication Channels. These components form the operational backbone for scheduling agentic tasks and governing sensitive tool executions.

Routines and Cron Workflows

Palyra distinguishes between Routines (the unified automation engine) and Cron (a compatibility layer for schedule-only tasks). Internally, both are backed by the same routine logic in the daemon, but the CLI provides distinct command groups to cater to different levels of complexity crates/palyra-cli/tests/help_snapshots/cron-help.txt#48-50.

Schedule Configuration and Policies

Routines support sophisticated scheduling and execution policies:

Routine CLI Command Surface

The palyra routines command group is the primary interface for full-featured automation crates/palyra-cli/src/args/routines.rs#5-220.
CommandDescriptionKey Arguments
upsertCreate or update a routine--trigger-kind, --prompt, --concurrency, --misfire
dispatchManually trigger a routine with a custom payload--id, --trigger-payload, --trigger-reason
logsView execution history for a specific routine--id, --limit, --after
templatesList available routine templates--json
export/importPortable routine definitions--file, --stdin
Sources: crates/palyra-cli/src/args/routines.rs#5-220, apps/web/src/console/sections/routinesHelpers.ts#62-89

Natural Language to Routine Entity Mapping

The following diagram illustrates how natural language input and CLI arguments are transformed into the RoutineUpsertArgs structure used by the palyra-control-plane. Title: Natural Language Schedule to Routine Entity Mapping Sources: crates/palyra-cli/src/commands/routines.rs#108-135, apps/web/src/console/sections/routinesHelpers.ts#97-101

Approvals CLI

The Approvals system provides a Human-in-the-Loop (HITL) gate for sensitive actions, such as tool execution, secret access, or device pairing crates/palyra-cli/src/args/approvals.rs#86-93.

Reviewing and Deciding

The palyra approvals command group allows operators to audit and resolve pending requests.

Approval Export

The export command supports auditing by dumping approval records in ndjson or json formats, allowing for ingestion into external SIEM or logging systems crates/palyra-cli/src/args/approvals.rs#43-60. Sources: crates/palyra-cli/src/args/approvals.rs#4-99

Channels and Router CLI

Channels represent the communication endpoints (e.g., Discord, Slack, Telegram) through which agents interact with users. The CLI provides commands to manage these connectors and audit the routing of messages.

Device and Node Management

Because channels often require a running “Node” to bridge external protocols to the Palyra daemon, the CLI includes extensive node and device management:
  1. Node Pairing: Uses palyra pairing code to generate PIN or QR codes for new nodes crates/palyra-cli/src/args/pairing.rs#15-24.
  2. Device Lifecycle: Commands like rotate, revoke, and remove manage the mTLS identities of connected nodes crates/palyra-cli/src/args/devices.rs#16-41.
  3. Capability Invocation: The palyra nodes invoke command allows direct testing of a node’s capabilities (tools) by passing JSON payloads via CLI or stdin crates/palyra-cli/src/args/nodes.rs#41-52.

Data Flow: CLI to Control Plane

The CLI acts as a client to the palyra-daemon Admin API, facilitated by the palyra-control-plane crate. Title: CLI Command Execution Data Flow Sources: crates/palyra-cli/src/commands/routines.rs#193-201, crates/palyra-cli/src/commands/devices.rs#11-13

Implementation Details

Sources: crates/palyra-cli/src/commands/routines.rs#1-21, crates/palyra-cli/src/commands/devices.rs#6-13