Generated on 2026-05-29 using openrouter/qwen/qwen3-coder-next
OQL CLI (oqlctl) is the command-line interface for executing OQL (Operation Query Language) scenarios. It provides tools to run, validate, and interact with hardware testing scenarios defined in .oql files.
# Install from source
pip install -e .
# Install with development dependencies
pip install -e ".[dev]"
oqlos runtime (automatically installed as dependency)run — Execute a scenarioRun an OQL scenario file against hardware or in simulation mode.
# Execute mode (default - run on actual hardware)
oqlctl run scenario.oql
# Dry-run mode (validate and simulate without hardware)
oqlctl run scenario.oql --mode dry-run
# Step-by-step manual execution
oqlctl run scenario.oql --step
# Custom firmware server URL
oqlctl run scenario.oql --firmware-url http://localhost:8202
validate — Parse and validateCheck an OQL file for syntax errors without executing.
oqlctl validate scenario.oql
hardware — List peripheralsQuery the OqlOS API for connected hardware devices.
# Default localhost
oqlctl hardware
# Custom OqlOS URL
oqlctl hardware --url http://localhost:8200
scenarios — List scenariosList all available scenarios registered with the OqlOS API.
oqlctl scenarios
oqlctl scenarios --url http://localhost:8200
shell — Interactive REPLStart an interactive OQL shell for testing commands line-by-line.
oqlctl shell
Shell commands:
→ Valve.open NC, WAIT 1000)help — Show available commandsexit or quit — Exit the shell
shellis the easiest place to prototype commands interactively. For a single command sent to real hardware, usecmdbelow.
cmd — Execute one command on hardwareSend a single OQL command to the firmware in execute mode.
# Simplest one-liner for hardware execution
oqlctl cmd "SET 'pompa 1' '0'"
# Dry-run / simulation only
oqlctl cmd "SET 'pompa 1' '0'" --mode dry-run
# Custom firmware server URL
oqlctl cmd "SET 'pompa 1' '0'" --firmware-url http://localhost:8202
Use run with a .oql file when you need multiple steps or more complex flow.
OQL is a declarative DSL for hardware testing scenarios:
SCENARIO: "Pressure Test"
DEVICE_TYPE: "BA"
DEVICE_MODEL: "PSS 7000"
GOAL: Check Pressure
1. Open valve:
→ Valve.open NC
WAIT 2000
→ Sensor.read AI01
IF [AI01] [>=] [-15 mbar] ELSE ERROR "Pressure too low"
Key constructs:
SCENARIO: "name" — Scenario metadataDEVICE_TYPE:, DEVICE_MODEL: — Device specificationGOAL: — Define test goals→ Target.method — Execute hardware actionsWAIT ms — Pause executionIF [sensor] [op] [value] ELSE ERROR "msg" — Conditional checksSAVE: variable — Store measurement resultsSee OQL Specification for full language reference.
oql/
├── oql/
│ ├── cli.py # Main CLI entry point
│ ├── adapters/
│ │ └── local.py # Direct oqlos integration
│ ├── shell/ # Interactive shell implementation
│ │ ├── commands.py # Shell command registry
│ │ ├── executor.py # DSL execution engine
│ │ └── runner.py # Shell/ script runner
│ └── core/ # Core utilities
├── tests/ # Test suite
└── pyproject.toml # Package configuration
# Run tests
pytest
# Run specific test
pytest tests/test_cli.py -v
Licensed under Apache-2.0.