Skip to main content

cli-fw

A compact dataclass-driven command-line framework extracted from the Pacman and RAG projects.

uv add cli-fw

Example

from dataclasses import dataclass
from cli_fw import Command, arg


@dataclass
class Serve:
    port: int = arg(help="Port to listen on", default=8000)


command = Command("serve", schema=Serve)
parsed = command.execute(["--port", "8080"])

It supports positional and optional arguments, choices, booleans, lists, nested commands, generated help, and typed parse errors.

Where I use it

This is my internal CLI framework for 42 projects. The latest implementation was extracted from coding/42/cc/pac-man, with behavior checked against coding/42/cc/rag-against-the-machine. Pacman uses it for the game command and RAG uses it to validate command syntax and produce diagnostics before command execution.

Dependencies

  • Python 3.10+
  • typed-errs for Result, Err, and diagnostics

Development and release

Run mise run check. Every push to master publishes a unique 0.0.<CI run> ZeroVer version through PyPI Trusted Publishing. mise run publish remains available.

Download files

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

Source Distribution

cli_fw-0.0.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

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

cli_fw-0.0.2-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file cli_fw-0.0.2.tar.gz.

File metadata

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

File hashes

Hashes for cli_fw-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2557eec41f8e8037d70145dafa9077a9534d7196120342430e0235469ac4deb7
MD5 59ed51f7d71dc3dfdcf31044a60656bd
BLAKE2b-256 ea2632bcf97bc8f12a7ad75c0124f9f6634e1891384126208cb88448022524d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for cli_fw-0.0.2.tar.gz:

Publisher: release.yml on 0xveya/cli-fw

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

File details

Details for the file cli_fw-0.0.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for cli_fw-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 69ecbba88117393e697228cacec5f45a8ef3969c812dd6f3677a8b3146e7de97
MD5 c216d014d9c4f26cec6e9f0db3eeb1fe
BLAKE2b-256 495d774950dd1f2515588319cac5d5db7fb0983f4dfa1f553f1e7115e839f0a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for cli_fw-0.0.2-py3-none-any.whl:

Publisher: release.yml on 0xveya/cli-fw

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.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

This release

0.0.2 This release

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