sonnet-cli
Typer and rich building blocks for the command-line side of a sonnet-server application: a base app, a database command group, a resource command factory and terminal widgets.
It is a library, not a binary. There is no [project.scripts] entry and no
sonnet-cli command; installing it puts nothing on your PATH. Your
application defines its own Typer app and its own entry point, and mounts these
pieces into it.
Version 0.2.0.
What it provides
sonnet_cli.commands.db-- adb check/db upgradegroup that runs against the application's own Alembic chain.sonnet_cli.resource_cli-- uniformlist/get/setcommands over aResourceSpec-backed resource, talking to the repository directly with no HTTP server involved.sonnet_cli.checks-- a readiness-pipeline runner and the database pipeline builders behind thedbcommands.sonnet_cli.multiselect-- an arrow-key checkbox picker with a numbered fallback when stdin is not a TTY.sonnet_cli.utils-- the shared rich console and path helpers that exit cleanly.sonnet_cli.app-- a ready-made base Typer app with thedbgroup mounted, for cases where you do not need your own callback.
python -m sonnet_cli db check exists so the commands can be exercised
in-tree during development. It is not an operator interface.
Install
uv add sonnet-cli
Depends on typer, rich, sonnet-server and
sonnet-core. Adding it to an application that
already depends on sonnet-server costs two terminal libraries and nothing
else. The only extra is dev.
Usage
Define your own Typer app, register your services in the callback, and mount the groups you want:
import typer
from sonnet_cli.commands import db
from sonnet_core.services.registry import get_service_registry
from example_server.services.di import register_all_services
app = typer.Typer(name="example-server-cli", no_args_is_help=True)
@app.callback()
def main_callback() -> None:
registry = get_service_registry()
register_all_services(registry)
app.add_typer(db.app, name="db")
Your [project.scripts] entry points at that app. The commands still need
settings loaded and services registered before they run -- that bootstrap is
your application's job, and the usage guides walk through it.
Documentation
- Usage --
docs/usage/index.md - Design --
docs/design/index.md - Workspace --
../../docs/README.md
License
Apache 2.0 -- see LICENSE.md.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sonnet_cli-0.2.1.tar.gz.
File metadata
- Download URL: sonnet_cli-0.2.1.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baac4dfd45ec78e0ed40f4058c6ad0e57170a4a62a1b605d8a5ae3cbe691a108
|
|
| MD5 |
2627828c97434dfc4f6ff723b29b3996
|
|
| BLAKE2b-256 |
f2002117ff9051d2d6dce415a733236c97c107613f5cfc54cf744cb47e4439c5
|
Provenance
The following attestation bundles were made for sonnet_cli-0.2.1.tar.gz:
Publisher:
publish.yml on petrarca/sonnet-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sonnet_cli-0.2.1.tar.gz -
Subject digest:
baac4dfd45ec78e0ed40f4058c6ad0e57170a4a62a1b605d8a5ae3cbe691a108 - Sigstore transparency entry: 2567955703
- Sigstore integration time:
-
Permalink:
petrarca/sonnet-server@8fb257794749ed1922438cbfb5ef82eeb548d71d -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/petrarca
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8fb257794749ed1922438cbfb5ef82eeb548d71d -
Trigger Event:
push
-
Statement type:
File details
Details for the file sonnet_cli-0.2.1-py3-none-any.whl.
File metadata
- Download URL: sonnet_cli-0.2.1-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
722bc27794ec592d6ac343ed23239704e4ffbad344f6f86ea9d34a5ed19e4cdc
|
|
| MD5 |
2b4b5c8d66f96dc4ad62b822db5bf78a
|
|
| BLAKE2b-256 |
6f060f98ab3e6d2eedb829304d89ae963313eecf35f9078cd709db5a98e963b3
|
Provenance
The following attestation bundles were made for sonnet_cli-0.2.1-py3-none-any.whl:
Publisher:
publish.yml on petrarca/sonnet-server
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sonnet_cli-0.2.1-py3-none-any.whl -
Subject digest:
722bc27794ec592d6ac343ed23239704e4ffbad344f6f86ea9d34a5ed19e4cdc - Sigstore transparency entry: 2567955861
- Sigstore integration time:
-
Permalink:
petrarca/sonnet-server@8fb257794749ed1922438cbfb5ef82eeb548d71d -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/petrarca
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@8fb257794749ed1922438cbfb5ef82eeb548d71d -
Trigger Event:
push
-
Statement type: