Giter Club home page Giter Club logo

kenmick / z-cli Goto Github PK

View Code? Open in Web Editor NEW
13.0 1.0 0.0 120 KB

An interactive ChatGPT-powered command line tool that generates commands using natural language. z-cli 是一个基于 ChatGPT 的交互式命令行工具,支持用户输入自然语言来生成可执行的命令。

Home Page: https://www.npmjs.com/package/@kenmick/z-cli

License: GNU General Public License v3.0

TypeScript 86.92% JavaScript 13.08%
chatgpt cli command-line-tool interactive openai

z-cli's Introduction

z-cli

z-cli is an interactive ChatGPT-powered command line tool that generates commands using natural language.

🚀 Features

  • Natural language query: Generates commands based on the user's natural language input.
  • Runtime detection: Detects the user's shell (e.g. PowerShell, zsh, bash, etc.) and OS (e.g. Windows, Linux, and Mac) to ensure more accurate command generation.
  • Context awareness: Allows the user to input follow-up queries to specify additional requirements.
  • Command editing: Allows the user to manually refine the generated command before executing it.
  • Command copy: Allows the user to copy the generated command to the clipboard.

🕹️ Example

  • zsh: Find files under specified conditions and display the number of lines for each file.

find

  • PowerShell: Request an API and return the response in the specified format.

request_api

📦 Installation

You can install z-cli by running the following command:

npm install -g @kenmick/z-cli

🛠️ Configuration

Before using z-cli, you need to set up the environment variable OPENAI_API_KEY.

# Linux and Mac
export OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Windows
$env:OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

You can get your own API KEY from OpenAI

📖 Usage

To use z-cli, simply run the command followed by your desired input. For example:

z-cli 'list js files'

You will then receive the following output:

ls *.js

You can discover more usage by running z-cli --help.

z-cli v0.2.0

Usage:
  z-cli [flags...] <query>

Flags:
      --debug                 Enable debug mode
  -h, --help                  Show help
  -p, --proxy <string>        Proxy url. e.g. http://localhost:1080
      --version               Show version

📌 Why the name "z-cli"?

I named it z-cli to in memory of someone named ZCL who was a REALLY IMPORTANT person to me. 🌷

🤝 Contributing

Contributions are always welcome! If you have any suggestions or run into any issues, please create a new issue or pull request.

📜 License

z-cli is GPL-3.0 licensed.

z-cli's People

Contributors

kenmick avatar

Stargazers

bigbigworld avatar VVVincent avatar Luka avatar  avatar  avatar Xu Hong Bo avatar  avatar JKlancer avatar  avatar  avatar ebigram avatar  avatar Andrew Johnson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.