Code Monkey home page Code Monkey logo

shellgpt's Introduction

ShellGPT

Chat with LLM in your terminal, be it shell generator, story teller, linux-terminal, etc.

Install

pip install -U shgpt

This will install two commands: sg and shgpt, which are identical.

After install, use sg --init to create required directories(mainly ~/.shellgpt).

Usage

ShellGPT has three modes to use:

  • Direct mode, sg [question] or pipeline like echo question | sg.
  • TUI mode, sg, tailored for infer shell command.
  • REPL mode, sg -l, chat with LLM.

See conf.py for detailed configs.

TUI

There are some key bindings to use in TUI: option

  • ctrl+j, Infer answer
  • ctrl+r, Run command
  • ctrl+y, Yank command

TUI screenshot

Role

There are 4 built-in system role contents in shellgpt:

  • default, used for ask general questions
  • code, used for ask programming questions
  • shell, used for infer shell command
  • cm, used for generate git commit message, like git diff | sg -r cm

Users can define their own content in ~/.shellgpt/roles.json, it a JSON map with

  • key being role name and
  • value being role content

Or you can just copy roles.json to play with, it's generated from Awesome ChatGPT Prompts.

$ shgpt -r linux-terminal pwd
/home/user

$ shgpt -r javascript-console 0.1 + 0.2
0.3

Requirements

  • Ollama, you need to download models before try shellgpt.

License

GPL-3.0

shellgpt's People

Contributors

jiacai2050 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.