2023-11-11 15:44:40 +00:00
|
|
|
# Extending cutekit
|
2023-06-06 14:16:22 +00:00
|
|
|
|
|
|
|
By writing custom Python plugins, you can extend Cutekit to do whatever you want.
|
|
|
|
|
|
|
|
First the file need to be located in `meta/plugins` and have the `.py` extension.
|
|
|
|
Then you can import cutekit and change/add whatever you want.
|
|
|
|
|
|
|
|
For example you can add a new command to the CLI:
|
|
|
|
|
|
|
|
```python
|
2023-11-11 15:44:40 +00:00
|
|
|
from cutekit import cli
|
2023-06-06 14:16:22 +00:00
|
|
|
|
2023-11-11 15:44:40 +00:00
|
|
|
@cli.command("h", "hello", "Print hello world")
|
2023-12-09 12:18:48 +00:00
|
|
|
def _(args: cli.Args) -> None:
|
2023-06-06 14:16:22 +00:00
|
|
|
print("Hello world!")
|
|
|
|
```
|