|
1 | | -# gpt-cli |
2 | | -CLI tool for GPT powered by OpenAI API |
| 1 | +# [gpt-cli] CLI tool for GPT with OpenAI API |
| 2 | + |
| 3 | +[](https://github.com/goark/gpt-cli/actions) |
| 4 | +[](https://github.com/goark/gpt-cli/actions) |
| 5 | +[](https://raw.githubusercontent.com/goark/gpt-cli/master/LICENSE) |
| 6 | +[](https://github.com/goark/gpt-cli/releases/latest) |
| 7 | + |
| 8 | +This package is required Go 1.20 or later. |
| 9 | + |
| 10 | +## Build and Install |
| 11 | + |
| 12 | +``` |
| 13 | +$ go install github.com/goark/gpt-cli@latest |
| 14 | +``` |
| 15 | + |
| 16 | +### Binaries |
| 17 | + |
| 18 | +See [latest release](https://github.com/goark/gpt-cli/releases/latest). |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +``` |
| 23 | +$ gpt-cli -h |
| 24 | +CLI tool for GPT with OpenAI API. |
| 25 | +
|
| 26 | +Usage: |
| 27 | + gpt-cli [flags] |
| 28 | + gpt-cli [command] |
| 29 | +
|
| 30 | +Available Commands: |
| 31 | + chat Chat with GPT-x |
| 32 | + help Help about any command |
| 33 | + version Print the version number |
| 34 | +
|
| 35 | +Flags: |
| 36 | + --api-key string OpenAI API key |
| 37 | + --config string Config file (default /home/username/.config/gpt-cli/config.yaml) |
| 38 | + --debug for debug |
| 39 | + -h, --help help for gpt-cli |
| 40 | +
|
| 41 | +Use "gpt-cli [command] --help" for more information about a command. |
| 42 | +``` |
| 43 | + |
| 44 | +### Chat with GPT-x |
| 45 | + |
| 46 | +``` |
| 47 | +$ gpt-cli chat -h |
| 48 | +Chat with GPT-x, input from standard input. |
| 49 | +
|
| 50 | +Usage: |
| 51 | + gpt-cli chat [flags] |
| 52 | +
|
| 53 | +Aliases: |
| 54 | + chat, c |
| 55 | +
|
| 56 | +Flags: |
| 57 | + -c, --clipboard Input message from clipboard |
| 58 | + -h, --help help for chat |
| 59 | + -i, --interactive Interactive mode |
| 60 | + -p, --profile string Path of Profile file (JSON format) |
| 61 | + --raw Output raw response (JSON format) |
| 62 | +
|
| 63 | +Global Flags: |
| 64 | + --api-key string OpenAI API key |
| 65 | + --config string Config file (default /home/username/.config/gpt-cli/config.yaml) |
| 66 | + --debug for debug |
| 67 | +``` |
| 68 | + |
| 69 | +### Input form Standard input |
| 70 | + |
| 71 | +``` |
| 72 | +$ echo hello | gpt-cli c --api-key "your-api-key" |
| 73 | +Hello! How can I help you today? |
| 74 | +``` |
| 75 | + |
| 76 | +### Interactive mode |
| 77 | + |
| 78 | +``` |
| 79 | +$ gpt-cli c -i --api-key "your-api-key" |
| 80 | +
|
| 81 | +Chat> こんにちは |
| 82 | +こんにちは!私はAIのアシスタントです。何かお手伝いできることがありますか? |
| 83 | +Chat> 科学雑誌の日経サイエンスにChatGPTの特集が載るそうです。どんな内容になるか予想してみましょう。 |
| 84 | +ChatGPTとは、人工知能による自然言語処理を利用した対話型のチャットボットです。日経サイエンスがChatGPTに特集を組むことから、以下のような予想が考えられます。 |
| 85 | +
|
| 86 | +1. ChatGPTの機能や特徴の紹介 |
| 87 | +ChatGPTの性能、動作原理などの詳しい解説や、どのような機能があるのか、どのような場面で活躍するのかなどが紹介される可能性があります。 |
| 88 | +
|
| 89 | +2. ChatGPTの応用例の紹介 |
| 90 | +ChatGPTが活用される応用例として、カスタマーサポート、医療支援、人工知能アシスタントなどがあります。特集では、ChatGPTがどのようにこれらの分野で活躍しているのか、具体例を交えて解説されるかもしれません。 |
| 91 | +
|
| 92 | +3. ChatGPTの進化と今後の展望について |
| 93 | +ChatGPTは、自然言語処理分野での革新的な技術であり、今後、ますます進化していくことが期待されています。特集では、今後どのような改良がされ、また、普及の度合いがどこまで広がるのか、その展望についても取り上げられるかもしれません。 |
| 94 | +Chat> ありがとうございます。雑誌を読むのが楽しみです |
| 95 | +どういたしまして。日経サイエンスは、科学技術に関する話題や最新の研究成果などが掲載され、とても興味深く読める雑誌ですね。ChatGPTに特集が組まれるということで、ますます注目が集まりそうですね。楽しみにしていてください。 |
| 96 | +Chat> q |
| 97 | +``` |
| 98 | + |
| 99 | +### Save API key to config.yaml file |
| 100 | + |
| 101 | +```yaml:$XDG_CONFIG_HOME/gpt-cli/config.yaml |
| 102 | +api-key: your_api_key_string |
| 103 | +``` |
| 104 | + |
| 105 | +## Modules Requirement Graph |
| 106 | + |
| 107 | +[](./dependency.png) |
| 108 | + |
| 109 | +## Reference |
| 110 | + |
| 111 | +- [OpenAI API](https://platform.openai.com/docs/) |
| 112 | +- [sashabaranov/go-openai: OpenAI ChatGPT, GPT-3, GPT-4, DALL·E, Whisper API wrapper for Go](https://github.com/sashabaranov/go-openai) |
| 113 | + |
| 114 | +[gpt-cli]: https://github.com/goark/gpt-cli "goark/gpt-cli: CLI tool for GPT with OpenAI API" |
0 commit comments