Skip to main content

quickli is a minimal Python framework for building simple command-line interfaces.

Project description

quiCkLI

CI Coverage Python

quiCkLI is a simple Python CLI development framework. Like Click, it is designed to be easy to use and allows further extension through a plugin system.

The framework prioritizes simplicity for developers who are new to CLI development or who want a small tool without the overhead of a larger framework.

It also serves as a learning resource for developers who want to understand CLI design, software structure, and how to build their own tools from scratch.

The Python package name is quickli. The stylized project name is quiCkLI.

Highlights

  • commandless applications through @app.entrypoint(...)
  • multi-command applications through @app.command(...)
  • local and global options
  • repeatable options and repeatable flags
  • built-in validation for file paths, directory paths, positive numbers, and numeric ranges
  • docstring-based help text fallback when help_text is omitted

Philosophies

The very basic philosophy behind the library uses the following key concepts to create simple and intuitive CLIs:

  • application: the instance of the program, which is responsible for managing the commands and their execution on the installed machine
  • command: a single function of the application that performs a specific task, which can be executed by the user through the command line interface
  • argument: arguments are input values that are passed to a command when it is executed, which can be used to customize the behavior of the command and provide additional (mandatory) information for its execution
  • option: options are similar to arguments, but they are typically optional and provide additional functionality or customization for a command, which can be specified by the user when executing the command through the command line interface
    • flags: special type of option that does not require a value, but instead is interpreted as a boolean value (true or false) based on its presence or absence in the command line input
  • plugin: a plugin is a separate module or package that can be added to the application to extend its functionality, which can include additional commands, options, or other features that are not included in the core application but can be easily integrated through the plugin system

Concept Relationships

The following diagram shows how the core CLI concepts relate to each other.

classDiagram
    class Application {
        +register commands
        +expose global options
        +optional entrypoint handler
    }

    class Command {
        +wrap handler
        +parse local input
        +generate command help
    }

    class Argument {
        +required positional input
        +optional conversion
        +optional validators
    }

    class Option {
        +named optional input
        +default value
        +repeatable support
    }

    class Flag {
        +boolean option
        +no value required
    }

    Application "1" o-- "0..*" Command : registers
    Application "1" o-- "0..*" Option : exposes as global options
    Command "1" *-- "0..*" Argument : defines
    Command "1" *-- "0..*" Option : defines
    Option <|-- Flag : conceptual specialization

In the current implementation, flags are represented as boolean options. They are shown separately here to make the conceptual relationship easier to understand.

Developer Workflows

The following workflow shows a typical path for building a small quickli application with a single entrypoint or a very small command surface.

flowchart TD
    A[Define the CLI goal] --> B[Create an Application instance]
    B --> C[Register a root entrypoint or one small command]
    C --> D[Add required arguments]
    D --> E[Add options and flags]
    E --> F[Implement the handler function]
    F --> G[Run the CLI manually]
    G --> H[Adjust help text and validation]
    H --> I[Add unit tests]
    I --> J[Document usage with an example]

The next workflow shows a more structured approach for building a larger quickli application with multiple commands and shared behavior.

flowchart TD
    A[Define application scope and command map] --> B[Create an Application instance]
    B --> C[Define global options]
    C --> D[Split features into commands]
    D --> E[Design arguments and local options per command]
    E --> F[Add conversion and validators]
    F --> G[Implement command handlers]
    G --> H[Share reusable helpers across commands]
    H --> I[Verify command help and error messages]
    I --> J[Write unit tests for parsing and execution]
    J --> K[Document commands and examples]
    K --> L[Package and iterate on feedback]

Project Structure

The repository follows a src layout for the Python package and keeps non-code assets in separate directories.

  • src/quickli: library source code
  • tests: dedicated unit tests
  • examples/simple: focused entry-level example applications
  • examples/complex: larger example applications with multiple commands
  • specs: technical specifications for the core resources
  • docs: project documentation for users and developers
  • .github: GitHub automation and AI guidance

Documentation

ADRs

Examples

The complex pyk5l example demonstrates how quickli can model a kubectl-like verb-resource interface without nested subcommand support in the framework itself.

PYTHONPATH=src python examples/complex/pyk5l/app.py get pods
PYTHONPATH=src python examples/complex/pyk5l/app.py get services --service-type NodePort
PYTHONPATH=src python examples/complex/pyk5l/app.py describe pod api-7d4f5f6b89-l2xq9

Specifications

Current Scope

The current implementation provides a minimal but functional CLI framework with:

  • application-level entrypoints for commandless tools
  • optional named commands for multi-command CLIs
  • argument, option, conversion, and validation resources
  • generated help output with metadata and docstring fallback
  • complex examples that illustrate kubectl-like command shapes through validated resource arguments
  • unit tests, specifications, and runnable examples

Release Model

  • CI runs on pushes and pull requests.
  • Coverage artifacts are built in a dedicated workflow.
  • Releases are created only from Git tags matching v*.
  • Python package publication is configured for PyPI rather than a GitHub Packages Python registry.

Decisions

  • The package and distribution name is quickli.
  • The project is released under the MIT License.

License

The project is licensed under the MIT License. See LICENSE.

Project details


Download files

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

Source Distribution

quickli-0.1.0.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

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

quickli-0.1.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file quickli-0.1.0.tar.gz.

File metadata

  • Download URL: quickli-0.1.0.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quickli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 06296ddf6b5bc936b6e81fac78438540d6b105267d9fc7ba3bc068aa6a5a64d5
MD5 2832b1680057e32cc1283b53c240aa9a
BLAKE2b-256 f2de141d32ab8265a4e230818fa26c2f01daa91451525d9416a222be6ad4ab30

See more details on using hashes here.

Provenance

The following attestation bundles were made for quickli-0.1.0.tar.gz:

Publisher: release.yml on spmse/quickli

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

File details

Details for the file quickli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: quickli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for quickli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2902d6637233c09863e2efe8f0e033433ab10a632455c01b7c483e2b66b2b5a5
MD5 81ef163048acdb1e86bb8aa607038521
BLAKE2b-256 02786700cedaa4a8dac64630d83597aa804d825b7867c0e530ee9b52d627a070

See more details on using hashes here.

Provenance

The following attestation bundles were made for quickli-0.1.0-py3-none-any.whl:

Publisher: release.yml on spmse/quickli

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page