Skip to content

Commit 02a8c61

Browse files
Initial commit
0 parents  commit 02a8c61

22 files changed

+14807
-0
lines changed

.eslintrc.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true,
4+
"commonjs": true,
5+
"es2021": true
6+
},
7+
"extends": "eslint:recommended",
8+
"overrides": [
9+
],
10+
"parserOptions": {
11+
"ecmaVersion": "latest"
12+
},
13+
"rules": {
14+
}
15+
}

.gitattributes

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.bin filter=lfs diff=lfs merge=lfs -text
2+
*.npz filter=lfs diff=lfs merge=lfs -text
3+
*.ot filter=lfs diff=lfs merge=lfs -text

.github/ISSUE_TEMPLATE/bug_report.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See the error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Terminnal : [sh , zsh]
29+
30+
**Additional context**
31+
Add any other context about the problem here.

.github/workflows/pr.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Pull Request Test
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test_coverage:
10+
permissions:
11+
checks: write
12+
pull-requests: write
13+
contents: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: ArtiomTr/jest-coverage-report-action@v2
18+
id: coverage
19+
with:
20+
github-token: ${{ secrets.GITHUB_TOKEN }}
21+
output: report-markdown
22+
- uses: marocchino/sticky-pull-request-comment@v2
23+
with:
24+
message: ${{ steps.coverage.outputs.report }}

.gitignore

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# TypeScript v1 declaration files
45+
typings/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Microbundle cache
57+
.rpt2_cache/
58+
.rts2_cache_cjs/
59+
.rts2_cache_es/
60+
.rts2_cache_umd/
61+
62+
# Optional REPL history
63+
.node_repl_history
64+
65+
# Output of 'npm pack'
66+
*.tgz
67+
68+
# Yarn Integrity file
69+
.yarn-integrity
70+
71+
# dotenv environment variables file
72+
.env
73+
.env.test
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
78+
# Next.js build output
79+
.next
80+
81+
# Nuxt.js build / generate output
82+
.nuxt
83+
dist
84+
85+
# Gatsby files
86+
.cache/
87+
# Comment in the public line in if your project uses Gatsby and *not* Next.js
88+
# https://nextjs.org/blog/next-9-1#public-directory-support
89+
# public
90+
91+
# vuepress build output
92+
.vuepress/dist
93+
94+
# Serverless directories
95+
.serverless/
96+
97+
# FuseBox cache
98+
.fusebox/
99+
100+
# DynamoDB Local files
101+
.dynamodb/
102+
103+
# TernJS port file
104+
.tern-port
105+
106+
*.txt
107+
*.jsonl
108+
.yarn

.yarnrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

CONTRIBUTING.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# CONTRIBUTING
2+
3+
## 😎 Contribute your first spec in < 3 minutes
4+
5+
Use the steps below:
6+
7+
<br/>
8+
9+
**Steps**
10+
11+
1. Click [here](https://github.com/jucasoliveira/terminalGPT/fork) to fork this repo.
12+
13+
2. Clone your forked repo and create an example spec
14+
15+
```bash
16+
# Replace `YOUR_GITHUB_USERNAME` with your own github username
17+
git clone https://github.com/YOUR_GITHUB_USERNAME/terminalGPT.git terminalGPT
18+
cd terminalGPT
19+
20+
# Add jucasoliveira/terminalGPT as a remote
21+
git remote add upstream https://github.com/jucasoliveira/terminalGPT.git
22+
23+
# Install packages
24+
npm install
25+
26+
```
27+
28+
3. On your terminal, type `npm run tgpt -- chat`. Your terminalGPT will start. 😊
29+
30+
<br>

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Lucas Oliveira
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<p align="center">
2+
<img width="200" alt="TerminalGPT logo" src="https://user-images.githubusercontent.com/11979969/211214696-7519a871-4981-44a8-8c2d-a1d187839126.png"/>
3+
</p>
4+
5+
<p align="center">
6+
<img width="80" alt="TerminalGPT logo" src="https://img.shields.io/github/actions/workflow/status/jucasoliveira/terminalGPT/pr.yml"/>
7+
<img width="100" alt="TerminalGPT logo" src="https://img.shields.io/npm/dt/terminalgpt"/>
8+
<img width="100" alt="TerminalGPT logo" src="https://img.shields.io/github/contributors/jucasoliveira/terminalGPT"/>
9+
<img width="100" alt="TerminalGPT logo" src="https://img.shields.io/github/package-json/v/jucasoliveira/terminalGPT"/>
10+
11+
</p>
12+
13+
<p align="center">
14+
Get GPT-like chatGPT on your terminal
15+
</p>
16+
17+
![Screenshot 2023-01-05 at 09 24 10](https://user-images.githubusercontent.com/11979969/210746185-69722c94-b073-4863-82bc-b662236c8305.png)
18+
19+
<p align="center">
20+
<a href="https://www.producthunt.com/posts/terminalgpt?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-terminalgpt" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=373888&theme=light" alt="terminalGPT - Use&#0032;OpenAi&#0032;like&#0032;chatGPT&#0044;&#0032;on&#0032;your&#0032;terminal | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a>
21+
22+
</p>
23+
24+
## Prerequisites
25+
26+
You'll need to have your own `OpenAi` apikey to operate this package.
27+
28+
1. Go to <https://platform.openai.com>
29+
2. Select your profile menu and go to `View API Keys`
30+
3. Select `+ Create new secret key`
31+
4. Copy generated key
32+
33+
# Installation
34+
35+
Install terminalGPT globally:
36+
37+
```bash
38+
npm -g install terminalgpt
39+
```
40+
41+
or
42+
43+
```bash
44+
yarn global add terminalgpt
45+
```
46+
47+
## Start chat
48+
49+
```bash
50+
tgpt chat
51+
```
52+
53+
PS: If it is your first time running it, it will ask for open AI key, **paste generated key from pre-requisite steps**.
54+
55+
## Options
56+
57+
### Change engine and temperature
58+
59+
```bash
60+
tgpt chat --engine "gpt-4" --temperature 0.7
61+
```
62+
63+
Note this library uses [Chat Completions API](https://platform.openai.com/docs/api-reference/chat).
64+
The `engine` parameter is the same as the `model` parameter in the API. The default value is `gpt-3.5-turbo`.
65+
66+
### Use markdown
67+
68+
```bash
69+
tgpt chat --markdown
70+
```
71+
72+
## Change or delete api key
73+
74+
It you are not satisfied or added a wrong api key, run
75+
76+
```bash
77+
tgpt delete
78+
```
79+
80+
## Using with npx
81+
82+
```bash
83+
npx terminalgpt
84+
```
85+
86+
```bash
87+
npx terminalgpt <command>
88+
```
89+
90+
Note `npx terminalgpt` doesn't install the terminalgpt package, instead it downloads the package to your computer and directly executes it from the cache.
91+
92+
You can find the package using
93+
94+
`ls ~/.npm/_npx/*/node_modules`
95+
96+
To delete the package, you can use
97+
98+
`rm -r ~/.npm/_npx/*/node_modules/terminalgpt`
99+
100+
## Contributing
101+
102+
Refer to CONTRIBUTING.md 😎
103+
104+
## ✨ Contributors
105+
106+
<a href="https://github.com/jucasoliveira/terminalGPT/graphs/contributors">
107+
<img src="https://contrib.rocks/image?repo=jucasoliveira/terminalGPT" />
108+
</a>

SECURITY.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Use this section to tell people about which versions of your project are
6+
currently being supported with security updates.
7+
8+
| Version | Supported |
9+
| ------- | ------------------ |
10+
| 5.1.x | :white_check_mark: |
11+
| 5.0.x | :x: |
12+
| 4.0.x | :white_check_mark: |
13+
| < 4.0 | :x: |
14+
15+
## Reporting a Vulnerability
16+
17+
Use this section to tell people how to report a vulnerability.
18+
19+
Tell them where to go, how often they can expect to get an update on a
20+
reported vulnerability, what to expect if the vulnerability is accepted or
21+
declined, etc.

0 commit comments

Comments
 (0)