Project

lita-alias

0.01
Repository is archived
No commit activity in last 3 years
No release in over 3 years
A Lita Chatbot plugin to alias commands.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 4.3
 Project Readme

lita-alias

Build Status Coverage Status

If you utilize some plugins that have long complicated commands because they accept arguments and you would like to alias into shorter commands, this plugin can help you.

For example, if you have a command to run a process on a heroku app to check stats that you like to run periodically:

/hk run my-company-production ./bin/check_stats

That's a bit verbose, so you could alias as stats_prod by doing the following:

/alias add stats_prod hk run my-company-production ./bin/check_stats

Then you simply have to type:

/stats_prod

See Usage for more details.

Installation

Add lita-alias to your Lita instance's Gemfile:

gem "lita-alias"

Requirements

The plugin requires access to redis for storing aliases

Configuration

none yet

Usage

add

/alias add ALIAS COMMAND

Adds an alias so when you type the command /ALIAS the COMMAND is sent instead as if you had typed it yourself. Do not put the robot alias character ('/' for example) in the COMMAND argument. When the ALIAS is triggered, the chatbot will receive the COMMAND as a chat message with your robot's alias character prepended.

Example: /alias add stats_prod hk run my-company-production ./bin/refresh_cache

delete

/alias delete ALIAS

Deletes the ALIAS.

Example: /alias delete stats_prod

list

/alias list

Shows all the aliases that have been saved.

Notes

Some COMMANDS maybe triggered when you alias them if the handler's route is very loose with where it may appear in a chat message.