gencli
A general-purpose CLI: a library of functions exposed as commands, built for agents to use and extend. Every tool is implemented as a small set of pure functions with a thin Typer command wrapper, so the same logic works both as a shell command and as a plain Python import (from a script, a notebook, or another agent's tool).
See AGENTS.md for the SDLC every new tool must follow
(pure functions, tests, and a documentation notebook per feature).
Get Started
See the Docs page: https://gpadpoll.github.io/general-cli/
Important: Poetry Version
To avoid compatibility errors (such as TypeError related to canonicalize_version), ensure you are using an up-to-date version of Poetry:
pip install --upgrade poetry
If you encounter installation issues, upgrading Poetry usually resolves them.
Quick Start
-
Environment: create (or verify) the conda environment for this project
make conda-env -
Installation: install the package in development mode
make install -
Basic Usage: try the built-in commands
gencli config list gencli config set theme dark gencli config get theme gencli example slug "Hello, World!" gencli example word-count "to be or not to be" gencli example reverse "the quick brown fox"
CLI Commands
gencli config— manage CLI configuration (set,get,list,reset), stored as JSON at~/.gencli_config.json(override withGENCLI_CONFIG_PATH).gencli example— reference tool (slug,word-count,reverse). This is the template to copy when adding a new tool: seegencli/commands/example.py, its tests intests/test_example.py, and its notebook indocs/notebooks/example.ipynb.
Adding a new tool
- Create
gencli/commands/<tool>.py. Implement the tool's logic as pure functions (no I/O, no side effects, deterministic), and thin Typer commands that call them. - Register the sub-app in
gencli/main.py. - Write unit tests in
tests/test_<tool>.py: direct tests for the pure functions, plus a couple ofCliRunnertests for the CLI wiring. - Document the pure functions as a Jupyter notebook in
docs/notebooks/<tool>.ipynb(copydocs/notebooks/example.ipynbas a starting point) and list it indocs/docs/index.md. - Run
make format,make check,make test, and the pre-commit hooks before opening a PR.
Full guidelines: AGENTS.md.
Development
Prerequisites
This project uses Poetry for dependency management, inside a dedicated conda environment.
make conda-env # create/verify the conda env and install dependencies
Setup
-
Install dependencies:
make installThis installs the package and all development dependencies using Poetry.
-
Install pre-commit hooks:
make pre-commit
Testing
Run the comprehensive test suite:
make test
Or run tests directly with Poetry:
poetry run pytest -vvv
Documentation
-
Install docs dependencies:
make docs -
Serve docs locally:
make serve-docsOr run directly with Poetry:
poetry run mkdocs serve -f docs/mkdocs.yml
-
View documentation: Open http://localhost:8000
Code Quality
- Format code:
make formatorpoetry run black . - Check formatting:
make checkorpoetry run black --check --diff . - Run linting:
poetry run flake8 - Type checking:
poetry run mypy . - Clean artifacts:
make clean
Docker Testing
Test the CLI in a clean container environment:
-
Build image:
make docker-image -
Run commands:
docker run --rm gencli --help docker run --rm gencli config list docker run --rm gencli example slug "Hello, World!"
Configuration Storage
- Default location:
~/.gencli_config.json - Custom location: Set
GENCLI_CONFIG_PATHenvironment variable - Format: JSON with automatic type preservation
- Default values: Includes theme, output_format, auto_save, and debug settings
Distribution
PyPI Publishing (automated, recommended)
.github/workflows/publish.yml builds and publishes to PyPI whenever a
GitHub Release is published (or the workflow is run manually). It uses
PyPI Trusted Publishing (OIDC)
— there is no API token to generate or store as a secret.
The PyPI distribution name is gencli-agents — the plain name gencli
is already taken by an unrelated project (gen-cli, which normalizes to
the same name once PyPI strips hyphens). The import name and CLI command
are unaffected and remain gencli.
One-time setup (do this before the first release):
- On PyPI, go to "Add a new pending publisher"
(https://pypi.org/manage/account/publishing/, and the equivalent on
https://test.pypi.org/manage/account/publishing/ if you want to dry-run
via TestPyPI first) and add a trusted publisher with:
- PyPI Project Name:
gencli-agents - Owner:
gpadpoll - Repository:
general-cli - Workflow file:
publish.yml - Environment name:
pypi(ortestpypion test.pypi.org)
- PyPI Project Name:
- The
pypiandtestpypiGitHub environments already exist on the repo (Settings → Environments) — created for this workflow; add required reviewers there if you want a manual approval gate before a publish runs.
To cut a release:
- Bump
versioninpyproject.toml. - Commit, then tag:
git tag vX.Y.Z && git push --tags. - Create a GitHub Release from that tag. This triggers the workflow,
which verifies the tag matches the
pyproject.tomlversion, builds the sdist/wheel, and publishes them to PyPI.
PyPI Publishing (manual)
NOTE: Ensure you have a PyPI account before publishing.
-
Create distributions:
make distributionsThis builds the package using Poetry.
-
Upload to PyPI:
poetry publishOr use twine:
twine upload dist/*
Project layout
.
├── AGENTS.md # SDLC guidelines for agents adding/changing tools
├── Dockerfile # container image build steps
├── Makefile # convenience commands (install, test, docs, conda-env, etc.)
├── pyproject.toml # project metadata and dependencies (Poetry)
├── README.md # this file
├── .github/workflows/
│ ├── docs.yml # builds+deploys the MkDocs site to GitHub Pages
│ └── publish.yml # builds+publishes to PyPI on GitHub Release
├── scripts/
│ └── setup_conda_env.sh # creates/verifies the conda environment
├── docs/ # MkDocs site and notebook resources
│ ├── mkdocs.yml
│ ├── docs/
│ │ └── index.md
│ └── notebooks/
│ └── example.ipynb # documents the `example` tool's pure functions
├── gencli/ # main package code
│ ├── __init__.py
│ ├── constants.py
│ ├── main.py # top-level Typer app, registers command modules
│ ├── utils.py # shared pure helpers
│ └── commands/ # one module per tool (Typer sub-app)
│ ├── __init__.py
│ ├── config.py # configuration management commands
│ └── example.py # reference tool: pure functions + CLI wrapper
└── tests/
├── test_config.py
└── test_example.py
Architecture
Built with modern Python CLI best practices:
- Poetry - Modern dependency management
- Typer - Type-based CLI framework
- Rich - Beautiful terminal output
- Pytest - Reliable testing framework
- MkDocs - Professional documentation
- Black - Code formatting
- Pre-commit - Git hooks for quality
Help
View all available make commands:
make help
Get CLI help:
gencli --help
gencli config --help
gencli example --help
Release files for gencli-agents 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gencli_agents-0.0.1.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gencli_agents-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.9 kB
Release files / gencli_agents-0.0.1.tar.gz
| Download URL | gencli_agents-0.0.1.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9bf369177d41d7c8d43336c43c6b2a1e8b640664c0c670ff0088cb77b895308d
|
|
BLAKE2b-256 checksum How to use checksums |
0892e1b2c8acafa459cbf5b4ab15790f91fe68c9708d6d0ea74cab0e02621feb
|
| 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 Sep 27, 2026.
Transparency logRelease files / gencli_agents-0.0.1-py3-none-any.whl
| Download URL | gencli_agents-0.0.1-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1a5e6d2c19455b67164b7fa2e0bd99218b0c5ec0398388f2553fb909a5e1b1d
|
|
BLAKE2b-256 checksum How to use checksums |
8c12d6c813fc63a2798d252baf9b78b837f36ac53f01a6d11683894d24c59cf6
|
| 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 Sep 27, 2026.
Transparency log