rex-extensions

Extensions for Rex, the terminal multiplexer. One install.js each.

Install from GitHub

Docs

Install an extension, press its key, and configure or remove it later. Each extension's README covers every feature in full.

Requirements

Install

Rex has no plugin manager. An extension is enabled when the init.lua Rex reads loads its Lua file and binds a key to its action. Each extension's install.js makes that edit for you.

1. Clone the repo once

git clone https://github.com/luongnv89/rex-extensions ~/.config/rex/rex-extensions

Any folder works. init.lua loads the extensions from where you cloned them, so keep the clone there.

2. Install the extensions you want

node ~/.config/rex/rex-extensions/github/install.js
node ~/.config/rex/rex-extensions/mcc/install.js
node ~/.config/rex/rex-extensions/tabs/install.js
node ~/.config/rex/rex-extensions/sshtab/install.js

Each one:

  1. adds three lines to init.lua: a comment, a dofile that loads the extension, and a rex.bind for its key;
  2. checks the result with rex config check, and puts the old file back if the check fails;
  3. saves the old file as init.lua.bak-rex-<extension>;
  4. runs rex config reload, so the key works at once, with no restart.

The file it edits is REX_CONFIG when that's set, else $XDG_CONFIG_HOME/rex/init.lua, else ~/.config/rex/init.lua. It's created if it doesn't exist. Running install.js again when the extension is already there changes nothing.

3. Use it

Press the extension's key in any Rex pane:

ExtensionKeyActionIn the command palette
githubcmd+shift+ggithub_panelPR and Issue Panel
mcccmd+shift+umcc_usagemcc Usage Panel
tabscmd+shift+ltab_locationsTab Locations (turns it off or on; it runs on its own)
sshtabcmd+alt+tsame_host_tabsSame-Machine Tabs (turns it off or on; it runs on its own). restore_agent_sessions, Restore Agent Sessions, turns agent session restore alone off or on.

Without the key, pick the extension in Rex's command palette, or run its action from a shell with rex do ACTION, such as rex do mcc_usage. To check that an extension is enabled:

rex config check                  # init.lua loads without errors
rex keymap | grep mcc_usage       # the key is bound to the action

First run

The shortest way to a working panel: clone, install the github panel, then press its key in a Rex pane inside a GitHub or GitLab repo.

git clone https://github.com/luongnv89/rex-extensions ~/.config/rex/rex-extensions
node ~/.config/rex/rex-extensions/github/install.js

install.js says which key it bound and where, such as PR and issue panel on cmd+shift+g: added to /Users/you/.config/rex/init.lua (backup: init.lua.bak-rex-github). Press that key: the panel of open pull requests and issues opens on the right of the tab.

Pick another key

When the default key is already bound in your init.lua, install.js takes the first free key from its own list and says which one it picked. To choose a key yourself, pass it:

node ~/.config/rex/rex-extensions/mcc/install.js ctrl+alt+u

It refuses a key your init.lua already binds. It can't see the shortcuts built into the Rex app, so if the key does something else there, remove the extension and install it again with another key.

Update, disable or remove

Troubleshooting

Configuration

VariableUsed byWhat it does
REX_CONFIGevery install.jsThe init.lua to edit. Else $XDG_CONFIG_HOME/rex/init.lua, else ~/.config/rex/init.lua.
XDG_STATE_HOMEgithub and mcc panelsWhere the panel keeps its state files. Default ~/.local/state.
MCC_BINmcc and github panelsThe full path to mcc, when it isn't on PATH or in the usual install folders.
REX_GITHUB_STARTUP_MSgithub panelHow long Resolve/Review waits for the agent to start, in ms. Default 3000.

Every feature, per extension