https://github.com/mod-at-nwa/zsh-galactica
A role based GPT enabled plugin for oh-my-zsh, with Powerlevel10k integration.
https://github.com/mod-at-nwa/zsh-galactica
completion gpt-3 gpt-3-5-turbo gpt-35-turbo oh-my-zsh-plugin powerlevel10k zsh zsh-plugin
Last synced: 3 months ago
JSON representation
A role based GPT enabled plugin for oh-my-zsh, with Powerlevel10k integration.
- Host: GitHub
- URL: https://github.com/mod-at-nwa/zsh-galactica
- Owner: mod-at-nwa
- License: mit
- Created: 2023-06-14T16:34:53.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-29T18:28:38.000Z (11 months ago)
- Last Synced: 2025-01-29T03:55:49.863Z (9 months ago)
- Topics: completion, gpt-3, gpt-3-5-turbo, gpt-35-turbo, oh-my-zsh-plugin, powerlevel10k, zsh, zsh-plugin
- Language: Shell
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Roadmap: docs/ROADMAP.md
Awesome Lists containing this project
README
# ZSH-GALACTICA
## DEPRECATED
This project is no longer maintained.## Description
An oh-my-zshell plugin to use OpenAI's GPT to complete commands
and edit files. Inspired by Battlestar Galactica's Captain Adama.zsh-galactica uses roles to enable different functions of the plugin.
Currently there are two roles: `quick-cli` and `script-maker`.Quick-cli is used to complete commands. Give GPT a clue and it will
do its best to fill in the rest.Script-maker is used to create and edit scripts. This is an alpha
release level work in progress, but it may be useful.This plugin is a work in progress. It's not complete but still
quite useful.```
❯ grole
# select quick-cli
❯ hello world; ^G^G
❯ echo "hello world"
hello world
```Other completion examples:
```
❯ what's my ip address; ^G^G
❯ cd to default syslog location; ^G^G
```## Installation
1. Use git to clone this repo into your oh-my-zsh custom plugins directory: `git clone https://github.com/mod-at-arktech/zsh-galactica.git $ZSH_CUSTOM/plugins/zsh-galactica`
2. `cd !$ && source rolesetup.sh`
3. Then add the plugin to your .zshrc file, somewhere after fzf: `plugins=(fzf zsh-galactica)`
4. Set OPENAI_API_KEY in your `.zshrc` or `.zshenv` file. You can get an API key from (OpenAI)[https://beta.openai.com/].## Powerlevel10k
If you use powerlevel10k, you can add the following to your `.p10k.zsh` file to add a role indicator to your prompt:
```
galactica_role
```
Put this line in the `typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS` section of your `.p10k.zsh` file.
Also, for color specification:
```
typeset -g POWERLEVEL9K_GALACTICA_ROLE_FOREGROUND='black'
typeset -g POWERLEVEL9K_GALACTICA_ROLE_BACKGROUND='white'
```## Usage
+ `^G^R` or `grole` to select a role
+ `^G^G` to complete the current command
+ `galactica-help` for more information
# zsh-galactica