https://github.com/imnotzrus/abbr
A tool helps you abbreviate your command and its arguments, inspired by zoxide
https://github.com/imnotzrus/abbr
cli shell tool utility
Last synced: over 1 year ago
JSON representation
A tool helps you abbreviate your command and its arguments, inspired by zoxide
- Host: GitHub
- URL: https://github.com/imnotzrus/abbr
- Owner: imnotzrus
- Created: 2025-02-22T15:13:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-22T15:18:34.000Z (over 1 year ago)
- Last Synced: 2025-02-22T16:24:58.122Z (over 1 year ago)
- Topics: cli, shell, tool, utility
- Language: Rust
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Abbreviator
A tool helps you abbreviate your command and its arguments, inspired by **zoxide**
It remembers which command you want to abbreviate,
just like *alias* does but with its arguments in short also,
in your own way.
[Getting started](#getting-started) •
[Installation](#installation) •
[Configuration](#configuration)
## Getting started
```shell
ab ca a/3 serde tokio clap # equivalents to `cargo add serde tokio clap`
ab dk cmp ud # equivalents to `docker compose up -d`
ab dk i l # equivalents to `docker image ls`
ab e "hello world" # equivalents to `echo "hello world"`
ab gis # equivalents to `git status`
```
## Installation
1. **Install binary**
abbr runs on most major platforms. If your platform is not listed below,
please [open an issue][issues].
Linux / WSL
> The recommended way to install abbr is via the installation script:
>
> ```shell
> curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
> ```
MacOS
> Run this command in your terminal:
> ```sh
> curl -sSfL https://raw.githubusercontent.com/imnotzrus/abbr/main/install.sh | sh
> ```
Windows
> If you're using Cygwin, Git Bash, or MSYS2, you can also use the install script:
>
> ```sh
> curl -sSfL https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | sh
> ```
Android
> Run this command in your terminal:
> ```sh
> curl -sS https://raw.githubusercontent.com/ajeetdsouza/zoxide/main/install.sh | bash
> ```
2. **Setup abbr on your shell**
To start using abbr, add it to your shell.
Bash
> Add this to the **end** of your config file (usually `~/.bashrc`):
>
> ```sh
> eval "$(zoxide init bash)"
> ```
Zsh
> Add this to the **end** of your config file (usually `~/.zshrc`):
>
> ```sh
> eval "$(zoxide init zsh)"
> ```
## Configuration
### Flags
When calling `abbr init`, the following flag is available: `--alias`
- Change prefix of `abbr` command.
- `--alias aa` will change the command to `aa`.
### Environment variables
Environment variable `_ABBR_DATA_DIR` can be used for configuration. They must be set before
`abbr init` is called.
- Specifies the directory in which the database is stored.
- The default value varies across OSes:
| OS | Path | Example |
|-------------|------------------------------------------|--------------------------------------------|
| Linux / BSD | `$XDG_DATA_HOME` or `$HOME/.local/share` | `/home/alice/.local/share` |
| macOS | `$HOME/Library/Application Support` | `/Users/Alice/Library/Application Support` |
| Windows | `%LOCALAPPDATA%` | `C:\Users\Alice\AppData\Local` |
[issues]: https://github.com/imnotzrus/abbr/issues/new