Skip to main content

CLI on the Shelf

test codecov pypi version PyPI - Python Version size code style: black gh license

A CLI tools and hooks on my shelf for my any Python packages. This project help me to make Versioning, run Abbreviate of Git CLI.

[!NOTE] This project was created because I do not want to hard code set up all of them every time when I start create a new Python package :tired_face:. I provide some reusable CLIs that was implemented by Click.

:package: Installation

pip install -U clishelf

In the future, I will add more the CLI tools that able to dynamic with many style of config such as I want to make changelog file with style B by my custom message code.

Dependency supported:

Python Version Installation Supported
<= 3.8 pip install "clishelf<=0.1.10"
<= 3.9 pip install "clishelf<=0.2.23"
>=3.10,<3.14 pip install -U clishelf

[!WARNING] This package already installed pre-commit with the latest version.

:rocket: Pre-Commit Hook

See pre-commit for instructions

- repo: https://github.com/korawica/clishelf
  rev: v0.3.2
  hooks:
    - id: shelf-commit-msg
      stages: [commit-msg]

Example:

Auto add emoji and format commit message before commit.

git commit -am "docs: update readme file"
# ...
# shelf prepare commit message.............................................Passed
# [main dfb229c] :page_facing_up: docs: update readme file.  <-- 🎉 SUCCESS 🎉
# 3 files changed, 10 insertions(+), 3 deletions(-)

⭐ Features

This Utility Package provide some CLI tools for handler development process.

Usage: shelf.exe [OPTIONS] COMMAND [ARGS]...

  The Main Shelf commands.

Commands:
  conf   Return config for clishelf commands
  cove   Run the coverage command.
  dep    List of Dependencies that was set in pyproject.toml file.
  emoji  The Emoji commands
  git    The Extended Git commands
  vs     The Versioning commands.

Extended Git

This is abbreviation of Git CLI that warped with the Python subprocess package.

Usage: shelf.exe git [OPTIONS] COMMAND [ARGS]...

  The Extended Git commands

Commands:
  bn-clear   Clear Local Branches that sync from the Remote repository.
  cm         Prepare and show the latest commit message with the commit...
  cm-msg     Return list of commit prefixes
  cm-prefix  Show the commit prefix that setting in current config.
  cm-prev    Commit changes to the Previous Commit with same message.
  cm-revert  Revert the latest Commit on the Local repository.
  mg         Merge change from another branch with strategy, `theirs` or...
  tg-bump    Create Tag from current version after bumping
  tg-clear   Clear Local Tags that sync from the Remote repository.

Versioning

This is the enhancement bump2version Python package for my bumping style.

Usage: shelf.exe vs [OPTIONS] COMMAND [ARGS]...

  The Versioning commands.

Commands:
  bump       Bump package version with a next tag value with an input...
  changelog  Make a changelog file that generate form previous commits.
  current    Return Current Version that read from ``__about__`` by default.

Emoji

This is the emoji CLI that getting data from GitHub dataset.

Usage: shelf.exe emoji [OPTIONS] COMMAND [ARGS]...

  The Emoji commands

Commands:
  fetch  Refresh emoji metadata file on assets folder.

:cookie: Configuration

Basic Setting

.clishelf.yaml:

version:
  version: "./clishelf/__about__.py"
  changelog: "CHANGELOG.md"
  mode: "normal"

pyproject.toml:

[tool.shelf.version]
version = "./clishelf/__about__.py"
changelog = "CHANGELOG.md"
mode = "normal"

[!IMPORTANT] The bump version mode able to be normal or datetime only.

Override Commit Prefix

git:
  commit_prefix:
    - ["comment", "Documents", ":bulb:"]  # 💡
    - ["typos", "Documents", ":pencil2:"]  # ✏️
  commit_prefix_group:
    - ["Features", ":tada:"]  # 🎉
Module Key Default Description
git commit_prefix None Commit prefix that want to override/append
commit_prefix_group None Commit prefix group that want to override/append
commit_msg_format "{emoji} {prefix}: {subject}" Commit message format that use to prepare
commit_prefix_pre_demojize True Auto de-emoji on a commit log subject
commit_prefix_force_fix False Force fix if commit message does not match with normal form
version version "./{PROJECT-NAME}/__about__.py" Version tracking file location path (with .py format)
changelog "CHANGELOG.md" Changelog file location path
mode "normal" "normal" for normal version
"datetime" for datetime time mode (format %Y%m%d.%pre-release)
commit_subject_format "{emoji} {prefix}: {subject}" Commit subject format that use to writing a changelog file with commit_msg_format
commit_msg_format "- {subject} (_{datetime:%Y-%m-%d}_)" Commit message format that use to writing a changelog file

:dart: Mini-Roadmap

  • (Optional) I will implement use rich and alive-progress to this project for make interface terminal prettier.
  • (Optional) Dynamic emoji changing for support other platform such as GitLab.
  • (BIG) Remove bump2version package and implement my bump function instead.

[!NOTE] I will migrate this code from Python to Rust for performance of this CLI (But I will observe for this again because this package does not have any issue with perf as well).

:speech_balloon: Contribute

I do not think this project will go around the world because it has specific propose, and you can create by your coding without this project dependency for long term solution. So, on this time, you can open the GitHub issue on this project :raised_hands: for fix bug or request new feature if you want it.

Release files for clishelf 0.3.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 clishelf 0.3.2
File Size Uploaded
clishelf-0.3.2.tar.gz 62.3 kB Details

Built distribution (wheel)

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

Total release size: 121.7 kB

Release files / clishelf-0.3.2.tar.gz

Download URL clishelf-0.3.2.tar.gz
Size 62.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1ed3137bd0727ad3cf92b4a5b5ef41ae7b1b00591a793534d3389abd28575338
BLAKE2b-256 checksum
How to use checksums
0d3fd82ae577da0d4672c2a80711a8d42660a76ad5da6ffe0f09cc979264c300
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 13, 2025.

Transparency log

Release files / clishelf-0.3.2-py3-none-any.whl

Download URL clishelf-0.3.2-py3-none-any.whl
Size 59.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13ff1015758779cf1bff44b780d83de3d74ba32e24cde2a92943ee95f4b0c94f
BLAKE2b-256 checksum
How to use checksums
8670ecfd64b37c52822a9bf4b730d0ac1bacfe361b1286070e02aef4a4cd396e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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 13, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.23

2 release files

0.2.22

2 release files

0.2.21

2 release files

0.2.19

2 release files

0.2.18

2 release files

0.2.17

2 release files

0.2.16

2 release files

0.2.15

2 release files

0.2.14

2 release files

0.2.13

2 release files

0.2.12

2 release files

0.2.11

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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