Skip to main content
This page describes the process of initializing a Palyra development environment, bootstrapping the core daemon (palyrad), and utilizing the CLI-driven onboarding workflows. It covers the transition from a fresh repository clone to a fully functional local control plane with a configured profile.

1. Environment Bootstrapping

Palyra utilizes a justfile (and a fallback Makefile) to orchestrate the development lifecycle. The primary entry point for a new developer is the doctor command, which performs environment validation before attempting a build.

The Developer “Doctor” Check

The doctor command executes palyra doctor --strict to verify system dependencies, toolchains, and filesystem permissions justfile#7-11. It ensures that the environment is capable of running the daemon and its associated sandboxes.
CommandPurposeImplementation
just doctorValidates environmentcargo run -p palyra-cli -- doctor --strict justfile#10
just devFull bootstrapRuns doctor, builds workspace, and checks UI justfile#16-21
just buildCompile all cratescargo build --workspace --locked justfile#118-120
just protocolSchema generationValidates and generates Protobuf stubs justfile#103-113

JS Workspace Setup

The web dashboard and desktop UI require a Node.js environment. The project uses vp (a workspace manager) to materialize the root JS workspace justfile#30-31. Developers must run just web-bootstrap to install dependencies across all frontend applications Makefile#80-81. Sources: justfile#1-22, Makefile#1-19, justfile#103-113

2. Profile Setup and Onboarding Wizard

Palyra is profile-centric. Every daemon instance and CLI interaction operates within a profile context defined in profiles.toml. The setup process creates the necessary configuration files and state directories (typically in .palyra/).

Onboarding Flows

The palyra setup command is the primary entry point for new installations crates/palyra-cli/tests/help_snapshots/setup-help.txt#1-3. It supports two main modes:
  1. Manual (--mode local): Directly initializes configuration files using run_init crates/palyra-cli/src/commands/setup.rs#13.
  2. Guided (--wizard): Launches an interactive session to configure model providers, ports, and security settings crates/palyra-cli/src/commands/setup.rs#15-50.

Wizard Implementation

The wizard is built on a generic WizardSession that manages a sequence of WizardStep entities crates/palyra-cli/src/commands/wizard.rs#29-39.

Onboarding Logic Flow

Sources: crates/palyra-cli/src/commands/setup.rs#3-55, crates/palyra-cli/src/commands/wizard.rs#11-39, crates/palyra-cli/tests/help_snapshots/setup-help.txt#1-115

3. Running the Daemon and Console

Once configured, the palyrad daemon acts as the central control plane.

Bootstrapping the Daemon

The daemon can be started via the CLI or as a standalone binary. It initializes the Gateway, starts the Axum-based HTTP server for the Console API, and opens the gRPC management interface.
  1. Start Daemon: palyra gateway start
  2. Verify Health: palyra gateway status crates/palyra-cli/tests/help_snapshots/setup-help.txt#114
  3. Access Web Dashboard: By default, the console is served at http://localhost:4000 (or the port configured during setup).

Developer Pre-push Checks

To maintain repository health, developers should run the pre-push suite which mirrors CI gates. This is orchestrated by scripts/run-pre-push-checks.sh scripts/run-pre-push-checks.sh#1-5.
ProfileChecks Performed
fast (Default)JS checks, rustfmt, artifact hygiene, deterministic smoke tests scripts/run-pre-push-checks.sh#49-72
fullAll fast checks + clippy, full workspace test, protocol validation scripts/run-pre-push-checks.sh#74-108
Sources: scripts/run-pre-push-checks.sh#41-108, justfile#76-81, crates/palyra-cli/tests/help_snapshots/setup-help.txt#114

4. Technical Data Flow: Setup to Execution

The following diagram bridges the natural language “Setup” concepts to the internal code structures that handle profile initialization.

Configuration & Profile Bootstrapping

Sources: crates/palyra-cli/src/commands/setup.rs#15-54, crates/palyra-cli/src/commands/configure.rs#37-77, crates/palyra-cli/src/commands/wizard.rs#155-165

Key Functions and Classes

Sources: crates/palyra-cli/src/commands/setup.rs#1-55, crates/palyra-cli/src/commands/configure.rs#1-78, crates/palyra-cli/src/commands/wizard.rs#11-19