Skip to content

Commit

Permalink
Merge pull request #19 from ekkinox/feat/yai
Browse files Browse the repository at this point in the history
Rename in yai
  • Loading branch information
ekkinox authored Apr 25, 2023
2 parents a49e6ce + c7c7e20 commit b936543
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 79 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## 0.6.0

### Changed

- Changed project name from Yo to Yai, thanks to [@K-arch27](https://github.com/K-arch27) for the suggestion.

## 0.5.0

### Added
Expand Down
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# 🚀 Yo 💬 - AI powered terminal assistant
# 🚀 Yai 💬 - AI powered terminal assistant

[![build](https://github.com/ekkinox/yo/actions/workflows/build.yml/badge.svg)](https://github.com/ekkinox/yo/actions/workflows/build.yml)
[![release](https://github.com/ekkinox/yo/actions/workflows/release.yml/badge.svg)](https://github.com/ekkinox/yo/actions/workflows/release.yml)
[![doc](https://github.com/ekkinox/yo/actions/workflows/doc.yml/badge.svg)](https://github.com/ekkinox/yo/actions/workflows/doc.yml)
[![build](https://github.com/ekkinox/yai/actions/workflows/build.yml/badge.svg)](https://github.com/ekkinox/yai/actions/workflows/build.yml)
[![release](https://github.com/ekkinox/yai/actions/workflows/release.yml/badge.svg)](https://github.com/ekkinox/yai/actions/workflows/release.yml)
[![doc](https://github.com/ekkinox/yai/actions/workflows/doc.yml/badge.svg)](https://github.com/ekkinox/yai/actions/workflows/doc.yml)

> Unleash the power of artificial intelligence to streamline your command line experience.
![Intro](docs/_assets/intro.gif)

## What is Yo ?
## What is Yai ?

`Yo` is an assistant for your terminal, using [OpenAI ChatGPT](https://chat.openai.com/) to build and run commands for you. You just need to describe them in your everyday language, it will take care or the rest.
`Yai` (your AI) is an assistant for your terminal, using [OpenAI ChatGPT](https://chat.openai.com/) to build and run commands for you. You just need to describe them in your everyday language, it will take care or the rest.

You have any questions on random topics in mind? You can also ask `Yo`, and get the power of AI without leaving `/home`.
You have any questions on random topics in mind? You can also ask `Yai`, and get the power of AI without leaving `/home`.

It is already aware of your:
- operating system & distribution
Expand All @@ -23,19 +23,20 @@ And you can also give any supplementary preferences to fine tune your experience

## Documentation

A complete documentation is available at [https://ekkinox.github.io/yo/](https://ekkinox.github.io/yo/).
A complete documentation is available at [https://ekkinox.github.io/yai/](https://ekkinox.github.io/yai/).

## Quick start

To install `Yo`, simply run:
To install `Yai`, simply run:

```shell
curl -sS https://raw.githubusercontent.com/ekkinox/yo/main/install.sh | bash
curl -sS https://raw.githubusercontent.com/ekkinox/yai/main/install.sh | bash
```

At first run, it will ask you for an [OpenAI API key](https://platform.openai.com/account/api-keys), and use it to create the configuration file in `~/.config/yo.json`.

See [documentation](https://ekkinox.github.io/yo/getting-started/#configuration) for more information.
At first run, it will ask you for an [OpenAI API key](https://platform.openai.com/account/api-keys), and use it to create the configuration file in `~/.config/yai.json`.

See [documentation](https://ekkinox.github.io/yai/getting-started/#configuration) for more information.

## Thanks

Thanks to [@K-arch27](https://github.com/K-arch27) for the `yai` name idea!
18 changes: 9 additions & 9 deletions ai/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"regexp"
"strings"

"github.com/ekkinox/yo/config"
"github.com/ekkinox/yo/system"
"github.com/ekkinox/yai/config"
"github.com/ekkinox/yai/system"

"github.com/sashabaranov/go-openai"
)
Expand Down Expand Up @@ -304,7 +304,7 @@ func (e *Engine) prepareSystemPrompt() string {
}

func (e *Engine) prepareSystemPromptExecPart() string {
return "Your are Yo, a powerful terminal assistant generating a JSON containing a command line for my input.\n" +
return "Your are Yai, a powerful terminal assistant generating a JSON containing a command line for my input.\n" +
"You will always reply using the following json structure: {\"cmd\":\"the command\", \"exp\": \"some explanation\", \"exec\": true}.\n" +
"Your answer will always only contain the json structure, never add any advice or supplementary detail or information, even if I asked the same question before.\n" +
"The field cmd will contain a single line command (don't use new lines, use separators like && and ; instead).\n" +
Expand All @@ -313,22 +313,22 @@ func (e *Engine) prepareSystemPromptExecPart() string {
"\n" +
"Examples:\n" +
"Me: list all files in my home dir\n" +
"Yo: {\"cmd\":\"ls ~\", \"exp\": \"list all files in your home dir\", \"exec\\: true}\n" +
"Yai: {\"cmd\":\"ls ~\", \"exp\": \"list all files in your home dir\", \"exec\\: true}\n" +
"Me: list all pods of all namespaces\n" +
"Yo: {\"cmd\":\"kubectl get pods --all-namespaces\", \"exp\": \"list pods form all k8s namespaces\", \"exec\": true}\n" +
"Yai: {\"cmd\":\"kubectl get pods --all-namespaces\", \"exp\": \"list pods form all k8s namespaces\", \"exec\": true}\n" +
"Me: how are you ?\n" +
"Yo: {\"cmd\":\"\", \"exp\": \"I'm good thanks but I cannot generate a command for this. Use the chat mode to discuss.\", \"exec\": false}"
"Yai: {\"cmd\":\"\", \"exp\": \"I'm good thanks but I cannot generate a command for this. Use the chat mode to discuss.\", \"exec\": false}"
}

func (e *Engine) prepareSystemPromptChatPart() string {
return "You are Yo a powerful terminal assistant created by github.com/ekkinox.\n" +
return "You are Yai a powerful terminal assistant created by github.com/ekkinox.\n" +
"You will answer in the most helpful possible way.\n" +
"Always format your answer in markdown format.\n\n" +
"For example:\n" +
"Me: What is 2+2 ?\n" +
"Yo: The answer for `2+2` is `4`\n" +
"Yai: The answer for `2+2` is `4`\n" +
"Me: +2 again ?\n" +
"Yo: The answer is `6`\n"
"Yai: The answer is `6`\n"
}

func (e *Engine) prepareSystemPromptContextPart() string {
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/sashabaranov/go-openai"

"github.com/ekkinox/yo/system"
"github.com/ekkinox/yai/system"
"github.com/spf13/viper"
)

Expand Down
9 changes: 4 additions & 5 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ import (
"strings"
"testing"

"github.com/sashabaranov/go-openai"

"github.com/ekkinox/yo/system"
"github.com/ekkinox/yai/system"

"github.com/sashabaranov/go-openai"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand All @@ -33,12 +32,12 @@ func setupViper(t *testing.T) {
viper.Set(user_default_prompt_mode, "exec")
viper.Set(user_preferences, "test_preferences")

require.NoError(t, viper.SafeWriteConfigAs("/tmp/yo.json"))
require.NoError(t, viper.SafeWriteConfigAs("/tmp/yai.json"))
}

func cleanup(t *testing.T) {
t.Helper()
require.NoError(t, os.Remove("/tmp/yo.json"))
require.NoError(t, os.Remove("/tmp/yai.json"))
}

func testNewConfig(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
title: 🚀 Yo 💬
title: 🚀 Yai 💬
title_separator: "|"
email: ekkinox@gmail.com
repository: "ekkinox/yo"
repository: "ekkinox/yai"
description: >-
Yo is an AI (artificial intelligence) powered terminal assistant.
Yai (your AI) is an artificial intelligence powered terminal assistant.
Use it to prepare and execute any command lines from requests expressed in your natural language.
You can also engage in conversation with it about any topics you may think about.
Unleash the power of AI with the comfort of staying at /home !
Expand Down
2 changes: 1 addition & 1 deletion docs/_data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ main:
url: /examples/
- title: "GitHub"
icon: "fab fa-fw fa-github"
url: https://github.com/ekkinox/yo
url: https://github.com/ekkinox/yai
4 changes: 2 additions & 2 deletions docs/_pages/404.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: "Page Not Found"
excerpt: "Yo, page not found. Your pixels are in another canvas."
excerpt: "Page not found. Your pixels are in another canvas."
sitemap: false
permalink: /404.html
---

Yo, the page you were trying to view does not exist.
The page you were trying to view does not exist.
22 changes: 12 additions & 10 deletions docs/_pages/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,44 @@ classes: wide
permalink: /examples/
---

> The examples below use `yo` as command name, but it has been renamed meanwhile in `yai`.
## CLI mode

`Yo` can be used in `CLI` mode to streamline your terminal workflow.
`Yai` can be used in `CLI` mode to streamline your terminal workflow.

For example, this is how it can assist you while developing an application:

![](https://raw.githubusercontent.com/ekkinox/yo/main/docs/_assets/dev.gif)
![](https://raw.githubusercontent.com/ekkinox/yai/main/docs/_assets/dev.gif)

You can also pipe any input and make it work with it:

![](https://raw.githubusercontent.com/ekkinox/yo/main/docs/_assets/pipe.gif)
![](https://raw.githubusercontent.com/ekkinox/yai/main/docs/_assets/pipe.gif)

## REPL mode

`Yo` can be used in `REPL` mode to offer interactive prompts and chain instructions.
`Yai` can be used in `REPL` mode to offer interactive prompts and chain instructions.

### Command lines

An example on how it can help you to manage your system:

![](https://raw.githubusercontent.com/ekkinox/yo/main/docs/_assets/system.gif)
![](https://raw.githubusercontent.com/ekkinox/yai/main/docs/_assets/system.gif)

Or help you to manage your packages:

![](https://raw.githubusercontent.com/ekkinox/yo/main/docs/_assets/pkg.gif)
![](https://raw.githubusercontent.com/ekkinox/yai/main/docs/_assets/pkg.gif)

It can also go way further, for example help you to manage docker resources:

![](https://raw.githubusercontent.com/ekkinox/yo/main/docs/_assets/docker.gif)
![](https://raw.githubusercontent.com/ekkinox/yai/main/docs/_assets/docker.gif)

Or even help you while using a k8s cluster:

![](https://raw.githubusercontent.com/ekkinox/yo/main/docs/_assets/k8s.gif)
![](https://raw.githubusercontent.com/ekkinox/yai/main/docs/_assets/k8s.gif)

### Chat

`Yo` is not made to just generate command lines. You can also engage in a discussion with it about any topics.
`Yai` is not made to just generate command lines. You can also engage in a discussion with it about any topics.

![](https://raw.githubusercontent.com/ekkinox/yo/main/docs/_assets/chat.gif)
![](https://raw.githubusercontent.com/ekkinox/yai/main/docs/_assets/chat.gif)
18 changes: 9 additions & 9 deletions docs/_pages/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ classes: wide
permalink: /getting-started/
---

## What is `Yo` ?
## What is `Yai` ?

`Yo` is an assistant for your terminal, unleashing the power of artificial intelligence to streamline your command line experience.
`Yai` (your AI) is an assistant for your terminal, unleashing the power of artificial intelligence to streamline your command line experience.

It is already aware of your:
- operating system & distribution
Expand All @@ -17,23 +17,23 @@ And you can also give any supplementary preferences to fine tune your experience

## Installation

To install `Yo`, simply run:
To install `Yai`, simply run:

```shell
curl -sS https://raw.githubusercontent.com/ekkinox/yo/main/install.sh | bash
curl -sS https://raw.githubusercontent.com/ekkinox/yai/main/install.sh | bash
```

- this will detect the proper binary to install for your machine
- and upgrade to the latest stable version if already installed

You can also install it from the [available releases](https://github.com/ekkinox/yo/releases) from the GitHub repository.
You can also install it from the [available releases](https://github.com/ekkinox/yai/releases) from the GitHub repository.


## Configuration

At first run, `Yo` will ask you to provide an [OpenAI API key](https://platform.openai.com/account/api-keys) (required to interact with **ChatGPT AI**).
At first run, `Yai` will ask you to provide an [OpenAI API key](https://platform.openai.com/account/api-keys) (required to interact with **ChatGPT AI**).

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

```json
{
Expand All @@ -49,7 +49,7 @@ It will then generate your configuration in the file `~/.config/yo.json`, with t

## Fine tuning

You can fine tune `Yo` by editing the settings in the `~/.config/yo.json` configuration file.
You can fine tune `Yai` by editing the settings in the `~/.config/yai.json` configuration file.

Note that in `REPL` mode, you can press anytime `ctrl+s` to edit settings:
- it will open your editor on the configuration file
Expand Down Expand Up @@ -77,4 +77,4 @@ You can use the `user_preferences` to express any preferences in your natural la
}
```

`Yo` will take them into account.
`Yai` will take them into account.
12 changes: 6 additions & 6 deletions docs/_pages/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ permalink: /usage/
You can perform a single run:

```shell
yo list all processes listening on port 8080
yai list all processes listening on port 8080
```

You can ask for a command line generation, enforcing `🚀 exec` prompt mode usage with `-e`:

```shell
yo -e show the disk usage of my docker resources
yai -e show the disk usage of my docker resources
```

You can ask any question, enforcing `💬 chat` prompt mode usage with `-c`:

```shell
yo -c generate me a go application example using fiber
yai -c generate me a go application example using fiber
```

You can also `pipe` input that will be taken into account in your request:

```shell
cat some_script.go | yo -c generate unit tests
cat some_script.go | yai -c generate unit tests
```

Or even:

```shell
cat error.log | yo -c explain what is wrong here
cat error.log | yai -c explain what is wrong here
```

## REPL mode
Expand All @@ -45,7 +45,7 @@ cat error.log | yo -c explain what is wrong here
Just run:

```shell
yo
yai
```

This will open a [REPL](https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop) interface, with 2 types of prompts (use `tab` to switch)
Expand Down
10 changes: 5 additions & 5 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ layout: splash
classes: wide
---

## `Yo` - AI powered terminal assistant
## `Yai` - AI powered terminal assistant

> Unleash the power of artificial intelligence to streamline your command line experience.
> With `Yai` (your AI), unleash the power of artificial intelligence to streamline your command line experience.
![](https://raw.githubusercontent.com/ekkinox/yo/main/docs/_assets/intro.gif)
![](https://raw.githubusercontent.com/ekkinox/yai/main/docs/_assets/intro.gif)

Just type your request in everyday language, and it will determine the appropriate command line action to take, or engage in conversation on any topics you have in mind.

With `Yo`, you get the power of [OpenAI ChatGPT](https://chat.openai.com/) with the comfort of staying at `/home`!
With `Yai`, you get the power of [OpenAI ChatGPT](https://chat.openai.com/) with the comfort of staying at `/home`!

See the project on [GitHub](https://github.com/ekkinox/yo).
See the project on [GitHub](https://github.com/ekkinox/yai).

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ekkinox/yo
module github.com/ekkinox/yai

go 1.19

Expand Down
Loading

0 comments on commit b936543

Please sign in to comment.