Skip to content

Commit d1938f4

Browse files
authored
Merge pull request #1 from ebenjs/add-miscelleanous-files
added miscelleanous files
2 parents 9ea1e0c + 27259d0 commit d1938f4

File tree

10 files changed

+1929
-107
lines changed

10 files changed

+1929
-107
lines changed

.eslintrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": ["google", "prettier"],
7+
"parserOptions": {
8+
"ecmaVersion": "latest",
9+
"sourceType": "module"
10+
},
11+
"rules": {}
12+
}

CONTRIBUTING.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Contributing
2+
3+
Thank you for considering contributing to this project! We appreciate your time and effort.
4+
5+
## Table of Contents
6+
7+
- [Contributing](#contributing)
8+
- [Table of Contents](#table-of-contents)
9+
- [Getting Started](#getting-started)
10+
- [Contributing Guidelines](#contributing-guidelines)
11+
- [Code Style](#code-style)
12+
- [Submitting a Pull Request](#submitting-a-pull-request)
13+
- [License](#license)
14+
15+
## Getting Started
16+
17+
To get started with contributing, follow these steps:
18+
19+
1. Fork the repository.
20+
2. Clone the forked repository to your local machine.
21+
3. Install the necessary dependencies.
22+
4. Make your changes and test them thoroughly.
23+
5. Commit your changes and push them to your forked repository.
24+
6. Submit a pull request.
25+
26+
## Contributing Guidelines
27+
28+
Please adhere to the following guidelines when contributing:
29+
30+
- Follow the code style and conventions used in the project.
31+
- Write clear and concise commit messages.
32+
- Provide detailed documentation for any new features or changes.
33+
- Be respectful and considerate towards others in the community.
34+
35+
## Code Style
36+
37+
We follow a specific code style in this project. Please make sure to familiarize yourself with it before contributing.
38+
39+
## Submitting a Pull Request
40+
41+
When submitting a pull request, please ensure the following:
42+
43+
- Your code builds without any errors or warnings.
44+
- All existing tests pass successfully.
45+
- You have added new tests to cover any new functionality or changes.
46+
- Your code follows the project's code style guidelines.
47+
48+
## License
49+
50+
By contributing to this project, you agree that your contributions will be licensed under the [LICENSE](./LICENSE) file.
51+
52+
---
53+
54+
We appreciate your contributions and look forward to your pull requests!

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<!-- Badges section here. -->
2+
3+
[![npm version](https://badge.fury.io/js/@ebenjs%2Fgpt-shell.svg)](https://badge.fury.io/js/@ebenjs%2Fgpt-shell)
4+
[![Build Status](https://travis-ci.org/brunolm/chat-gpt.svg?branch=master)](https://travis-ci.org/brunolm/chat-gpt)
5+
[![Known Vulnerabilities](https://snyk.io/test/github/ebenjs/gpt-shell/badge.svg?targetFile=package.json)](https://snyk.io/test/github/brunolm/chat-gpt?targetFile=package.json)
6+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7+
8+
<!-- Description section here. -->
9+
10+
The app is a command line client for chat gpt. It allows users to ask gpt questions and receive responses directly in the console. Written in nodejs.
11+
12+
<!-- Table of contents section here. -->
13+
14+
## Table of Contents
15+
16+
- [Table of Contents](#table-of-contents)
17+
- [Prerequisites](#prerequisites)
18+
- [Installation](#installation)
19+
- [Common steps](#common-steps)
20+
- [Linux and MacOS](#linux-and-macos)
21+
- [Windows](#windows)
22+
- [Usage](#usage)
23+
- [Configuration](#configuration)
24+
- [Contributing](#contributing)
25+
26+
## Prerequisites
27+
28+
Any recent version of nodejs.
29+
30+
<!-- Installation section here. -->
31+
32+
## Installation
33+
34+
### Common steps
35+
36+
```bash
37+
git clone https://github.com/ebenjs/gpt-shell.git
38+
cd gpt-shell
39+
npm install
40+
```
41+
42+
### Linux and MacOS
43+
44+
```bash
45+
sudo chmod +x index.js
46+
ln -s "$(pwd)/index.js" ~/bin/gptshell
47+
```
48+
49+
### Windows
50+
51+
On windows you need to create a `gptshell.cmd` file in `C:\Windows\System32` with the following content:
52+
53+
```cmd
54+
@echo off
55+
node "C:\path\to\gpt-shell\index.js" %*
56+
```
57+
58+
<!-- Usage section here. -->
59+
60+
## Usage
61+
62+
```bash
63+
gptshell ask -p "What is the meaning of life?"
64+
```
65+
66+
## Configuration
67+
68+
```bash
69+
gptshell config -k YOUR_API_KEY -m MODEL_NAME -u API_URL
70+
```
71+
72+
`-k` or `--key` is your openai api key.
73+
`-m` or `--model` is the model name to use. Default is `gpt-3.5-turbo`.
74+
`-u` or `--url` is the url of the gpt server. Default is `https://api.openai.com/v1/chat/completions`.
75+
76+
The configuration command is needed only once. It will create a `.gpt-shell-config.json` file in current directory. You can edit this file manually if you want to change the configuration.
77+
78+
<!-- Contributing section here. -->
79+
80+
## Contributing
81+
82+
Contributions are welcome. Please open an issue first to discuss what you would like to change.
83+
84+
Please make sure to update tests as appropriate.
85+
86+
For more information, please refer to the [contributing guidelines](./CONTRIBUTING.md).

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const isAtLeastOneOptionSpecified = (keys, args) => {
88
return keys.some((key) => args[key] !== null);
99
};
1010

11-
const args = yargs(hideBin(process.argv))
11+
yargs(hideBin(process.argv))
1212
.strict(true)
1313
.command(
1414
"ask",
@@ -30,7 +30,7 @@ const args = yargs(hideBin(process.argv))
3030
},
3131
(argv) => {
3232
ask(argv.prompt);
33-
}
33+
},
3434
)
3535
.command(
3636
"config",
@@ -58,7 +58,7 @@ const args = yargs(hideBin(process.argv))
5858
},
5959
(argv) => {
6060
configure(argv);
61-
}
61+
},
6262
)
6363
.check((argv) => {
6464
if (!isAtLeastOneOptionSpecified(["apikey", "model", "url"], argv)) {

0 commit comments

Comments
 (0)