Home

Awesome

sig

ci

Interactive grep

sig.gifsig_archived.gif

Features

Installation

Homebrew

brew install ynqa/tap/sigrs

Cargo

cargo install sigrs

Arch Linux

pacman -S sig

Nix (flakes)

Add it as an input to your flake:

inputs = {
  sig.url = 'github:ynqa/sig/<optional-ref>'
}

Create a shell with it:

nix shell github:ynqa/sig

Or run it directly:

cat README.md | nix run github:ynqa/sig -- --archived

Nix (classic)

Fetch the source and use it, e.g. in your shell:

let
  # At the time of writing this, pkgs need to be unstable for the package to build properly
  # (requires Rust 1.74, stable has 1.73)
  pkgs = import <nixpkgs-unstable> {};

  sig = pkgs.callPackage (pkgs.fetchFromGitHub {
    owner = "ynqa";
    repo = "sig";
    rev = "<revision, e.g. master/v0.1.0/etc.>";
    hash = ""; # Build first, put proper hash in place
  }) {};
in
  pkgs.mkShell {
    packages = [sig];
  }

Examples

stern --context kind-kind etcd |& sig
# or
sig --cmd "stern --context kind-kind etcd" # this is able to retry command by ctrl+r.

Archived mode

cat README.md |& sig -a
# or
sig -a --cmd "cat README.md"

Keymap

KeyAction
<kbd>Ctrl + C</kbd>Exit sig
<kbd>Ctrl + R</kbd>Retry command if --cmd is specified
<kbd>Ctrl + F</kbd>Enter Archived mode
<kbd></kbd>Move the cursor one character to the left
<kbd></kbd>Move the cursor one character to the right
<kbd>Ctrl + A</kbd>Move the cursor to the start of the filter
<kbd>Ctrl + E</kbd>Move the cursor to the end of the filter
<kbd>Backspace</kbd>Delete a character of filter at the cursor position
<kbd>Ctrl + U</kbd>Delete all characters of filter

(Archived mode)

KeyAction
<kbd>Ctrl + C</kbd>Exit Archived mode
<kbd></kbd>Move the cursor one character to the left
<kbd></kbd>Move the cursor one character to the right
<kbd>Ctrl + A</kbd>Move the cursor to the start of the filter
<kbd>Ctrl + E</kbd>Move the cursor to the end of the filter
<kbd>Backspace</kbd>Delete a character of filter at the cursor position
<kbd>Ctrl + U</kbd>Delete all characters of filter

Usage

Interactive grep (for streaming)

Usage: sig [OPTIONS]

Examples:

$ stern --context kind-kind etcd |& sig
Or the method to retry command by pressing ctrl+r:
$ sig --cmd "stern --context kind-kind etcd"

Archived mode:
$ cat README.md |& sig -a
Or
$ sig -a --cmd "cat README.md"

Options:
      --retrieval-timeout <RETRIEVAL_TIMEOUT_MILLIS>
          Timeout to read a next line from the stream in milliseconds. [default: 10]
      --render-interval <RENDER_INTERVAL_MILLIS>
          Interval to render a line in milliseconds. [default: 10]
  -q, --queue-capacity <QUEUE_CAPACITY>
          Queue capacity to store lines. [default: 1000]
  -a, --archived
          Archived mode to grep through static data.
  -i, --ignore-case
          Case insensitive search.
      --cmd <CMD>
          Command to execute on initial and retries.
  -h, --help
          Print help (see more with '--help')
  -V, --version
          Print version