Dev-Shell: The Easiest Way to Chat in the Terminal

Dev-shell a rust cli for interacting with ChatGPT


Description

This is a ChatGPT CLI application written in Rust. The application allows users to interact with the ChatGPT API for AI text generation within their terminal.

If you do a quick search of the internet or GitHub for projects that are using ChatGPT in some way you will find quite a few. Many use interpreted languages and need your system to be setup to use the toolchain and dependencies. dev-shell is written in rust. A key goal of the project is to make it super easy to install. Typiclly download a single binary and you're done. (except fo the small dependency on an OpenAI application key)

As a cli the application can accept input from other tools.

git log HEAD~2 | dev-shell Summarize as a release note

Project build and release status

ci release security audit

Installing

Prerequisites

You will also need a ChatGPT API key. You can get one from https://openai.com and then set it as an environment variable.

export OPENAI_API_KEY=<your key>

Install from crates.io

cargo install dev-shell

Building

Prerequisites

Clone the repository and run the tests

cargo test

Build the application

cargo build --release

add the binary target/release/dev-shell to your path or copy to a directory that is already on your path.

Use-cases

Summarize for a git commit

The following summarizes changes and commits those changes.

git diff | dev-shell Summarize changes as a git commit message. | git commit -a -F -

Which is a little long-winded, so you can create an alias in your shell.

alias dscommit="git diff | dev-shell Summarize changes as a git commit message. | git commit -a -F -"

Repository maintenance

Currently, repository maintenance is manual and run semi regularly.

Updating the rust toolchain

rustup update

Remember to update the rust toolchain used by bazel in the WORKSPACE.bazel file.

Updating dependencies

The following command will update the Cargo.lock file with the latest versions of dependencies.

cargo update

Updating/syncing bazel dependencies

This command then takes the updated dependencies and updates the equivalent bazel dependencies.

export CARGO_BAZEL_REPIN=true
bazel test //...

Inspiration

This project was inspired by the follow and the desire to learn Rust.

https://github.com/TheR1D/shell_gpt


Download Details:

Author: grahambrooks
Source Code: https://github.com/grahambrooks/dev-shell 
License: MIT license

#gpt #chatgpt #shell #cli 

Dev-Shell: The Easiest Way to Chat in the Terminal
1.05 GEEK