Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task groups #11

Merged
merged 8 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ The idea behind `ttr` is the same as behind Vim [WhichKey](https://github.com/fo

The main difference is ttr doesn't depend on any editor and works right in the shell.

![](img/example.png)
![](img/movie.gif)

## Features

* supports project-local as well as global tasks
* task groups to keep memorable mnemonics for tasks (`ct` for `cargo test` etc.)
* confirmation after exit for non interactive applications
* loop-mode allows quickly select next task after previous completed
* ability to clear terminal before task run
* simple yaml configuration

## Installation
Expand Down Expand Up @@ -39,7 +42,7 @@ $ cargo install --git=https://github.com/bazhenov/ttr.git

`ttr` looks for a `.ttr.yaml` file in following directories:

* current working directory;
* current working directory and parent directories till the home dir (like a git);
* home directory;
* config directory (`$XDG_CONFIG_HOME` or `.config/ttr` on Linux and `~/Library/Application Support/ttr` on macOS).

Expand All @@ -48,15 +51,27 @@ Tasks from all files are merged together. Prirority is given to task defined ear
Configuration example:

```yaml
- name: lazygit
groups:
- name: git
key: g
cmd: lazygit

- name: test
key: t
cmd: cargo test
confirm: true # displays confirmation after command exited
clear: true # clears terminal before running command
tasks:
- name: lazygit
key: g
cmd: lazygit
- name: git diff
key: d
cmd: git diff
- name: cargo
key: c
tasks:
- name: test
key: t
cmd: cargo test
confirm: true # displays confirmation after command exited
clear: true # clears terminal before running command
- name: run
key: r
cmd: cargo run
```

## Integration with terminals
Expand Down Expand Up @@ -105,4 +120,4 @@ this will bind `ttr` to <kbd>Ctrl</kbd>+<kbd>Space</kbd>.

### iTerm2

In iTerm you can [assign shortcuts](https://stackoverflow.com/questions/67222677/keyboard-shortcut-to-execute-a-shell-command-in-iterm2) to execute `ttr`.
In iTerm you can [assign shortcuts](https://stackoverflow.com/questions/67222677/keyboard-shortcut-to-execute-a-shell-command-in-iterm2) to execute `ttr`.
Binary file removed img/example.png
Binary file not shown.
Binary file added img/movie.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading