Hi there!
My background: over the last 10 years I have created quite some tools in open-source, but now in the AI era this is more interesting than ever.
With LLMs, I found that those pesky/time consuming tasks are suddenly achievable without getting tired.
I created cliche a few years ago and it had been used at the companies I worked at before, but I never made the push to publicly announce it since it had a lot of rough edges.
So over the last few weeks (which is honestly very long when using a lot of LLMs) I have built upon a package that I hope will be useful to the Python ecosystem.
While the code was largely generated by an LLM, I've written this post myself to ensure it remains personal and avoids the 'AI slop' label, please give it an honest chance :)
Without further ado, I am pretty excited to announce the (mostly finished) preview of cliche:
https://github.com/kootenpv/cliche
https://pypi.org/project/cliche
The core idea is that all you'd need to do to make a CLI from python code is to annotate a function:
from cliche import cli
@cli
def greet(name: str) -> str:
return "Hi " + name
Then you'd run cliche install mytool and you can run it as mytool greet <name>
There's not much more you need to know about the library to be able to use it, you can just bolt it onto your existing functions and it should generally work (support for pydantic/protobuf/enum out of the box).
I added a lot of functionality to try to make it very nice and usable for humans, while at the same time optimizing it like crazy for AI as well.
For this I added --llm-help to both cliche as well as the tool that you create. This way, you won't have to explain to any LLM what to do and it can perfectly implement this for you.
I would really hope that I can get this to be used (or at least understood by default) by LLMs such that you can say "make a python CLI tool" without having to refer to the help.
Also: it's currently not in its form that it would have no breaking changes, I hope that people can help me find the blindspots so that I can make everything resilient and it'll be more battle-tested.
The usage of cliche should not really change at this point, but I suspect perhaps some work is needed to avoid all possible bugs you guys might encounter.
I really hope to get a lot of (constructive) positive (or negative) feedback (obviously, while I put a lot of effort, it can easily have huge blindspots, so I hope you give it a try)
Thanks for your time!
Your tools will automatically get:
- no boilerplate ugly code like Click that often involves multiple lines per function
- lightning fast startup time (3-50ms)
- autocomplete out of the box using C module built-in to cliche (<5ms per tab, whereas most other python tools would have 30ms-300ms) as it won't import any python modules
- prettified help (but simpler than typer's)
- LLM support (--llm-help)
- smaller traceback
- other --cli flags
Top comments (0)