https://github.com/avdv/replay
REPL for command line apps.
https://github.com/avdv/replay
bazel cli repl tui
Last synced: 4 months ago
JSON representation
REPL for command line apps.
- Host: GitHub
- URL: https://github.com/avdv/replay
- Owner: avdv
- License: bsd-3-clause
- Created: 2021-03-30T19:40:39.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2026-03-01T03:20:34.000Z (4 months ago)
- Last Synced: 2026-03-01T06:47:36.412Z (4 months ago)
- Topics: bazel, cli, repl, tui
- Language: Starlark
- Homepage:
- Size: 564 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README

— *A REPL to play with.*
Wrap any command into a TUI, displaying its output in a scrollable area. Change
parts of the command, hit enter to re-run the command again. Repeat.
---

# Building
You can build this project using [Bazel](https://bazel.build/) on [NixOS](https://nixos.org/):
```console
$ bazel build replay
```
# Usage
## Synopsis
```console
$replay - interactive command line tool
Usage: replay [-v|--version] [-n|--var-name NAME] [-w|--watch FILE]
[-i|--from-stdin] COMMAND ARGS
Repeatedly run a command and display its output.
Available options:
-v,--version output version information and exit
-n,--var-name NAME name of the variable to replace (default: "input")
-w,--watch FILE watch FILE and re-run command automatically if it
changes
-i,--from-stdin read input from stdin, pipe into program continually
-h,--help Show this help text
```
## Configuration
`replay` reads a config file in `ini` format from `~/.config/replay/config.ini` when it exists. This can be used to define defaults for specific commands.
Its format is like this:
```ini
; a section is matched from the command given on the command line
[cmd]
;; arguments that will be prepended to the arguments given on the command line
args = --default --arguments --query={input}
;; command to run instead of the command given on the command line
command = foocmd
;; the prompt to show before the text input
prompt = $
;; the default input of the command
input = help
```
## Example
```console
$ replay jq --color-output input -r wikipedia.json
```

This command executes the [jq](https://stedolan.github.io/jq/) tool and displays the output in a text area. Editing the expression in the input field and hitting Enter re-runs the command and displays the new output.

Pressing Esc exits the program, and prints the last output to stdout.