|
1 | | -# Python Poetry Template |
| 1 | +# YGKA 🤖 |
2 | 2 |
|
3 | | -This template is designed to make it easy to set up a Python project that is well-structured, organized, and easy to maintain. It comes pre-configured with several tools that will help you develop your project more efficiently, including: |
| 3 | +YGKA is an advanced ChatGPT client for shell that acts as Your Genius Knowledgeable Assistant. YGKA supports Unix/Linux pipelines and requires no setting up of tokens or API keys. Furthermore, if you want to use an OpenAI API key, you can easily configure it. |
4 | 4 |
|
5 | | -- Visual Studio Code integration: with the `RunOnSave`, `even-better-toml` and `ruff` extensions installed, you can format, lint, and type-check your code automatically every time you save a file. |
6 | | -- Type checking: this template is configured to use `mypy` and `pyright` to automatically infer types when possible, without imposing strict typing requirements on your code. |
7 | | -- Linting: `ruff`, an extremely fast Python linter, written in Rust is configured well to help you catch and fix code style issues. |
8 | | -- Formatting: `yapf`, `ruff`, and `unify` are configured to help you keep your code clean and well-organized. |
9 | | -- Testing: `pytest` is configured to make it easy to run tests, and `pytest-cov` is configured to help you measure code coverage. |
10 | | -- Dependency management: `poetry` is configured to help you manage your project's dependencies. |
11 | | -- Toolkits: `invoke` is configured to provide a range of useful tasks, such as running your code, running tests, formatting your code, and checking your code style and types. These tasks are fully configurable in the [tasks.py](tasks.py) file. |
| 5 | +## Key Features 💡 |
12 | 6 |
|
13 | | -## Installation |
| 7 | +- Supports Unix/Linux pipelines |
| 8 | +- Ready to use without setting up tokens or API keys |
14 | 9 |
|
15 | | -To install this template, simply follow these steps: |
| 10 | +## Prerequisites 📚 |
16 | 11 |
|
17 | | -```sh |
18 | | -git clone [email protected]:code-yeongyu/Python-Poetry-Template.git |
19 | | -cd Python-Poetry-Template |
20 | | -poetry install |
21 | | -code --install-extension emeraldwalk.RunOnSave |
22 | | -code --install-extension tamasfe.even-better-toml |
23 | | -code --install-extension charliermarsh.ruff |
24 | | -``` |
25 | | - |
26 | | -## Usage |
| 12 | +- Python 3.9+ |
| 13 | +- ChatGPT Account (or OpenAI Account) |
27 | 14 |
|
28 | | -To use this template, you can follow these steps: |
| 15 | +## Getting Started 🚀 |
29 | 16 |
|
30 | | -### Open Shell |
31 | | - |
32 | | -To open a shell in the project directory, use the following command: |
| 17 | +To begin using YGKA, install it with pip: |
33 | 18 |
|
34 | 19 | ```sh |
35 | | -poetry shell |
| 20 | +pip install ygk-a |
36 | 21 | ``` |
37 | 22 |
|
38 | | -### Name your project |
| 23 | +Once you've installed YGKA, you can start using it right away. To execute a command, use the following syntax: |
39 | 24 |
|
40 | 25 | ```sh |
41 | | -invoke rename-project <your-project-name> |
| 26 | +ygka "<your command here>" |
42 | 27 | ``` |
43 | 28 |
|
44 | | -### Run Code |
45 | | - |
46 | | -To run your code, use the following command: |
| 29 | +For example, to ask "hello?" using YGKA, you can use the following command: |
47 | 30 |
|
48 | 31 | ```sh |
49 | | -poetry run invoke run |
| 32 | +ygka "hello?" |
50 | 33 | ``` |
51 | 34 |
|
52 | | -### Run Tests |
53 | | - |
54 | | -To run your tests, use the following command: |
| 35 | +You can also use YGKA with Unix pipeline. For example, to ask "what is this file?" while viewing the contents of a text file, you can use the following command: |
55 | 36 |
|
56 | 37 | ```sh |
57 | | -poetry run invoke test |
| 38 | +cat textfile.txt | ygka "what is this file?" |
58 | 39 | ``` |
59 | 40 |
|
60 | | -### Run Formatters |
| 41 | +## Advanced Settings 🛠 |
61 | 42 |
|
62 | | -To run the code formatters, use the following command: |
| 43 | +By default, YGKA is configured to use either the official_chatgpt or reverse_engineered_chatgpt language model. To change the language model, modify the `~/.ygka_config.json` file as follows: |
63 | 44 |
|
64 | | -```sh |
65 | | -poetry run invoke format_code |
| 45 | +```json |
| 46 | +{ |
| 47 | + ... |
| 48 | + "language_model": <language model of your preference>, //"official_chatgpt" or "reverse_engineered_chatgpt" |
| 49 | + "openai_api_key": <your OpenAI API key> |
| 50 | +} |
66 | 51 | ``` |
67 | 52 |
|
68 | | -### Run Checking Code Style & Type hint |
| 53 | +Here, you can specify the language model of your preference and add your OpenAI API key. |
69 | 54 |
|
70 | | -To check your code style and type hints, use the following command: |
| 55 | +## Inspired By 🎨 |
71 | 56 |
|
72 | | -```sh |
73 | | -poetry run invoke check |
74 | | -``` |
| 57 | +- YeonGyu Kim: My name. The project is named after me. |
| 58 | +- [AiShell](https://github.com/code-yeongyu/AiShell): A Natural Language Shell Powered by ChatGPT, is a brother project of YGKA that provides a similar functionality. |
| 59 | +- [loz](https://github.com/joone/loz): A nodejs version of a GPT3 client that does similar things as YGKA. |
| 60 | + |
| 61 | +## Contributions 💬 |
| 62 | + |
| 63 | +Feel free to contribute to YGKA by adding more functionality or fixing bugs. |
0 commit comments