palyrad daemon using the integrated CLI wizard.
1. Prerequisites and Environment Validation
Before running bootstrap scripts, engineers should verify their local environment meets the system requirements. Palyra provides a diagnostic tool,palyra doctor, to check for required dependencies and configuration integrity.
The doctor command performs strict environment checks, including verifying the presence of necessary build tools and runtime isolation primitives.
| Command | Purpose |
|---|---|
palyra doctor --strict | Runs mandatory environment checks; required for development justfile#8-11. |
just doctor | Alias for the strict doctor check via the project justfile justfile#7-11. |
2. Bootstrapping the Workspace
Palyra uses a multi-language monorepo structure. Bootstrapping involves fetching Rust dependencies, setting up the Node.js workspace, and preparing desktop UI components.2.1 Dependency Initialization
The primary entry point for new developers is thedev recipe in the justfile (or Makefile). This orchestrates the following flow:
- Environment Validation: Executes
just doctor. - Desktop UI Preparation: Runs
scripts/test/ensure-desktop-ui.shto ensure the Tauri frontend assets are available justfile#44-45. - Rust Compilation: Performs a
cargo build --workspaceto compile all crates, including the daemon and CLI justfile#19-19. - JS Workspace: Instructs the user to run
vp installto materialize thenpmworkspaces via the Vite+ (vp) tooling justfile#20-20.
2.2 Scripted Bootstrap
For automated environments, standalone scripts are provided:- Unix:
scripts/dev/bootstrap.sh - Windows:
scripts/dev/bootstrap.ps1
3. The Setup Wizard and Onboarding
Once the binaries are built, thepalyra CLI provides a guided setup experience to initialize the local daemon configuration and state.
3.1 Setup Modes
Thepalyra setup command (aliased as init) supports different deployment targets:
- Local: Initializes a standalone instance on the developer machine crates/palyra-cli/src/args/mod.rs#111-111.
- Remote: Configures the CLI to communicate with an existing remote gateway crates/palyra-cli/src/args/tests.rs#33-44.
3.2 Wizard Implementation
The setup process is powered by theWizardSession engine, which abstracts terminal interactions into discrete steps.
Code Entity Space: Wizard Logic
| Entity | Role |
|---|---|
WizardStep | Defines a UI element (Note, Select, Text, Confirm) with validation logic crates/palyra-cli/src/commands/wizard.rs#29-39. |
WizardSession | Orchestrates the flow of steps and handles user input via a WizardBackend crates/palyra-cli/src/commands/wizard.rs#155-165. |
InitModeArg | Enum defining Local vs Remote bootstrap paths crates/palyra-cli/src/args/init.rs#77-77. |
4. Running the Daemon (palyrad)
After setup, the core orchestrator (palyrad) can be started. In the development environment, this is typically done via the CLI.
4.1 Gateway Execution
The daemon provides several transport layers, including gRPC and QUIC, which are initialized based on the configuration generated during the setup phase.- Command:
palyra gateway run(orpalyra daemon run) crates/palyra-cli/src/args/mod.rs#170-172. - Default Ports:
- HTTP/Admin:
7142crates/palyra-cli/src/lib.rs#151-151 - gRPC:
7443crates/palyra-cli/src/lib.rs#153-153 - QUIC:
7444crates/palyra-cli/src/lib.rs#155-155
- HTTP/Admin:
4.2 Health Verification
To verify the bootstrap was successful and the daemon is responsive, use thehealth command. This probe checks both the HTTP and gRPC gateway surfaces crates/palyra-cli/tests/help_snapshots/root-help-unix.txt#9-9.
Sources: crates/palyra-cli/src/lib.rs#150-165, crates/palyra-cli/src/args/mod.rs#170-183, crates/palyra-cli/tests/help_snapshots/root-help-unix.txt#9-11
5. Troubleshooting the Bootstrap
If the development environment fails to initialize, engineers should use the following diagnostic sequence:- Doctor Repair:
palyra doctor --repaircan automatically fix common issues like missing directories or stale runtime artifacts crates/palyra-cli/src/args/tests.rs#122-149. - Log Tailing:
palyra logs --followallows viewing real-time diagnostics from the gateway journal crates/palyra-cli/src/args/tests.rs#171-192. - Reset: As a last resort,
palyra reset --scope statewill clear local databases and cached artifacts to allow a cleansetupcrates/palyra-cli/src/args/mod.rs#197-200.