Skip to main content

lionscliapp

A framework for building small command-line tools that remember things.

lionscliapp is a humane CLI application framework for Python. It makes it easy to build stateful developer tools quickly — tools that have persistent configuration, multiple sub-commands, and native support for paths and JSON files, without any argument-parsing boilerplate.

What It Provides

  • Persistence — Each project gets a hidden directory (e.g. .mytool/) with a config.json. Users set values once; the tool remembers them.
  • Automatic CLI parsing — Declare keys; the framework parses, persists, and merges values into app.ctx. No argparser to write.
  • Multiple commands — Bind as many sub-commands as you like, or declare a default handler for bare invocations.
  • Paths are native — Any key prefixed with path. becomes a pathlib.Path, expanded and resolved automatically.
  • JSON is native — read_json() and write_json() handle path resolution and formatting. Reading or writing a named JSON file is a one-liner.
  • Built-in commands — set, get, keys, and help are always available for free.

What It Doesn't Do

lionscliapp is deliberately simple. Configuration values are strings (except path.* keys, which become pathlib.Path). There is no built-in type system for integers, booleans, or enums — coerce from app.ctx yourself if you need them. This is a trade-off in favour of a smaller mental model.

Installation

Requires Python 3.10+.

pip install -e .

Quick Start

import lionscliapp as app

app.declare_app("mytool", "1.0")
app.describe_app("A tool that does useful things")

app.declare_projectdir(".mytool")

app.declare_key("path.output", "~/output")
app.declare_key("path.input",  "~/input")

def cmd_run():
    output = app.ctx["path.output"]  # pathlib.Path, fully resolved
    print(f"Output will go to: {output}")

app.declare_cmd("run", cmd_run)
app.describe_cmd("run", "Run the main process")

app.main()
mytool run                          # uses defaults
mytool set path.output ~/my-output  # persist a value
mytool --path.output /tmp run       # override for this invocation only
mytool help
mytool keys

Status

Version: 0.1.2 (v0 specification)

Core framework is complete: lifecycle management, command dispatch, built-in commands, configuration layering and persistence, path coercion, JSON I/O utilities.

License

See LICENSE file for details.


📖 Full Reference Guide

Release files for lionscliapp 0.1.2

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

Source distribution (sdist)

Source distribution for lionscliapp 0.1.2
File Size Uploaded
lionscliapp-0.1.2.tar.gz 43.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lionscliapp 0.1.2
File Interpreter ABI Platform
lionscliapp-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 73.7 kB

Release files / lionscliapp-0.1.2.tar.gz

Download URL lionscliapp-0.1.2.tar.gz
Size 43.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c0739e3b89a07724c8258b3844b4aeb003e9ae24a50fb712c40d216ec4d9c802
BLAKE2b-256 checksum
How to use checksums
ed480e974948e8b2fa9e63b9a6cc288dfd35110df15bda35c5865bfe7c17a85f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / lionscliapp-0.1.2-py3-none-any.whl

Download URL lionscliapp-0.1.2-py3-none-any.whl
Size 30.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
696d0b548a550aaf1d42a20365475e5c4fb8ee1f7999e257044c9446e1da9488
BLAKE2b-256 checksum
How to use checksums
3faba7f93964697d86dc807cc71312e46318993c7df4bccd6b2988cf3c55255b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.0

2 release 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