Skip to content

Releases: fmatsos/shellkit

shellkit v1.1.0

Choose a tag to compare

@github-actions github-actions released this 30 Sep 16:41

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

shellkit v1.0.0

Choose a tag to compare

@github-actions github-actions released this 30 Sep 15:35

The first release of shellkit: a plain zsh / bash setup for Linux and macOS, with an async, themeable prompt that keeps every fact on one line and never makes you wait for the network.

Highlights

  • Async prompt. Local facts are shown right away. git fetch, the merge / pull request and its CI (GitLab via glab, GitHub via gh) and unhealthy containers are fetched in the background, and the prompt redraws in place when they arrive.
  • Git at a glance. Branch, worktree, ahead / behind, changed files with a +added −removed line count, and a rebase / merge / cherry-pick / revert / bisect in progress with its conflicts.
  • One info line. The right part ({agents} · {quota} by default) ends the info line at the terminal's width, and the input line holds only the $.
  • Themes and blocks. The layout is a format string ('{dir} · {git} · {mr}'), colors are roles and icons are variables. A block is a small zsh function, and slow data goes through a background cache.
  • Per-project settings. Another format or palette for one repository and everything below it.
  • Plugins. Blocks and themes shared as git repositories. Each is checked against a JSON schema, and nothing is fetched or run until you confirm. shkit plugin new scaffolds one.
  • shkit. One command to change settings, create project files, manage plugins and update shellkit. Every change applies at once.
  • Self-updating. At shell startup, at most once a day, a clone fast-forwards to the latest release. Only versions that passed CI are installed, and local changes are never touched. Turn it off with SHKIT_AUTO_UPDATE=false.
  • Shell comforts. Jump to a visited directory by its name, Esc Esc to toggle sudo, an unlimited shared history with prefix search, and colored man.
  • Bash fallback. The same options and aliases, with a deliberately minimal prompt.
  • Secrets stay out. Machine settings, secrets, local aliases and themes live in ~/.config/shkit/, never in the repository.

Requirements

  • Linux or macOS, zsh 5.8+ and git 2.31+.
  • jq for {mr} on GitLab and for plugins.
  • Optionally glab / gh and docker, and bash 5.1+ for the fallback.
  • A Nerd Font (or Symbols Nerd Font as a fallback font) for the icons.

Install

git clone https://github.com/fmatsos/shellkit.git ~/shellkit
~/shellkit/zsh/install.sh
exec zsh

See the documentation.