Skip to content
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.

Commit

Permalink
docs: add zh-cn readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KeJunMao committed Feb 18, 2023
1 parent 29b32e0 commit 3dfe280
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 9 deletions.
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,41 @@

# Edge GPT

_The reverse engineering the chat feature of the new version of Bing **WIP**_
_The reverse engineering the chat feature of the new version of Bing_

[![npm version][npm-version-src]][npm-version-href]

</div>

> **Warning**
>
> By using this library, you are breaking Microsoft TOS. Be careful of account suspension. I have tried my best to spoof headers and tls fingerprint
English | [简体中文](./README.zh-CN.md)

## Quick Start

```bash
```shell
npx edgegpt
```

## CLI Usage

```bash
npx edgegpt [options]
```shell
npx edgegpt -h
Usage: edgegpt [options]

!reset Reset the conversation
!exit Exit the program

Options:
-f, --cookie-file Cookie file path [default: cookie.json]
--stream Used stream mode [boolean] [default: true]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]

Examples:
edgegpt -f cookie.json

Repo: https://github.com/kejunmao/edgegpt
By: KeJun
License: MIT
```

**Arguments:**
Expand Down
83 changes: 83 additions & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<div align="center">

[![Bing](./assets/bing.svg)][bing-href]
[![Bing](./assets/node.svg)][node-href]

# Edge GPT

_new Bing 的聊天功能的逆向工程_

[![npm version][npm-version-src]][npm-version-href]

</div>

[English](./README.md) | 简体中文

## 快速开始

```shell
npx edgegpt
```

## 命令行用法

```shell
npx edgegpt -h
Usage: edgegpt [options]

!reset Reset the conversation
!exit Exit the program

Options:
-f, --cookie-file Cookie file path [default: cookie.json]
--stream Used stream mode [boolean] [default: true]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]

Examples:
edgegpt -f cookie.json

Repo: https://github.com/kejunmao/edgegpt
By: KeJun
License: MIT
```

**参数:**

- `--stream`: Used stream mode, **true** will be used as default, you can use `--no-stream` to set `false`.
- `-f, --cookie-file`: Cookie json file path, **cookie.json** will be used as default.

## 模块用法

```ts
import { Chatbot, loadEdgeGPTConfig } from "edgegpt";
const config = await loadEdgeGPTConfig();

const chatBot = new ChatBot(config);
await chatBot.create();

console.log(await chatBot.askAsync("hello!"));
```

## 配置

配置项使用 [unjs/c12](https://github.com/unjs/c12) 自动从 cwd 中加载。 你可以使用 `edgegpt.config.json`, `edgegpt.config.{ts,js,mjs,cjs}` 或者 `.edgegptrc`.

有关可用选项和默认值,请参见 [./src/config.ts](./src/config.ts)

## 协议

用 💛 发电

根据 [MIT License](./LICENSE) 发布

## 致谢

- [EdgeGPT](https://github.com/acheong08/EdgeGPT/)

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/edgegpt?style=flat-square
[npm-version-href]: https://npmjs.com/package/edgegpt
[bing-href]: https://www.bing.com/search?q=Bing+AI&showconv=1
[node-href]: https://nodejs.org
12 changes: 10 additions & 2 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ import { logger } from "./utils";
(async () => {
const args = await yargs(hideBin(process.argv))
.scriptName("edgegpt")
.usage("Usage: $0 [options]")
.usage(
`Usage: $0 [options]
\t!reset Reset the conversation
\t!exit Exit the program`
)
.example("$0 -f cookie.json", "")
.describe("f", "Cookie file path")
.default("f", undefined, "cookie.json")
Expand All @@ -19,7 +24,10 @@ import { logger } from "./utils";
.alias("h", "help")
.version("version", version)
.alias("v", "version")
.help().argv;
.help()
.epilog(
`Repo: https://github.com/kejunmao/edgegpt\nBy: KeJun\nLicense: MIT`
).argv;

run({
cookies: args["cookieFile"],
Expand Down

0 comments on commit 3dfe280

Please sign in to comment.