# zinit_client
CLI client for the Zinit process supervisor with Rhai scripting support.
## Overview
`zinit_client` provides a command-line interface, interactive REPL, and TUI for managing services through the Zinit server. It includes a Rhai scripting engine for automation.
## Features
- CLI commands for service management
- Interactive REPL with syntax highlighting and tab completion
- Full-screen TUI for service monitoring
- Rhai scripting for automation
- Service builder API for programmatic service creation
## Installation
```bash
cargo install zinit_client
```
## Usage
### CLI Commands
```bash
# Service management
zinit list # List all services
zinit status <name> # Get service status
zinit start <name> # Start a service
zinit stop <name> # Stop a service
zinit restart <name> # Restart a service
zinit logs # View logs
# Interactive modes
zinit repl # Interactive REPL
zinit tui # Full-screen TUI
# Scripting
zinit run script.rhai # Run a Rhai script
zinit run scripts/ # Run all .rhai files in directory
```
### Rhai Scripting
```rhai
// Create and start a service
let svc = new_service("my-app")
.exec("/usr/bin/my-app --port 8080")
.after("database")
.env("LOG_LEVEL", "info");
start(svc, 5); // Start and wait up to 5 seconds
// Check status
let status = zinit_status("my-app");
print("State: " + status.state);
```
## to run rhai script
```bash
zinit rhaiexamples/01_full_test.rhai
```
## To get openrpc spec
```bash