The ultimate way to move between folders in the CLI

goto-command

The ultimate way to move between folders in the command line

Goto is a command that can be used like cd, and also allows you to add specific path to move faster, this path can be used like abbreviation or a index number

It works by means of a compiled Go file (goto.bin) that returns the corresponding path based on the arguments passed as input. And passes it as an argument to an alias that uses cd on the command line to move to the specified path

How to install?

Use the automatically way:

Note: The install.sh is only for linux 64 bits and 32 bits

  1. Clone repository:
    git clone https://github.com/Joacohbc/goto.git
    cd ./goto
  2. And use the install scripts:
    sh ./install.sh

Or do it yourself:

  1. Clone this the repository and go there:
    git clone https://github.com/Joacohbc/goto.git
    cd ./goto
  2. Compile the code:
    go build -o goto.bin ./main.go ./config.go 
  3. Create the config dir:
    mkdir $HOME/.config/goto/
  4. Move the files to the config dir and go there:
    cp -r ./* $HOME/.config/goto/
    cd $HOME/.config/goto/
  5. Add the next file to your shell file(ex: .bashrc or .zshrc):
    source $HOME/.config/goto/alias.sh >> {YOUR_SHELL_FILE} 
  6. Give execution permissions to bin files:
    chmod +x $HOME/.config/goto/bin/*
  7. To finish the instalation you need to change the GOTO_FILE VARIABLE in alias.sh
    Note: This if the GOTO_FILE is incorrect or the goto command doesn't work!
    #Use your fav text editor: nano, vi, vim, nvim, etc
    vim $HOME/.config/goto/alias.sh
    In the editor:
    ##ADD THIS FILE TO .bashrc OR .zshrc WITH "SOURCE <ABSOLUTE-PATH-OF-THIS-FILE>"   
    # GOTO_FILE="<ABSOLUTE-PATH-OF-THIS-FILE>"
    GOTO_FILE="$XDG_CONFIG_HOME/goto/goto.bin" #<-- Here put the absolute path of the goto.bin ($HOME/.config/goto/goto.bin)

How to configure it?

The configuration file is created automatically. To add or remove fav directories of your config file, you only need add/remove the block between "{}" in the .json

{
  "Path": "{THE-PATH}", 
  "Short": "{THE-ABBREVIATION}", 
} 

And you need to add a "," after the "}" if it not the last of the list

Note: You can do this with goto --add

Usage:

Help and version information

In the alias.sh there are more options besides the goto to move:

#Only return the path for the directory with quotes
goto -q /home/joaco

Output: "/home/joaco"

Also have goto -help to print help message and goto -v to print version

Move

To use the main function of goto:

#Move to the destination directory
#home is the abreviation of /home/joaco/ in the config.json
goto home

Output: Go to: /home/joaco

#"0" is the number index of the /home/joaco/ in the config.json
goto 0

Output: Go to: /home/joaco

Or also you can use goto like cd, use a complete/relative path:

goto /home/joaco/.config/goto

Output: Go to: /home/joaco/.config/goto

Add new path

To add a new path to the config file:

#The new path will be ~/Wallpaper/ and "w" is the abreviation 
goto --add="~/Wallpaper/,w" 

Output: The changes were applied successfully

#And try the new path 
goto w

Output: Go to: /home/joaco/Wallpaper/

List paths

To list the path of the config file:

goto -l 

Output: 
0- Path: "/home/joaco", Short: "home"
1- Path: "/home/joaco/.config/goto/", Short: "conf"
2- Path: "/home/joaco/Wallpaper", Short: "w"
...

Delete paths

To delete a path to the config file:

#I want to delete the path /home/joaco/Wallpaper
goto --del="/home/joaco/Wallpaper"  

Output: The changes were applied successfully
Similar Resources

Plugs module to see different types of plug types needed in different countries, and a comparison tool between two countries plug socket types.

plugs Importing the module: go get github.com/matthewboyd/plugs "github.com/matthewboyd/plugs" How to use the module: There are two functions wi

Dec 28, 2021

RuuviBridge - Utility to bridge RuuviTag data between various sources and consumers

RuuviBridge RuuviBridge is designed to act as a "data bridge" between various so

Nov 19, 2022

Go rate limiter used to ensure a minimum duration between executions.

Ratelimiter Rate limiter used to ensure a minimum duration between executions. Additionally supports the optional limit of max queue size. This can be

Jul 14, 2022

Simple load-balancer for npchat servers, based on the xor distance metric between node & user id

npchat-helmsman Simple load-balancer for npchat servers, based on the xor distance metric between node & user id. Local Development Clone this reposit

Jan 15, 2022

Battlesnake-logging-proxy - A little proxy between the internet and your battlesnake

battlesnake-logging-proxy a little proxy between the internet and your battlesna

Feb 11, 2022

Kiwi-balancer - A balancer is a gateway between the clients and the server

Task description Imagine a standard client-server relationship, only in our case

Feb 11, 2022

Apex-api-bridge - Bridge between apexlegendsapi and ApeStats

apex-api-sync This app updates a mongo instance with the players most recent dat

Feb 17, 2022

Package event-driven makes it easy for you to drive events between services

Package event-driven makes it easy for you to drive events between services

Event-Driven Event-driven architecture is a software architecture and model for application design. With an event-driven system, the capture, communic

Apr 20, 2022

go websocket, a better way to buid your IM server

go websocket, a better way to buid your IM server

Your star is my power!! 🚀 ⭐ ⭐ ⭐ ⭐ ⭐ Discribe lhttp is a http like protocol using websocket to provide long live, build your IM service quickly scalab

Dec 30, 2022
Related tags
Transfer files between machines in the same network

GoTrans Transfer files from computer A to computer B. The program have a sender and a receiver, if you choose a sender you'll need to provide the ip a

Nov 7, 2021
Make TCP connection storm between server and client for benchmarking network stuff

Make TCP connection storm between server and client for benchmarking network stuff

Nov 14, 2021
Bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API
Bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)

Jan 4, 2023
Powered by Matterbridge, MatterAMXX is a plugin for AMXX that allows simple bridging between your game servers, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, and more.
Powered by Matterbridge, MatterAMXX is a plugin for AMXX that allows simple bridging between your game servers, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, and more.

Powered by Matterbridge, MatterAMXX is a plugin for AMXX that allows simple bridging between your game servers, Mattermost, IRC, XMPP, Gitter, Slack, Discord, Telegram, and more.

Dec 27, 2022
Code to be shared between EduVPN clients

EduVPN shared library This repository contains a Go library with functions that all EduVPN clients can use. The goal is to let EduVPN clients link aga

Mar 15, 2022
A document scanner that creates a graph of the analogy between documents.

Social Analogizer The idea is that this program scans documents for keyword that correspond to other documents. Starting point is that a user has a pr

Dec 20, 2021
Simple Relay between a Unix socket and a TCP socket, and vice versa.
Simple Relay between a Unix socket and a TCP socket, and vice versa.

Simple TCP <-> Unix Relay simpletcpunixrelay is a program which exposes a TCP endpoint as a Unix socket and vice versa. Usecase Let's say you are runn

Nov 23, 2022
A REST API for the DN42 registry, written in Go, to provide a bridge between interactive applications and the registry.

dn42regsrv A REST API for the DN42 registry, written in Go, to provide a bridge between interactive applications and registry data. A public instance

Apr 21, 2022
Socketlogger allows multiple processes to log to a shared log file between processes.
Socketlogger allows multiple processes to log to a shared log file between processes.

socketlogger socketlogger is a language agnostic logging utility designed to allow mulitple applications, running on one or multiple computers, to wri

Dec 7, 2021
An anonymous, encrypted Point-to-Point (Layer 3) tunnel between two peers.

NKN-Link An anonymous, encrypted Point-to-Point (Layer 3) tunnel between two peers. NKN-Link Table of Contents Preface Description Install Setup Run P

Dec 20, 2022