Skip to main content

A powerful Python CLI framework for building beautiful, developer-friendly command-line tools.

Project description

Table of Contents
  1. About
  2. Quick Start
  3. Usage
  4. Development
  5. Contributing
  6. License

About

useCli is a CLI framework for Python. It gives you:

  • Prefix matching — Type he instead of help
  • Interactive mode — Fuzzy finder for commands
  • Auto-generated help — Clean, styled output
  • Command scaffoldingmake:command generates boilerplate
  • UI components — Prompts, menus, styled console output

Built on Typer and Click.

(back to top)

Quick Start

# Install
uv add "usecli @ git+https://github.com/thememium/usecli.git"

# Initialize
usecli init

# Create a command
usecli make:command hello

Your new command is ready in the commands directory:

class HelloCommand(BaseCommand):
    def signature(self) -> str:
        return "hello"

    def description(self) -> str:
        return "Say hello"

    def handle(self, name: str = Argument(..., help="Your name")) -> None:
        console.print(f"Hello, {name}!")

Run it:

usecli hello world

(back to top)

Usage

Prefix Matching

Type partial command names:

usecli he          # help
usecli ma:co       # make:command

Interactive Mode

usecli --interactive    # Fuzzy finder for all commands
usecli -i hello         # Run 'hello' command interactively

Command Groups

Colon-separated commands group automatically in help:

def signature(self) -> str:
    return "db:migrate"

Displays as:

db:
  migrate    Run migrations
  backup     Backup database

Space-separated signatures create nested subcommands:

def signature(self) -> str:
    return "spec show"   # usecli spec show

UI Components

from usecli import console, Prompt, Confirm, Menu

console.print("[green]Done![/green]")
name = Prompt.ask("Enter name")
ok = Confirm.ask("Continue?")
choice = Menu(["A", "B", "C"]).show()

Available Commands

about        Show app info
help         Show help
init         Initialize usecli
inspire      Random quote
make:command Create new command

Hiding Built-in Commands

[tool.usecli]
hide_init = true
hide_inspire = true

(back to top)

Development

See the Development Guide for setup, testing, and architecture details.

(back to top)

Contributing

Read the Contributing Guide.

Quick workflow:

  1. Fork and branch: git checkout -b feature/name
  2. Make changes
  3. Run checks: uv run poe clean-full
  4. Commit and push
  5. Open a Pull Request

(back to top)

License

MIT. See LICENSE.

(back to top)


Built by thememium

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

usecli-0.1.21.tar.gz (42.3 kB view details)

Uploaded Source

Built Distribution

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

usecli-0.1.21-py3-none-any.whl (67.2 kB view details)

Uploaded Python 3

File details

Details for the file usecli-0.1.21.tar.gz.

File metadata

  • Download URL: usecli-0.1.21.tar.gz
  • Upload date:
  • Size: 42.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for usecli-0.1.21.tar.gz
Algorithm Hash digest
SHA256 42cf450be351a62c7a718198f504aa76c124630212f7b22cbb10052129830f83
MD5 028641fc65dcfca9ebe80ffe31501362
BLAKE2b-256 d26e4b7b532c36a55b2cccf5f62af51a8bc1c165cf1c621e7894d7523b58ddcb

See more details on using hashes here.

File details

Details for the file usecli-0.1.21-py3-none-any.whl.

File metadata

  • Download URL: usecli-0.1.21-py3-none-any.whl
  • Upload date:
  • Size: 67.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for usecli-0.1.21-py3-none-any.whl
Algorithm Hash digest
SHA256 f1ca2240ed3871883c4332c47c7c9abc0ac9360d23f9856531a0283b6c1f4c65
MD5 2e181263c50b80d5275ee2d48e7d36ba
BLAKE2b-256 5cf6e18228e51c0b869d7664628f8f75335650d6a63292f0fc07431bc2ccc0e0

See more details on using hashes here.

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