Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

C2E — Console Command Engine

C2E is a lightweight, async‑friendly console command framework for Python.
It provides a raw‑mode terminal engine (LiveCLI) and a flexible command DSL for building interactive CLIs with subcommands, parameters, flags, and argument metadata.

C2E is extracted from the ServerWatcher CLI and generalized into a reusable standalone library.


Features

  • Async console loop
    Uses asyncio.to_thread to keep the event loop responsive.

  • Raw terminal input
    Reads characters directly using termios and tty.setraw.

  • Command DSL
    Decorators for commands, children, parameters, flags, and argument metadata.

  • Automatic help generation
    Built‑in help for commands, subcommands, and argument‑level usage.

  • Dynamic parameter/flag injection
    Child functions receive parameter values and flag states via wrapped globals.

  • One-shot argv dispatch LiveCLI.run_argv() maps the same command DSL to conventional shell arguments without changing the existing interactive parser.

  • View‑safe printing
    safePrint() integrates with external buffer systems without breaking terminal output.

  • Minimal dependencies
    Only Python standard library + optional MapRes for color formatting.


Installation

pip install c2e

Process Arguments

Use run_argv() to dispatch a single command with normal positional arguments, --options, and boolean flags:

from c2e import LiveCLI, command


@command('greet')
def greet(cli, name: str):
  cli.safePrint(f'Hello, {name}!')


if __name__ == '__main__':
  LiveCLI().run_argv(prog='example')

Existing LiveCLI.onecmd() and interactive parse_line() behavior remains available unchanged.

Metadata

Release files for c2e 1.dev14

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

Source distribution (sdist)

Source distribution for c2e 1.dev14
File Size Uploaded Provenance Actions
c2e-1.dev14.tar.gz 21.4 kB With provenance Details for c2e-1.dev14.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for c2e 1.dev14
File Interpreter ABI Platform Actions
c2e-1.dev14-py3-none-any.whl Python 3 none any Details for c2e-1.dev14-py3-none-any.whl

Total release size: 42.1 kB

Release files / c2e-1.dev14.tar.gz

Download URL c2e-1.dev14.tar.gz
Size 21.4 kB
Tags Source
SHA-256 checksum
How to use checksums
686dcc6835deb6d9dd8ef6a618db6d5528b61431de364c8e2bb2bbdeaecce979
BLAKE2b-256 checksum
How to use checksums
dcde44fadbfdda80c7d19fcb3a083c9395abc1dfe54f742aef81fceb312aa731
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / c2e-1.dev14-py3-none-any.whl

Download URL c2e-1.dev14-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e76058a5da727125cd999cc34af847f3455cf95e3e690e36dc9042f6cd9d22c3
BLAKE2b-256 checksum
How to use checksums
ad821c37ae974fc1302033b6e78e32b703c8460bb7b64d35b664dba2be4fb187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Security for c2e 1.dev14

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for c2e-1.dev14.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

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