repl-cli-0.6.1 is not a library.
repl-cli
Command-line interface and JSON-RPC server for the Symbiont REPL. Provides both interactive and programmatic access to the Symbiont DSL evaluation engine.
Features
- Interactive REPL: Command-line interface for DSL development
- JSON-RPC Server: Programmatic access via JSON-RPC 2.0 over stdio
- Agent Management: Complete agent lifecycle control
- Execution Monitoring: Real-time statistics and trace visualization
- Session Management: Snapshot and restore capabilities
- IDE Integration: Foundation for Language Server Protocol support
Installation
# Build from source
# Install from crates.io
# Run via symbi CLI
Usage
Interactive Mode
# Start interactive REPL
# With custom configuration
# Enable debug logging
RUST_LOG=debug
JSON-RPC Server Mode
# Start JSON-RPC server on stdio
# Specify alternative communication method
Interactive Commands
Basic Usage
# Define an agent
agent Calculator {
name: "Basic Calculator"
version: "1.0.0"
}
# Define a behavior
behavior Add {
input { a: number, b: number }
output { result: number }
steps {
return a + b
}
}
# Execute expressions
let result = Add(5, 3)
print("5 + 3 =", result)
REPL Commands
| Command | Description |
|---|---|
:help or :h |
Show help message |
:agents |
List all agents |
:agent start <id> |
Start an agent |
:agent stop <id> |
Stop an agent |
:agent execute <id> <behavior> [args] |
Execute agent behavior |
:monitor stats |
Show execution statistics |
:monitor traces [limit] |
Show execution traces |
:snapshot |
Create session snapshot |
:clear |
Clear session |
:version |
Show version information |
JSON-RPC Protocol
The CLI supports JSON-RPC 2.0 for programmatic access:
Evaluate DSL Code
Request:
Response:
List Agents
Request:
Response:
Execute Agent Behavior
Request:
Response:
Error Responses
Configuration
Configuration File
# repl-config.toml
[]
= 1000
= true
= 300 # seconds
[]
= 30000 # milliseconds
= 100
= true
[]
= true
= 10000
= 1000
[]
= true
= true
= true
[]
= "info"
= "json"
= "stdout"
Environment Variables
| Variable | Description | Default |
|---|---|---|
RUST_LOG |
Logging level | info |
REPL_CONFIG |
Configuration file path | repl-config.toml |
REPL_HISTORY |
History file path | .repl_history |
REPL_SNAPSHOTS_DIR |
Snapshots directory | ./snapshots |
Architecture
repl-cli/
├── src/
│ ├── main.rs # CLI entry point
│ ├── repl.rs # Interactive REPL implementation
│ ├── server.rs # JSON-RPC server
│ ├── config.rs # Configuration management
│ ├── history.rs # Command history
│ └── output.rs # Output formatting
└── Cargo.toml
Components
- CLI Interface: Interactive command-line interface with history and completion
- JSON-RPC Server: Protocol implementation for programmatic access
- Configuration Manager: Settings and environment handling
- Output Formatter: Pretty-printing and syntax highlighting
- History Manager: Command history persistence
Integration Examples
Python Client
=
=
=
return
# Usage
=
=
Node.js Client
const = require;
// Usage
const repl = ;
repl..;
Testing
# Run all tests
# Run integration tests
# Test JSON-RPC protocol
# Test interactive features
Dependencies
tokio- Async runtimeserde- Serialization frameworkserde_json- JSON supportclap- Command-line argument parsingrustyline- Interactive line editingtracing- Structured loggingrepl-core- Core REPL functionalityrepl-proto- Protocol definitions
See Also
repl-core- Core REPL enginerepl-proto- Protocol definitionsrepl-lsp- Language Server Protocol implementation- REPL Guide - Complete user guide