4.6.0 • Published 10 months ago

@johannlai/gptcli v4.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

GPT CLI is a command-line interface tool that allows you to create your own ChatGPT CLI tools in seconds. It's as simple as creating a GitHub Actions workflow. With GPT CLI, you can customize your CLI tools to suit your needs and make your work more efficient.

Note: ALL the commit message is wrote by this plugin, awesome!

🚀 Features

  • All in one ChatGPT CLI
  • Create custom ChatGPT CLI tools in seconds
  • Customize your CLI tools to suit your needs
  • Easy to install and use

🔧 Installation

You can install GPT CLI using npm or brew:

npm

To run this CLI tool, you need to have Node.js version 16+ , recommended to use nvm to manage node version.

npm install -g @johannlai/gptcli

brew(WIP)

brew install johannlai/tap/gptcli

Setup alias convenience commands

These will add the commands to your shell, but only for the current session. To make them available in all future sessions, you should add the above command on a line by itself to the bottom of your .zshrc or .bashrc or equivalent.

eval "$(gptcli alias)"

NOW, you can use ?? to start AI Command

$ ?? "show all js files in the current folder"
> AI is thinking...
# then you will see the result
> ls -al | grep .js

# chat?
$ chat?
👽: Hi, I am ChatGpt, I can answer your questions. Ask me anything, or say "bye" to exit.
? 🫣 how git diff --cached add EXCLUDE

# translate : t? "hello world"
$ t? "hello world"
> 你好,世界

# for more plugins, please check the plugins section

🧰 Built-in Plugins

GPT CLI comes with a variety of built-in plugins to help you get started. Here's a table of the current built-in plugins:

PluginDescriptionUsage
chatThe chat plugin enables real-time interaction with the ChatGPT model directly in the terminal, allowing users to chat and get answers quickly and efficiently.gptcli chat (alias chat?)
commandThe command plugin allows users to describe their desired command in natural language, and then outputs the corresponding plugin to fulfill the user's request. For example, if the user inputs "show all js files in the current folder", the plugin will output the corresponding plugin to display all the .js files in the current folder. This plugin makes it easier for users to find and utilize the appropriate plugins for their needs.gptcli command "write a command to list all js file" (alias ??)
translateThe translate plugin allows users to easily translate text within the terminal. By using this plugin, users can input any text they want to translate, choose their desired target language, and the plugin will output the translated text in the terminal. This plugin makes it more convenient for users to translate text without having to switch to a separate application or window.gptcli translate "你好" --to en (alias t?)
commitThe commit plugin allows users to generate a Git commit message automatically by simply entering gptcli commit in the terminal. The plugin will use the content from the Git diff to create a suitable commit message, making it easier for users to commit changes without having to manually craft a commit message themselves. This plugin helps streamline the Git commit process and saves users time and effort. All the commit message is wrote by this plugin, awesome!! Inspired By aicommitgptcli commit (alias commit?)
gitmojiThe gitmoji plugin allows users to generate Git commit messages in the gitmoji format by using the command "gptcli gitmoji" followed by a brief description of the commit, such as "fix a bug". This plugin utilizes emojis to provide visual representations of the type of commit being made(e.g: 🐛 fix a bug), making it easier for users to categorize and understand the purpose of each commit. 🎉🚀👍gptcli gitmoji "fix a bug"
czthe cz plugin is the cz-cli plugin for ChatGPT. You can input the commit message, and cz plugin help you transform it into cz style(fix: fix a bug)gptcli cz "fix a bug"
weatherThe weather plugin allows users to check the weather in any city with Natural language, it will generate a curl command to curl wttr.in , and show the weather information in the terminalgptcli weather "Hongkong weather"
notionWIPgptcli notion create xxx
whisperWIPThe whisper plugin will run whisper in local machinegptcli whisper "input.mp4"

Help of built-in plugins

You can get help for each plugin by running the following command:

# chat plugin
gptcli chat help

# command plugin
gptcli command help

# and so on

List of built-in plugins

gptcli list

🛠️ Configuration

User configuration

🎉 Now! feel free to use MY OWN ChatGPT API KEY, but it's not recommended, because it's not stable, you can use your own API KEY, just follow the steps below:

gptcli config user.OPENAI_API_KEY sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

You can get your own API KEY from OpenAI

To configure the plugin

Some plugins require additional configuration to work properly. For example, the commit plugin requires a commit style to be specified. To configure the plugin, you can use the gptcli config command. For example, to configure the commit plugin to use the cz commit style, you can run the following command:

# cz style: fix: fix a bug
gptcli config commit.style cz

or gitmoji style:

# gitmoji style: 🐛 fix a bug
gptcli config commit.style gitmoji

👥 Community plugins

Coming soon...

Will be displayed in the website :)

For now, you can share your plugin with the community by submitting a pull request to add it to the list of community plugins. thanks! 👍

🎨 Customization, Build your own plugin in seconds

To create your own CLI plugin, you can fork this template repository and customize it to suit your needs. You can test your plugin locally and then install it globally using gptcli. For more information on how to create your own plugin, please refer to the template repository.

Don't forget to share your plugin with the community by submitting a pull request to add it to the list of community plugins.

It's easy to build your own plugin, just one YAML file

name: joke
description: "joke plugin for gpt cli"
repository: "johannlai/joke"
author: "johannlai"
help: |
  joke plugin for gpt cli
  Usage:
    ❯ gpt joke
    ❯ "Why did the tomato turn red? Because it saw the salad dressing!"
steps:
  - name: "ask ai to output joke"
    # use the gpt:createChatCompletion action to create a chat completion
    uses: "gpt:createChatCompletion"
    with:
      messages:
        - role: "user"
          content: "tell me a joke"
    export:
      # export the response content to the JOKE environment variable
      response_content: JOKE
  - name: "output response"
    # output the JOKE environment variable
    script: |
      echo $JOKE

For more information, please refer to the template repository

📜 License

GPT CLI is licensed under the MIT License. See the LICENSE file for more information.

📋 Other Information

For more information on how to use GPT CLI, please refer to the official website.

Issues

Ask questions, report bugs, and request features on the GitHub issues page


💻 Build by GitHub & ChatGPT with ❤️

4.6.0

10 months ago

4.5.2

10 months ago

4.5.1

10 months ago

4.5.0

1 year ago

4.4.1

1 year ago

4.4.0

1 year ago

4.3.0

1 year ago

4.2.0

1 year ago

4.1.0

1 year ago

4.0.0

1 year ago

3.11.0

1 year ago

3.10.0

1 year ago

3.9.0

1 year ago

3.8.1

1 year ago

3.8.0

1 year ago

3.7.0

1 year ago

3.6.4

1 year ago

3.6.3

1 year ago

3.6.2

1 year ago

3.6.1

1 year ago

3.6.0

1 year ago

3.5.0

1 year ago

3.4.0

1 year ago

3.3.1

1 year ago

3.3.0

1 year ago

3.2.0

1 year ago

3.1.0

1 year ago

3.0.0

1 year ago

2.14.0

1 year ago

2.13.0

1 year ago

2.12.0

1 year ago

2.11.0

1 year ago

2.10.0

1 year ago

2.9.0

1 year ago

2.8.0

1 year ago

2.7.0

1 year ago

2.6.1

1 year ago

2.6.0

1 year ago

2.5.0

1 year ago

2.4.0

1 year ago

2.3.0

1 year ago

2.2.0

1 year ago

2.1.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.0

1 year ago