Skip to content

MrPicklePinosaur/shrs_openai

Repository files navigation

shrs_openai

crates.io docs.rs MIT/Apache 2.0

This is a plugin for shrs. It enables the ability to use ChatGPT to help you out on common command like tasks like:

  • ask to write a command for you (list all stopped docker containers and delete them)
  • answer questions based on your shell environment (why did my last command not work?)
  • pass contents of files (why is this JSON file deformed?)

Using this plugin

First add this plugin to your dependencies

shrs_openai = { version = "0.0.2" }

Then include this plugin when initializing shrs

use shrs::prelude::*;
use shrs_openai::OpenaiPlugin;

let api_key = std::env::var("OPENAI_KEY").unwrap().to_string();

let myshell = ShellBuilder::default()
    .with_plugin(OpenaiPlugin::new(api_key))
    .build()
    .unwrap();

About

ai for the command line

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published