Skip to content

Commit 7bf258e

Browse files
authored
Merge pull request #5 from code-yeongyu/feature/cli-stdin
Hi YGKA, say Hello to the world!
2 parents 9fd0344 + 80ca64b commit 7bf258e

24 files changed

+1263
-49
lines changed

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "YGKA Debug",
9+
"type": "python",
10+
"request": "launch",
11+
"module": "ygka",
12+
"justMyCode": true,
13+
"args": [
14+
"Who are you?"
15+
]
16+
}
17+
]
18+
}

README.md

Lines changed: 34 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,63 @@
1-
# Python Poetry Template
1+
# YGKA 🤖
22

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.
44

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 💡
126

13-
## Installation
7+
- Supports Unix/Linux pipelines
8+
- Ready to use without setting up tokens or API keys
149

15-
To install this template, simply follow these steps:
10+
## Prerequisites 📚
1611

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)
2714

28-
To use this template, you can follow these steps:
15+
## Getting Started 🚀
2916

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:
3318

3419
```sh
35-
poetry shell
20+
pip install ygk-a
3621
```
3722

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:
3924

4025
```sh
41-
invoke rename-project <your-project-name>
26+
ygka "<your command here>"
4227
```
4328

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:
4730

4831
```sh
49-
poetry run invoke run
32+
ygka "hello?"
5033
```
5134

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:
5536

5637
```sh
57-
poetry run invoke test
38+
cat textfile.txt | ygka "what is this file?"
5839
```
5940

60-
### Run Formatters
41+
## Advanced Settings 🛠
6142

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:
6344

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+
}
6651
```
6752

68-
### Run Checking Code Style & Type hint
53+
Here, you can specify the language model of your preference and add your OpenAI API key.
6954

70-
To check your code style and type hints, use the following command:
55+
## Inspired By 🎨
7156

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

Comments
 (0)