yo

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 7 Imported by: 0

README ΒΆ

πŸš€ Yo πŸ’¬

AI powered terminal assistant.

Demo

Table of contents

Description

Yo is an AI powered assistant for your terminal.

You can converse with it using your natural language, and it will provide you with ready to use command lines, or engage in a discussion to assist you.

Yo is already aware of your:

  • operating system
  • distribution
  • username
  • shell
  • home directory
  • preferred editor

And you can also give any supplementary preferences to fine tune your user experience (see configuration section).

Installation

go get && sudo go build -o /usr/local/bin/yo && sudo chmod +x /usr/local/bin/yo

Configuration

At the first execution, Yo will ask you to provide an OpenAI API key.

It will then generate your configuration in the file ~/.config/yo.json, with the following structure:

{
  "openai_key": "sk-xxxxxxxxx",       // OpenAI API key
  "openai_proxy": "",                 // OpenAI API proxy (if needed)
  "openai_temperature": 0.2,          // OpenAI API temperature
  "user_default_prompt_mode": "exec", // user prefered prompt mode: "exec" (default) or "chat"
  "user_preferences": ""              // user preferences, expressed in natural language
}

Usage

Yo provides 2 run modes:

  • REPL mode: terminal user interface, made to offer interactive prompts in a loop
  • CLI mode: command line interface, made to perform a single run
REPL mode
yo

This will open a REPL interface, with 2 types of prompts

  • πŸš€ exec: will generate a command line to execute for what you're asking
  • πŸ’¬ chat: will engage in a discussion to help you the best way possible

You also can use the following keyboard shortcuts:

Keys Description
↑ ↓ Navigate in history
tab Switch between πŸš€ exec and πŸ’¬ chat prompt modes
ctrl+s Open editor on configuration file
ctrl+r Clear terminal and reset discussion history
ctrl+l Clear terminal but keep discussion history
ctrl+c Exit or interrupt command execution / chat completion
CLI mode
yo explain what is the therory of relativity

This will perform a single run, using your preferred prompt mode.

yo -e list all processes listening on port 8080

This will perform a single command line generation (enforcing πŸš€ exec prompt mode usage with -e).

yo -c generate me a go application example using fiber

This will reply to a single question (enforcing πŸ’¬ chat prompt mode usage with -c).

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL