Skip to main content

Level up z shell with GPT

Project description

PyPI - Version PyPI - Python Version zshgpt Hatch project linting - Ruff

zshgpt


Table of Contents

About

Gif of usage

Heavily inspired by the abandoned project https://github.com/microsoft/Codex-CLI Made into a oh-my-zsh plugin.

In your zsh console, type a question, starting with comment sign #, hit ctrl+g and get an answer.

[!TIP] New in v. 1.2.0 Use doble ## to use gpt-4 model.

# Who edited README.MD last according to git history?

ChatGPT will then answer with e.g.:

git log -1 --format="%an" README.md

Hit enter to execute or ctrl+c to deny.

If asked a question that will not resolve in a command, GPT is instructed to use #.

# Who was Norways first prime minister?
# Norway's first prime minister was Frederik Stang, serving from 1873 to 1880.

Prerequisite

Installing zshgpt

First install zshgpt application, then add the plugin.

Prerequisite

[!WARNING] Valid Openai API-key

make sure to save under OPENAI_API_KEY env.

export OPENAI_API_KEY='sk-...'

With snap

Snap comes preinstalled and is probalby the fastest way if you are on Linux and do not want to use pipx.

Prerequisite

  • snap
sudo snap install zshgpt

Instructions if you don't have snap.

With pipx

Prerequisite

  • python >= 3.8
  • pipx
pipx install zshgpt

WIth pip

Prerequisite

  • python >= 3.8
  • pip
pip install zshgpt

With homebrew

This is not yet automated and you might get an older version.

Prerequisite

  • Homebrew
brew install AndersSteenNilsen/zshgpt/zshgpt

Adding plugin

With Zsh

curl https://raw.githubusercontent.com/AndersSteenNilsen/zshgpt/main/zshgpt.plugin.zsh -o ~ # Copy plugin
echo "source ~/zshgpt.plugin.zsh" >> ~/.zshrc # Add to zshrc
exec zsh # Reload zsh

With Oh My Zsh

Prerequisite

mkdir $ZSH_CUSTOM/plugins/zshgpt
curl https://raw.githubusercontent.com/AndersSteenNilsen/zshgpt/main/zshgpt.plugin.zsh -o $ZSH_CUSTOM/plugins/zshgpt/zshgpt.plugin.zsh

Then add zshgpt in your list of plugins in ~/.zshrc

plugins(
    ...
    zshgpt
    ...
)
omz reload

With zplug

~/.zshrc

...
zplug "AndersSteenNilsen/zshgpt"
zplug load

Dev setup

LOGO

Made with DALL-E

Icon

License

zshgpt is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zshgpt-1.3.1.tar.gz (252.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zshgpt-1.3.1-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file zshgpt-1.3.1.tar.gz.

File metadata

  • Download URL: zshgpt-1.3.1.tar.gz
  • Upload date:
  • Size: 252.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for zshgpt-1.3.1.tar.gz
Algorithm Hash digest
SHA256 07051db2a38e8fcaf7be7ff4c122b109bba672627a79930b4a030b96143e8af8
MD5 cd47faf358e7eea593312904d3344f32
BLAKE2b-256 4360927ca0a59b760830787aff9e17fd67bcc4affaa1b4aa04d4b91b47205299

See more details on using hashes here.

File details

Details for the file zshgpt-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: zshgpt-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.27.0

File hashes

Hashes for zshgpt-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f8f521a8517e5eb3fa37ad46fa350c6d8376277036bdcaf5d2f6b6df4772bc5
MD5 8cee327e714dbef63ec05e4c80abb474
BLAKE2b-256 f4e9b1d63ad22b9a8ec35d10eb478d081d85187ad3b382e3f6d7699693e3dcf0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page