Skip to content

Commit

Permalink
Refactor + Default Settings (#77)
Browse files Browse the repository at this point in the history
* refactor done 

* updating packages

* fixing some bugs - WIP - not fully tested yet

* new load delete and oneshot are tested

* woking on the tests - conversations done, WIP

* unit tests are done - onwards to integrationa nd e2e

* linting

* readme and dependencies update
  • Loading branch information
adamyodinsky authored Oct 28, 2023
1 parent 2cdf1ea commit e5e2a34
Show file tree
Hide file tree
Showing 23 changed files with 2,008 additions and 1,581 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ __pycache__
dist
.vscode
.idea
.pytest_cache
dummy.py
ARCH.md
.coverage*
8 changes: 8 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[MASTER]
disable=missing-module-docstring,
missing-class-docstring,
missing-function-docstring,
line-too-long,
broad-exception-caught,
too-few-public-methods,
too-many-instance-attributes
31 changes: 10 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ Some advantages of using TerminalGPT over the chatGPT browser-based app:
1. Sign up at <https://beta.openai.com/signup> using email or Google/Microsoft account.
2. Go to <https://beta.openai.com/account/api-keys> or click on "View API keys" in the menu to get your API key.

**Notes:** OpenAI FREE API trial expired on 01-04-2023. You can still use the API, but you will need to set up a payment method.

- To set up a payment method [click here](https://platform.openai.com/account/billing/payment-methods).
- To check your usage [click here](https://platform.openai.com/account/usage).
- To check pricing [click here](https://openai.com/pricing#language-models).

## Installation

1. Install the latest TerminalGPT with pip install.
Expand All @@ -56,7 +50,12 @@ terminalgpt install

3. Enter your OpenAI API key when prompted and press enter.

4. Choose one of the models below as the default model. it can be overridden with the `-m --model` flag later.

5. Choose a printing style ('markdown' is recommended)

That's it! You're ready to use TerminalGPT!
You can now start a new conversation with `terminalgpt new` or load a previous conversation with `terminalgpt load`. Also you can reinstall with `terminalgpt install` or delete previous conversations with `terminalgpt delete`.

---

Expand All @@ -65,20 +64,19 @@ That's it! You're ready to use TerminalGPT!
### TL;DR

```sh
Usage: main.py [OPTIONS] COMMAND [ARGS]...
Usage: terminalgpt [OPTIONS] COMMAND [ARGS]...

*~ TerminalGPT - Your Personal Terminal Assistant ~*

Options:
--version Show the version and exit.
-m, --model [gpt-3.5-turbo|gpt-4]
Choose a model to use. [default:
gpt-3.5-turbo]
-p, --plain Plain text output.
-m, --model [gpt-3.5-turbo|gpt-3.5-turbo-16k|gpt-4|gpt-4-32k]
Choose a model to use. [default:gpt-3.5-turbo]
-s, --style [markdown|plain] Output style. [default: markdown]
--help Show this message and exit.

Commands:
delete Choose a previous conversation to load.
delete Choose a previous conversation to delete.
install Creating a secret api key for the chatbot.
load Choose a previous conversation to load.
new Start a new conversation.
Expand Down Expand Up @@ -119,15 +117,6 @@ terminalgpt delete

---

## Future Plans

1. Support optional Vim input mode.
2. Auto-completion for all commands.
3. Support local models

---

[![Star History Chart](https://api.star-history.com/svg?repos=adamyodinsky/TerminalGPT&type=Date)](https://star-history.com/#bytebase/star-history&Date)

---

79 changes: 79 additions & 0 deletions launch.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
"env": {
"LOG_LEVEL": "DEBUG"
}
},
{
"name": "install",
"type": "python",
"request": "launch",
"program": "terminalgpt/main.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": ["install"],
"env": {
"LOG_LEVEL": "DEBUG"
}
},
{
"name": "load",
"type": "python",
"request": "launch",
"program": "terminalgpt/main.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": ["load"],
"env": {
"LOG_LEVEL": "DEBUG"
}
},
{
"name": "delete",
"type": "python",
"request": "launch",
"program": "terminalgpt/main.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": ["delete"],
"env": {
"LOG_LEVEL": "DEBUG"
}
},
{
"name": "new",
"type": "python",
"request": "launch",
"program": "terminalgpt/main.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": ["new"],
"env": {
"LOG_LEVEL": "DEBUG"
}
},
{
"name": "one-shot",
"type": "python",
"request": "launch",
"program": "terminalgpt/main.py",
"console": "integratedTerminal",
"justMyCode": true,
"args": ["one-shot", "hello"],
"env": {
"LOG_LEVEL": "DEBUG"
}
}
]
}
10 changes: 5 additions & 5 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ install:
build: install
poetry build

test: build
test:
poetry run pytest -v --disable-warnings --cov=terminalgpt

test-unit: build
test-unit:
poetry run pytest -v --disable-warnings --cov=terminalgpt tests/unit

test-inte: build
test-inte:
poetry run pytest -v --disable-warnings --cov=terminalgpt tests/integration

test-e2e: build
test-e2e:
poetry run pytest -v --disable-warnings --cov=terminalgpt tests/e2e

publish: test-unit test-inte
publish: build test-unit test-inte
poetry publish

run-install:
Expand Down
Loading

0 comments on commit e5e2a34

Please sign in to comment.