Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m4cs/aly
Command Line Alias Manager and Plugin System - Written in Golang
https://github.com/m4cs/aly
aliases bash batch cross-platform golang shell
Last synced: 15 days ago
JSON representation
Command Line Alias Manager and Plugin System - Written in Golang
- Host: GitHub
- URL: https://github.com/m4cs/aly
- Owner: M4cs
- Created: 2020-12-17T01:08:49.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-23T19:13:42.000Z (almost 4 years ago)
- Last Synced: 2024-06-20T15:58:24.809Z (5 months ago)
- Topics: aliases, bash, batch, cross-platform, golang, shell
- Language: Go
- Homepage:
- Size: 8.75 MB
- Stars: 21
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# aly - Command Line Alias Manager and Packager
Aly offers the simplest way to manage, share, and obtain command line aliases!
Warning: This project is still in early development. Minimal testing has been done on Windows!
### Table of Contents
#### I. [Features](https://github.com/M4cs/aly#features)
#### II. [Installation](https://github.com/M4cs/aly#installation)
#### III. [Usage](https://github.com/M4cs/aly#usage)
- [Installing A Plugin](https://github.com/M4cs/aly#installing-a-plugin)
- [Enabling/Disabling Plugins](https://github.com/M4cs/aly#enablingdisabling-plugins)
- [Updating Plugins](https://github.com/M4cs/aly#update-plugins)
- [Listing Plugins](https://github.com/M4cs/aly#see-all-installed-plugins)
- [See Plugin Info](https://github.com/M4cs/aly#see-plugin-info)
- [Deleting Plugins](https://github.com/M4cs/aly#delete-a-plugin-completely)
#### IV. [Creating Plugins](https://github.com/M4cs/aly#creating-a-plugin)
#### V. [Adding an Official Plugin](https://github.com/M4cs/aly#adding-your-plugin-to-the-official-repository)## Features
- Aliases shared, loaded, and stored as JSON files for easy customization and readability
- Configure w/ the tool or manually
- Download remote Alias plugins to load a bunch all at once!
- Update plugins remotely or from local files!## Installation
First, install Go and then run:
```
go get -u github.com/M4cs/aly
go install github.com/M4cs/aly
```Next, add this to your shell's profile:
```
aly -l
source ~/.alyases
```See below for usage information!
## Usage
### Installing a Plugin
```
# From Remote URL
aly -a 'https://raw.githubusercontent.com/M4cs/aly/master/example_unix_plugin.json'# From Local File
aly -a '/path/to/plugin.json' -f# Enable the plugin
aly -e 'Plugin Name'
```### Enabling/Disabling Plugins
```
# Enable
aly -e 'Plugin Name'# Disable
aly -d 'Plugin Name'
```### Update Plugins
```
# Update A Single Plugin from their URL
aly -u 'Plugin Name'# Update A Single Plugin from Local File
aly -u '/path/to/plugin.json' -f# Update All Plugins
aly -t
```### See All Installed Plugins
```
aly -i
```### See Plugin Info
```
aly -p 'Plugin Name'
```### Delete A Plugin Completely
```
aly -r 'Plugin Name'
```## Creating a Plugin
All plugins are in the JSON format. You can create a plugin very easily using the below formatting.
```json
{
"plugin_name": "Your Plugin Name",
"author": "github/M4cs",
"description": "A small description about your plugin",
"version": "1.0.0",
"aliasmap": [
{
"alias": "ec",
"description": "Example Alias",
"command": "echo",
"platform": "*",
"subalias": {
"t": "'testing'",
"hw": "'hello, world!'",
"a": "$1"
}
}
]
}
```### Top-Level
- **plugin_name** - The name of your plugin. This is what it will be referred to for updating, enabling, disabling, etc. Keep it short and unique!
- **author** - Your name. I recommend using your github/USERNAME
- **description** - A small description about your plugin
- **version** - Version number for plugin. This should be semantic syntax.
- **aliasmap** - Your map of aliase groups for the plugin.
- **platform** - Refers to the platform that the alias will work on. Supports: `windows`, `unix`, `*`, or any [GOOS](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63) platforms.#### aliasmap
An alias group includes a base alias, base command, and subaliases. If there are subaliases, they will be concatenated with the base alias.
- **alias** - The base alias for your command. This will run whatever is in `command`.
- **command** - The base command for your alias. This will run whenever the `alias` is run.
- **description** - Description of your alias group.
- **subaliases** - subalias:args dictionary. This will add the `subalias` to the `alias` specified and add the `args` string to your base `command` string.Using the JSON example above:
- `ec` will run `echo`
- `ect` will run `echo 'testing'`
- `echw` will run `echo 'hello, world!'`
- `eca` will run `echo $1` using whatever argument you send to it (or Windows equivalent)## Adding Your Plugin To The Official Repository
You should add a folder with your username into `./official_plugins/`. For example, I'd add `./official_plugins/M4cs/`. Inside of this folder, you will add your different plugins using `.json` files. You should include a `README.md` with some information about what your plugin(s) offer!
1. Make a Pull Request using the `Add a Plugin` Template [Here]()
2. Fill Out Pull Request Template w/ Your Fork
3. Submit Pull Request and Await Review!