Skip to main content

without-cli

Command-line parsing as values. A token is one declaration that is the parse, the help entry, and the typed read at once; a command is a value you can pass around rather than a decorator's side effect; and parsing is a pure function from argv to an outcome, so nothing is registered anywhere and nothing exits out from under you.

@dataclass(frozen=True, slots=True)
class Session(Streams):
    client: Client


@command("add", argument("text", once(STR)), option(("-t", "--tag"), many(STR)), summary="Add a todo.")
async def add(session: Session, text: str, tags: tuple[str, ...]) -> int:
    todo = await session.client.create(text, tags)
    session.stdout.write(f"{todo.id}\n")
    return 0


app = group("todos", verbose, endpoint, state=session, commands=(add, show, db))

if __name__ == "__main__":
    raise SystemExit(run(app))

state is an async context manager, entered only when something beneath it is selected, so every command receives a live client it did not open and does not close, typed and checked, with no ambient context object. There is no separate root concept: the top of a tree is an ordinary group whose parent is the shell, which supplies the Streams it derives from, so a CLI with no shared resource declares no state and its commands take that Streams directly. An option can name where else its value may come from (sources=(FromFile(...), FromEnv(...))), which covers environment variables and Kubernetes or Docker secret mounts through the same validation the command line goes through.

Help is a Usage value that plain text is one rendering of, so no styling library sits on the path every program crosses and this package depends on nothing. The streams are injected, so a test asserts on output by passing Streams.captured(), with no subprocess and no runner.

See the without-cli guide (with the API reference) for the full surface, including what is deliberately absent, and alternatives for the same program written against argparse, click, and typer.

Metadata

Release files for without-cli 0.0.10

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

Source distribution (sdist)

Source distribution for without-cli 0.0.10
File Size Uploaded Provenance Actions
without_cli-0.0.10.tar.gz 24.7 kB Without provenance Details for without_cli-0.0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for without-cli 0.0.10
File Interpreter ABI Platform Actions
without_cli-0.0.10-py3-none-any.whl Python 3 none any Details for without_cli-0.0.10-py3-none-any.whl

Total release size: 54.5 kB

Release files / without_cli-0.0.10.tar.gz

Download URL without_cli-0.0.10.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8536d2115069e205ebc2120f3b855843b90bd77f5becef2300d1d4d4caaeaa42
BLAKE2b-256 checksum
How to use checksums
2d45334f77a9c5edd0fa196429db68f1f62df0a7fb0599a53dcc0db3a1dce8fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / without_cli-0.0.10-py3-none-any.whl

Download URL without_cli-0.0.10-py3-none-any.whl
Size 29.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f255baf96767b45dee3ffd0753150307506ce689957c4a5e1d7f6b5553663596
BLAKE2b-256 checksum
How to use checksums
5bb8f1311265cd44c93d44f286e7f579cd51d0362875fbedda9796849acbdf29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for without-cli 0.0.10

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.

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