Bard-Shell: A Tool for Sending Linux Command Outputs to Bard.

Introduction

I recently created a software called Bard-Shell, which allows me to send the output of Linux commands to Bard for debugging and other purposes. Bard-Shell is a simple Python script that takes a Linux command as input and pipes the output to Bard.

Usage and Examples

The Usage instructions are provided on the github page.

Setup an alias for bard in .zshrc which points to bard-shell.py

Simple use

To send the output of the ls command to Bard, I would type the following command using the -p flag to pass in a prompt about the thing i would like to do:

ls | bard -p "Summarize the contents of this folder"

Bard-Shell will then send the output of the ls command to Bard, where I can use it for anything.

For Debugging

You can pass errors into bard and ask it to resolve the issue you are facing For Example, passing in the status of lightdm to resolve some error

systemctl status lightdm | bard -p "Suggest Solutions to any error found in this command output" 

You can also pass in these flags to provide Bard with extra information.

  1. -i or --send-sysinfo - To send system information (Using neofetch right now)
  2. -w or --send-pwd - To send present working directory

Some users consider this to be a privacy hazard, so it is opt in

Writing Code

Bard-Shell supports a variety of options when generating code from bard Using the -m flag to specify you need only the code, brings up an options menu

bard -p "Write a shell script to remind me to drink water every 10 minutes" -m code

The menu is as follows:

# Generated code here
[E]dit,[R]un,[W]rite,[A]bort:

The menu allows you to:

  • Edit the generated code
  • Write it to any file
  • Run the code directly (Only works on bash scripts right now)

For Fun

You can use bard-shell without passing any command output as normal Bard in the shell

bard -p "Write a Rick and morty conversation on the growing power of AI"

Some insight

I created Bard-Shell because I often find myself needing to debug Linux commands. In the past, I would have to copy and paste the output of the command into a text editor, then send it to Bard. (Or Just search for hours on the internet) This was a tedious process, and it was easy to make mistakes.

Bard-Shell makes it much easier to debug Linux commands. I can simply type the command and Bard-Shell will send the output to Bard for me. This is a much faster and more efficient process.

Future Scope

I am still working on improving Bard-Shell. In the future, I plan to add the following features:

  • The ability to send the output of multiple commands to Bard at once.
  • The ability to save the output of commands to a file.
  • The ability to filter the output of commands.

I believe that Bard-Shell is a useful productivity tool for anyone. It makes it easy to debug Linux commands and to share the output of commands with others.

Conclusion

Bard-Shell is a simple but useful tool for productivity, and helps you find information quickly and efficiently using the amazing power of AI.

In fact, this blog was generated by Bard-Shell, I made some changes to it by adding more Examples and stuff

Have a good one!

Repo : https://github.com/kshitijaucharmal/Bard-Shell