tardigrade

command module
v0.0.0-...-40291e4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2023 License: MIT Imports: 10 Imported by: 0

README

Tardigrade

Tardigrade

Bookmark all your commands!!!

Description

Tardigrade is a bookmark tool for commands. Tardigrade lets you easily navigate throughout dozens and dozens of commands. Tardigrade is a command line tool that assists remembering and retrieving any type of commands. One can store commands that had been used before. The commands are saved in a hierarchical and organized way that is easy to retrieve.

Usage examples

  • normal usage, using tardigrade to find and call a command

usage sample

  • sample yaml file:
group1:
  group12:
  - echo some thing ^ echoing something
  - echo something else
  group14:
  - ls -la ^ list all files @ls @listing-files
  - echo hi there ^ echoing something
group2:
  group22:
  - pwd
  - echo com12 2 22 ^ @com2
  - echo com12 2 23 ^ @com2
  - echo com12 2 24 ^ @com2
  echo <> aa ^ this comm has variables @comm:
  - one # will convert to echo one aa
  - two # will convert to echo two aa
  echo <> and <> ^ this comm has several variables @comm:
  - a1, b1 # will convert to echo a1 and b1
  - a2, b2 # will convert to echo a2 and b2
  • combo usage, command with several options

usage sample

  • navigation, notice the footer description and options from groups

usage sample

More Description

If you have ever copied a bunch of commands in different notes or emails or readmes; and a month later or a year later or 3 years later; you need to look for that command; this tool will help you remember and reqtrieve them quickly. With Tardigrade all commands can be copied to a file in your user home directory, so all the commands that you have ever used, are in one place, and they can be easily retrieved from that file. But not stopping there, following what other tools do. The commands can be read from your user home directory and also from the current local directory where the Tardigrade app is called from and Tardigrade will combine all the keywords and commands from both directories. This concept can help any user, to personalize with commands to remember based on a directory. It can also help teams and projects, to remember their most used commands. Tardigrade works in most terminals.

More usage examples

  • going to another directory using tardigrade

usage sample

  • filtering example

usage sample

Tutorial

After installation. Type "tg" (or "tt" if the command was added to an rc file). Tardigrade will show all the main options in a menu. In each menu, the user can go up and down. If the user presses right or presses enter then the group or command will be chosen. If a command is chosen then the command will run (or print) and tardigrade will end. If the user presses left then the menu will go back to its parent.

Explaiing the tool does not do it justice; you really have to start using it to see the enhancement it brings to coding in the terminal.

Another feature is filtering, instead of going up and down one can start typing the a part of the command and the filter will show only the commands that match.

Another feature is Tardigrade can be started in flat mode and in tag mode to search keywords only in tags and in all mode to search keywords in either the command, description or tags.

Tardicontent

Tardigrade uses a yaml file called tardicontent.yml. An example is earlier in the readme file.

The file follows a yaml hierachical structure. Any group ends in a semicolon :, any command is inside a yaml list item. The big exception is if a group that has a semicolon has the @comm tag, then it will become a command, and each of its list members will become a replacement for the command. Any comment that will be taken by tardigrade can be added after the ^ symbol, before the colon : if it is inside a group, at the end if it is a list item. In addition yaml comments can be added at the very end #, but those comments wont be taken by tardigrade. A tag starts with an at sign @, in the comment section. Any tag will be taken by tardigrade and are hierarchical so all children will inherit a tag. A group with a tag comm, will become a command as specified earlier.

Targdisettings

A tardisettings file is created at first, with a group called settings. Here are some important attributes:

settings:
    height: 11
    historysize: 10
    footerkeymaxsize: 12
settings (description):
    height: height of the command window
    historysize: how many commands can be save in the history
    footerkeymaxsize: the maximum size of each footer option
Tardihistory

Tardigrade has its own history file called targdihistory.yml. Its a tardicontent yaml file with one group called history. Any command used with tardigrade will get copied to the history as a first member of the group. The history file will take care that there are no repeated commands.

Thanks

This project relies in great libraries like kong, viper, and many others. But the main library that is relying on are the charm libraries, lipgloss, gum. Mainly gum (https://github.com/charmbracelet/gum), I copied all the filter section to customize it to tardigrade's needs.

Installation

As of now, there are only two ways to install. I will work on the installation process in the next few months so it becomes easier to more users.

installation via go

Download the repo and run:

make build 

and the executable will be inside the build directory, then copy the path of the executable to the user path.

installation via deb package

Install by using the deb package from the release section. Download the deb package: (https://github.com/sebastianxyzsss/tardigrade/releases)

to install:

sudo dpkg -i tg.<version>.deb
installation via ppa repository

to setup ppa repository:

curl -s --compressed "https://sebastianxyzsss.github.io/seb_ppa/KEY.gpg" | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/seb_ppa.gpg >/dev/null
sudo curl -s --compressed -o /etc/apt/sources.list.d/seb_list_file.list "https://sebastianxyzsss.github.io/seb_ppa/seb_list_file.list"
sudo apt update

then install using apt:

sudo apt install tg
extra script

This script is a big plus. It makes Tardigrade run the command instead of just printing the command so Tardigrade is more useful used this way. Add this script to .bashrc or zshrc:

tt() {
  echo ----------------------------------------------------
  _resultcomm=$(tg $@)
  echo $_resultcomm
  echo ----------------------------------------------------
  # print -S "$_resultcomm" # if available, saves in history
  eval ${_resultcomm}
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package filter provides a fuzzy searching text input to allow filtering a list of options to select one option.
Package filter provides a fuzzy searching text input to allow filtering a list of options to select one option.

Jump to

Keyboard shortcuts

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