Skip to main content

quail-cli-core

quail-cli-core is an instrument-agnostic CLI driver kit. It provides a shared command contract, a Python runtime, an external conformance checker, and a project scaffold for wrapping an API-accessible controller or instrument as a CLI driver compatible with the Quailbot schema.

Repository: https://github.com/BB-84C/quail-cli-core

Project boundaries

These projects have separate responsibilities.

Project Responsibility
quail-cli-core Defines the five-command driver contract and provides the runtime, conformance checker, and scaffold.
nspmctl A concrete Nanonis driver used by Quailbot and a reference implementation of the shared five-command model.
Quailbot Consumes compatible drivers as an upper-level agent harness. It owns workspace capability declarations, forced linked readback, default-deny checks for state-changing operations, and the append-only experiment log.

A driver can use any executable name, such as nspmctl, laserctl, or scopectl, while preserving the common contract.

Core commands

Every compatible driver exposes these five commands.

  • capabilities describes parameters, actions, command mappings, and capability or safety metadata.
  • get <parameter> reads one parameter.
  • set <parameter> [<value>] [--arg key=value ...] [--interval-s <sec>] [--plan-only] writes or plans a write.
  • ramp <parameter> <start> <end> <step> --interval-s <sec> [--plan-only] executes or plans an explicit ramp.
  • act <action_name> [--arg key=value ...] [--plan-only] invokes or plans an instrument action.

JSON is the default output format. Drivers may also expose --text for human-readable output.

Examples:

laserctl capabilities
laserctl get wavelength_nm
laserctl set wavelength_nm 532 --plan-only
laserctl ramp power_mw 0 10 1 --interval-s 0.1 --plan-only
laserctl act Shutter_Open --plan-only

Contract and conformance

The contract reference is docs/contract-v1.md. The executable quail-cli-conformance checker is the implementation-consistency check for external drivers.

The checker currently requires the following shapes.

  • capabilities has exactly two top-level objects named parameters and action_commands. Each contains exactly count and items, and each count must match the length of its item list.
  • Every parameter item requires the eight core keys name, label, readable, writable, has_ramp, get_cmd, set_cmd, and safety. The optional scalar_strategy and scalar_coordinate keys are accepted as a pair of non-empty strings. Other keys remain invalid.
  • The get_cmd, set_cmd, and safety descriptors accept an object or null. A readable parameter requires an object-valued get_cmd, and a writable parameter requires an object-valued set_cmd. Object-valued descriptors retain strict field validation.
  • Every action item includes name, action_cmd, and safety_mode. The allowed safety-mode values are alwaysAllowed, guarded, and blocked.
  • Successful get, set, ramp, and act calls use the exact payload keys documented in the contract reference.
  • The checker exercises an invalid-parameter call and verifies its JSON error payload and matching process exit code. This check covers that tested failure path rather than every possible argument-parser or backend failure.
  • The checker appends --json whenever it invokes a target driver command. A compatible driver must accept this option even when JSON is already its default output format.

The 0.2.0 checker covers the capability extensions used by nspmctl 0.3, including paired scalar metadata and nullable descriptors. quail-cli-core validates capability and safety metadata structure. It does not execute the safety policy described by that metadata.

Run the checker with real parameters and actions from the target driver. Mutation-capable checks use --plan-only. This is not an offline mode. A concrete driver may still connect to its backend, read current state, or require writes to be enabled. nspmctl has these requirements.

quail-cli-conformance `
  --command "laserctl" `
  --get-parameter wavelength_nm `
  --set-parameter wavelength_nm `
  --set-value 532 `
  --ramp-parameter power_mw `
  --ramp-start 0 `
  --ramp-end 10 `
  --ramp-step 1 `
  --action-name Shutter_Open

Install quail-cli-core 0.2.0

python -m pip install quail-cli-core
quail-cli-bootstrap --help
quail-cli-conformance --help

Scaffold a driver

Generate a standalone driver project:

quail-cli-bootstrap `
  --output-dir D:\drivers\laserctl `
  --cli-name laserctl `
  --package-name laser_driver `
  --project-name laser-instrument-driver

The scaffold separates the instrument backend from the contract-facing driver. Replace its placeholder backend with calls to the real controller API, then verify the resulting project. Scaffold generation alone is not conformance evidence.

Set-Location D:\drivers\laserctl
python -m pip install -e ".[dev]"
pytest
quail-cli-conformance `
  --command "laserctl" `
  --get-parameter instrument_value `
  --set-parameter instrument_value `
  --set-arg Value=0.2 `
  --ramp-parameter instrument_value `
  --ramp-start 0 `
  --ramp-end 0.4 `
  --ramp-step 0.1 `
  --action-name Instrument_Action `
  --action-arg Mode=1

Included components

  • quail_cli_core.driver defines the abstract interface for the five core operations.
  • quail_cli_core.runtime provides the shared parser, dispatch, JSON serialization, and handled-error output paths.
  • quail_cli_core.conformance checks an external driver process against the implemented contract.
  • quail_cli_core.scaffold generates a starting driver project.
  • examples/minimal_demo_driver.py provides a minimal implementation example.
  • docs/contract-v1.md documents the core-v1 command and payload contract.

What this kit does not do

quail-cli-core does not connect to a specific instrument by itself. Each concrete driver owns its controller API integration, state handling, and execution policy.

The kit declares and validates the structure of capability and safety metadata. It does not enforce limits such as minimum values, maximum values, step limits, or cooldowns. A concrete driver must implement and verify any policy represented by that metadata.

The kit also does not provide Quailbot's workspace capability declarations, forced linked readback, default-deny checks for state-changing operations, or append-only experiment log. Those are upper-level harness responsibilities in Quailbot.

Metadata

Release files for quail-cli-core 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quail-cli-core 0.2.0
File Size Uploaded Provenance
quail_cli_core-0.2.0.tar.gz 27.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for quail-cli-core 0.2.0
File Interpreter ABI Platform
quail_cli_core-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 49.6 kB

Release files / quail_cli_core-0.2.0.tar.gz

Download URL quail_cli_core-0.2.0.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
049c2845e00761a8ab56b7bd9dab93de8ca036f639650e48a21ac9da21e5c6bd
BLAKE2b-256 checksum
How to use checksums
8f869a7ab4a1a57e94ff68e118b8c6a91fd98f2cad0932d97e9bededf4f52280
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Release files / quail_cli_core-0.2.0-py3-none-any.whl

Download URL quail_cli_core-0.2.0-py3-none-any.whl
Size 21.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d8a138c11d3cacf259cca6c208b33450d7a29df5fd04590502022e0ba35a8c7
BLAKE2b-256 checksum
How to use checksums
dad5599a67180040730182433a147e82804f5c050dbaa80059332beb8d9f52f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.5

Security for quail-cli-core 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page