Skip to content

shellkit v1.1.0

Latest

Choose a tag to compare

@github-actions github-actions released this 30 Sep 16:41
· 21 commits to main since this release

Added

  • Six built-in blocks, all in the default format. Each one shows only when it has something to say.

    • {ticket}: the ticket id in the branch name (feature/SHOP-42_cart → SHOP-42), as a link to your tracker. It needs SHKIT_TICKET_URL, with {id} standing for the id. SHKIT_TICKET_PATTERN sets how the id is found.
    • {review}: the approvals and unresolved threads of the branch's open merge / pull request, on GitLab (glab) and GitHub (gh). It is fetched in the background, like {mr}.
    • {stack}: the health of one docker compose project, set with SHKIT_STACK. It shows shop ✓, shop 2 ✗ db,web or shop off.
    • {duration}: how long the last command ran, from SHKIT_DURATION_MIN seconds (3 by default): 12s, 1m05s, 2h03m.
    • {status}: why the last command failed: ✗ 2, or ✗ INT for a signal.
    • {host}: user@host, but only over SSH or as root.
  • Notifications for long commands. When a command has run for SHKIT_NOTIFY_AFTER seconds (30 by default), a desktop notification from shellkit comes when it ends. It shows a green check or a red error icon, the time taken and the full path. It uses notify-send on Linux and osascript on macOS. Over SSH, or on Linux without a display, it rings the terminal bell instead.

    • The notification holds only the command's name, never its full line.
    • Interactive commands are skipped (SHKIT_NOTIFY_IGNORE): editors, pagers, ssh, top, database shells, fg and the like, even behind sudo -E or after &&. So are commands stopped with Ctrl+C or Ctrl+Z.
    • SHKIT_NOTIFY=false turns it off, and SHKIT_NOTIFY_TIMEOUT sets how long it stays on screen, in ms.
  • shkit doctor checks the setup, one line per item:

    • versions, the locale and the Nerd Font;
    • jq, glab / gh and their logins, and docker;
    • the permissions of ~/.config/shkit and secrets.sh, and settings still using the old names;
    • the update state, the theme and the plugins.

    It exits with 1 when something is broken.

Changed

  • The settings are now named SHKIT_* (SHKIT_FORMAT, SHKIT_COLOR_ACCENT, SHKIT_SHOW_MR…), instead of PROMPT_*.
    • The old names still work everywhere: the environment, settings.sh, theme.zsh, project files, plugin themes, and blocks that read $PROMPT_… as they render.
    • shkit set renames them in the file it edits. ~/shellkit/shell/install-local.sh renames them in all your files at once, and keeps a .bak of each. shkit doctor tells you which files still use them.
    • bash's and zsh's own PROMPT_COMMAND, PROMPT_DIRTRIM and PROMPT_EOL_MARK are left alone.
  • The default SHKIT_FORMAT is now '{host} · {dir} · {git} · {ticket} · {mr} {review} · {stack} · {docker} · {duration} · {status}'.
    • Until you set a ticket URL or a stack, the new things you may see are user@host over SSH, a long run's duration, a failure's status and a review.
    • Desktop notifications, or the bell over SSH, are on by default.
  • If you already wrote your own {ticket}, {review}, {stack}, {duration}, {status} or {host} block, in prompt.d/ or in a plugin, it still wins over the built-in one. It now also shows in the default format. Remove it to get the built-in version.

Updating

Clones update on their own at the next shell start, at most once a day. To update now, run shkit update, then exec zsh in the shells that are already open. Then run shkit doctor.

Full changelog: v1.0.0...v1.1.0