An open API service indexing awesome lists of open source software.

https://github.com/joacohbc/goto

The ultimate way to move between folders in the CLI
https://github.com/joacohbc/goto

bash cli-app golang goto shell

Last synced: 5 months ago
JSON representation

The ultimate way to move between folders in the CLI

Awesome Lists containing this project

README

          

# Goto

Goto is a "Path Manager" that lets you alias directories with shorter names (abbreviations) or index numbers for quick navigation. These aliases are saved in a JSON file (`goto-paths`).

## Installation

**Download** the latest release from [releases](https://github.com/Joacohbc/goto/releases/latest).

### Download Binary (Recommended)

You can download the binary directly using `curl` or `wget`. Choose the command for your OS and architecture:

#### Linux

##### **AMD64**

```bash
curl -L -o goto https://github.com/Joacohbc/goto/releases/latest/download/goto-linux-amd64
chmod +x goto
```

##### **ARM64**

```bash
curl -L -o goto https://github.com/Joacohbc/goto/releases/latest/download/goto-linux-arm64
chmod +x goto
```

### Run Init

Once downloaded and made executable, run init to set up aliases automatically:

```bash
./goto init
```

See [MANUAL-INSTALL.md](MANUAL-INSTALL.md) for manual setup.

## Usage

### Navigation

```bash
goto home # Go to path with abbreviation "home"
goto 0 # Go to path at index 0
goto /tmp # Like regular cd
```

*Note: Abbreviations and indices take precedence over local directory names. Use `-d` to force directory navigation.*

### Manage Paths

**Add Path**
```bash
goto add-path ./ currentDir # Add current dir as "currentDir"
goto add-path ~/Documents docs # Add specific path
```

**List Paths**
```bash
goto list
# Output: 0 - "/home/user" - h
```

**Search**
```bash
goto search -a docs # Search by abbreviation
goto search -p ~/Docs # Search by path
```

**Delete Path**
```bash
goto delete --path ~/Documents
goto delete --abbv docs
goto delete --indx 2
```

**Modify Path**
Update entries using `goto update `. Modes combine the *identifier* and the *target* to change (e.g., `path-abbv` means identify by path, update abbreviation).

Shortcuts: `pp` (path-path), `pa` (path-abbv), `pi` (path-indx), `ap` (abbv-path), `aa`, `ai`, `ip`, `ia`, `ii`.

```bash
# Update path (identify by abbreviation 'h')
goto update ap -a h -n /new/path

# Rename abbreviation (identify by path)
goto update pa -p /current/path -n newname
```

### Self-Update
`goto update-goto`

### Backup & Restore
```bash
goto backup [-o file.json]
goto restore [-i file.json]
```

### Temporary Session
Use `-t` flag for temporary paths (cleared on reboot).
```bash
goto add-path -t ./ temp
goto -t temp
```

### Extras
* `goto -q home` : Return quoted path.
* `goto -s home` : Return path with escaped spaces.
* `\cd ~/Documents` : Bypass alias to use standard `cd`.