Skip to main content

sonnet-cli

The command-line interface library for sonnet-server applications.

Not a CLI application. It ships no console script and is not run directly. Consuming apps (lauro, sestina, coco-rag, ...) import it to build their own command-line interfaces -- each app owns its Typer application and its [project.scripts] entry point. sonnet-cli provides the base app and the reusable command building blocks they assemble.

sonnet-cli depends on sonnet-server (concrete readiness checks, DI wiring) and sonnet-core (ResourceSpec, CrudRepository, the readiness engine). It is the CLI layer that sits above the server framework.

Install

pip install sonnet-cli

Contents

Terminal building blocks

typer + rich + the standard library.

Component What
sonnet_cli.app The base Typer application (the db command group mounted)
sonnet_cli.multiselect Arrow-key checkbox picker with a numbered fallback when stdin is not a TTY
sonnet_cli.utils Shared rich console and path helpers

Command-group factories

Pieces an app mounts into its own Typer app. These drive a sonnet-server application.

Component What
sonnet_cli.resource_cli Uniform list / get / set for a ResourceSpec-backed resource (talks to CrudRepository directly, no HTTP server)
sonnet_cli.commands.db Database check / upgrade, given the app's Alembic config
sonnet_cli.checks Readiness-pipeline runner and builders

Usage

A consuming app builds its own Typer application on top of sonnet_cli.app, mounts the command groups it needs, and declares its own [project.scripts] entry point. ResourceSpec is declared once (in sonnet_core) and consumed by both sonnet_cli.resource_cli and sonnet-server's REST factory, so field policy lives in one place across transports.

Why a separate package

The CLI was a pure leaf inside sonnet_server.cli -- nothing in the server runtime imported it -- consumed by several services with an identical surface. Extracting it:

  • lets sonnet-server drop its typer / rich dependency and be a pure web/server library;
  • gives every sonnet-server app one shared CLI foundation instead of copies;
  • makes the layering explicit (CLI on top of server + core).

It is a library, not a binary: there is no sonnet-cli command. A consuming app is where a runnable CLI (and its [project.scripts]) lives.

Licence

Apache-2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sonnet_cli-0.2.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sonnet_cli-0.2.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file sonnet_cli-0.2.0.tar.gz.

File metadata

  • Download URL: sonnet_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sonnet_cli-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3ae1c2a8e7db8ab995b8fef40b0dc7440eea23ae6f71551cc865124629a28bc3
MD5 6a67bb65dcaa2e984d8d14bf89af388b
BLAKE2b-256 0acc9fdd3ca3bcced687fba068b17338a2b414c1075b3bb3bae01d717f12a69a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonnet_cli-0.2.0.tar.gz:

Publisher: publish.yml on petrarca/sonnet-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sonnet_cli-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sonnet_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sonnet_cli-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51cd09215e925bc869972d999462513502247f0cd936183f0f001edf280d1804
MD5 e180726a394d3511ba3582bfe1758b29
BLAKE2b-256 4f5b7a0815556a4cb117504938279c10c45e564f09ea0db1fd5972efe1758be8

See more details on using hashes here.

Provenance

The following attestation bundles were made for sonnet_cli-0.2.0-py3-none-any.whl:

Publisher: publish.yml on petrarca/sonnet-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.0

2 files

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