Skip to main content

Simple (Python) tool to shorten any command in your terminal.

Project description


# Shorten

Simple (Python) tool to shorten any command in your terminal.

`shorten` takes the place of adding aliases in your bash profile. It also makes a few things a more convenient. For example, you can
1. create an alias from any location,
2. list your aliases and
3. search aliases by leading characters.


Let me know if you experience any issues!

## Things you can do

**Create an alias.** Call `shorten` (from anywhere!) on any command and give it an alias.

```
$ shorten echo e
Alias successfully added.
```
```
$ # Let's try it out!
$ echo 'Hello, world!'
Hello, world!
```

**Remove an alias.** Call `shorten delete`.
```
$ shorten delete e
```

**List all your aliases.**
```
$ shorten list all

Alias Command
----- -------
ipynb jupyter notebook
jlab jupyter lab
e echo
```

**List aliases that start with substring.**
```
$ shorten list ip

Alias Command
----- -------
ipynb jupyter notebook
```

**Protip**: shorten `shorten` ;).
```
$ shorten shorten s
```

## How does it work?

*Shorten* creates a hidden folder in your home directory. This is where your aliases will be stored. Each alias is actually a python script that redirects the alias to the true command.

*Shorten* adds a line to your bash profile that points your $PATH variable to `~/.shorten`. If you can't get your aliases to work (or you're using another shell like Zsh), check that the following line is in the right `rc` file.

```
export PATH="~/.shorten:$PATH"
```


## Install

Clone this repo and pip install:
```
pip install -e .
```


Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shorten-cli-0.1.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

shorten_cli-0.1-py2.py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page