Skip to content
Back to search

razorback16

MarketplaceWorks with Claude CodeGitHub

Claude's answers, rendered: Markdown, math, charts and diagrams drawn in the Claude Code terminal. Independent project, not affiliated with Anthropic.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/razorback16--cc-intelligent-ui/badge.svg)](/listings/razorback16--cc-intelligent-ui)

HTML

<a href="/listings/razorback16--cc-intelligent-ui"><img src="/api/listings/razorback16--cc-intelligent-ui/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

These steps run a script from the network that findsafeskills does not scan.

On macOS or Linux:

curl -fsSL https://intelligentui.art/install.sh | bash

It installs Typst if needed, installs the mod and turns on auto-update. Then restart Claude Code. Run it again to update. [What the script does](docs/install.md#the-install-script).

**By hand:** install [Typst](https://typst.app) 0.15 (`brew install typst`), then in Claude Code type `/plugin install cc-intelligent-ui --marketplace razorback16/cc-intelligent-ui`, and turn on auto-update in `/plugin`. [Install guide](docs/install.md).

Needs Claude Code 2.1.298 or later. Works best in fullscreen mode (`/tui fullscreen`).

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 8 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "razorback16",
  3. "owner": { "name": "razorback16" },
  4. "metadata": {
  5. "description": "Intelligent UI: Claude's answers drawn as rendered Markdown in your terminal"
  6. },
  7. "plugins": [{ "name": "cc-intelligent-ui", "source": "./" }]
  8. }
README.md · README · 104 lines · 1 finding marked

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <picture>
  2. <source media="(prefers-color-scheme: dark)" srcset="outcomes/out/hero-dark.gif">
  3. <source media="(prefers-color-scheme: light)" srcset="outcomes/out/hero-light.gif">
  4. <img alt="Claude Code: a prompt asks Claude to show what Markdown it can draw, and the answer draws as one rendered picture: a cover image, a heading, a table, LaTeX math, a code block with syntax colours, a task list and a note" src="outcomes/out/hero-light.gif" width="100%">
  5. </picture>
  6. # Intelligent UI for Claude Code
  7. **Claude's answers, rendered.** Real Markdown, math, charts and diagrams, right in your terminal.
  8. <sub>An independent, community-made mod for Claude Code. Not affiliated with Anthropic.</sub>
  9. Intelligent UI draws each answer from Claude as a typeset picture, with [Typst](https://typst.app). Tables line up, equations look like a paper, and Claude can draw a chart or a diagram when a picture explains more than words. Only the drawing changes. The saved answer stays Markdown.
  10. ## Install
  11. On macOS or Linux:
  12. ```
  13. curl -fsSL https://intelligentui.art/install.sh | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 20 on GitHub
  14. ```
  15. It installs Typst if needed, installs the mod and turns on auto-update. Then restart Claude Code. Run it again to update. [What the script does](docs/install.md#the-install-script).
  16. **By hand:** install [Typst](https://typst.app) 0.15 (`brew install typst`), then in Claude Code type `/plugin install cc-intelligent-ui --marketplace razorback16/cc-intelligent-ui`, and turn on auto-update in `/plugin`. [Install guide](docs/install.md).
  17. Needs Claude Code 2.1.298 or later. Works best in fullscreen mode (`/tui fullscreen`).
  18. ## Terminals
  19. | Terminal | Pictures |
  20. |---|---|
  21. | kitty 0.28+, Ghostty, cmux | Yes |
  22. | iTerm2 3.6+, herdr | Yes, after `/iui setup` (the install script does it) |
  23. | Rio 0.5.27+ | Yes, with `CLAUDE_CODE_FORCE_TERMINAL_IMAGES=1` (not tested) |
  24. | ssh | Yes, from kitty or Ghostty |
  25. | Warp, WezTerm | Not yet (waiting on [warp#16312](https://github.com/warpdotdev/warp/pull/16312), [wezterm#7924](https://github.com/wezterm/wezterm/pull/7924)) |
  26. | tmux, screen, Terminal.app, Alacritty, VS Code, others | No: you see normal text |
  27. `/iui details` tells you why pictures do or do not show. [All terminal details](docs/install.md#terminals).
  28. ![Claude explains why an API request is slow: a timing chart shows the DB query takes 310 of 450 ms, with Amdahl's law and a table of fixes, in a dark and a light terminal](outcomes/out/0-hero-2-latency.png)
  29. ## Features
  30. - **Rendered Markdown:** headings, tables, task lists, quotes and highlighted code, in your terminal's font.
  31. - **LaTeX math:** inline and display, typeset.
  32. - **Diagrams, charts and plots:** Claude draws them live with Typst, in your theme's colours, offline.
  33. - **Images and files:** images in answers, images and Markdown files that Claude sends, images that Claude reads (in the expanded row), and a preview of images you paste, above the prompt box.
  34. - **Copy answers as usual:** in fullscreen, drag over an answer to select and copy its text, as you do with normal text. Click a link or a file to open it (alt+click copies it); click a command to copy it. [How copy works](docs/usage.md#copy-text-from-a-picture).
  35. - **Readable plans:** plan mode shows the plan rendered, with approve, edit and reject.
  36. - **Light and dark themes:** Claude Code's colours or VS Code's, or your own.
  37. ## See it
  38. <table>
  39. <tr>
  40. <td width="50%">
  41. <picture>
  42. <source media="(prefers-color-scheme: dark)" srcset="outcomes/out/6-diagrams-dark.png">
  43. <source media="(prefers-color-scheme: light)" srcset="outcomes/out/6-diagrams-light.png">
  44. <img alt="A flow chart of an agent loop and a commutative diagram of the First Isomorphism Theorem, drawn with fletcher in a Claude answer" src="outcomes/out/6-diagrams-light.png" width="100%">
  45. </picture>
  46. </td>
  47. <td width="50%">
  48. <picture>
  49. <source media="(prefers-color-scheme: dark)" srcset="outcomes/out/2-math-dark.png">
  50. <source media="(prefers-color-scheme: light)" srcset="outcomes/out/2-math-light.png">
  51. <img alt="Typeset LaTeX math in Claude Code: the Gaussian integral, Maxwell's equations, a rotation matrix, a piecewise function, the Fourier transform and the Schrödinger equation" src="outcomes/out/2-math-light.png" width="100%">
  52. </picture>
  53. </td>
  54. </tr>
  55. </table>
  56. More in the [gallery](docs/gallery.md): plots, fractals and a tour of all the Markdown.
  57. ## Commands
  58. | Command | What it does |
  59. |---|---|
  60. | `/iui` | State, and what keeps pictures away |
  61. | `/iui on` / `off` | Pictures on or off |
  62. | `/iui theme <name>` | `claude-code`, `vscode-modern`, `vscode` or your own |
  63. | `/iui size <80–200>` | Text size, in percent |
  64. | `/iui setup` | Turns pictures on in iTerm2 and herdr |
  65. | `/iui grab` | Copies the text of your last selection of pictures |
  66. All commands are in [Usage](docs/usage.md).
  67. ## Privacy
  68. Nothing about you or your sessions leaves your computer. The mod makes one request a day at most, for its own public version number (`/iui updates off` stops it). It reads the clipboard only to help a copy or to find a pasted image path, skips password manager copies, and writes it only when you copy. Typst code in an answer cannot read your files. [Full details](docs/privacy.md).
  69. ## Docs
  70. [Install](docs/install.md) · [Usage](docs/usage.md) · [Themes](docs/themes.md) · [How it works](docs/how-it-works.md) · [Limitations](docs/limitations.md) · [Privacy](docs/privacy.md) · [Development](docs/development.md) · [Gallery](docs/gallery.md) · [Changelog](CHANGELOG.md)
  71. ## Disclaimer
  72. Intelligent UI is an independent project. It is not made, supported or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic, PBC.
  73. ## Licence
  74. MIT, see [`LICENSE`](LICENSE). The vendored Typst packages and the VS Code theme values keep their own licences: see [`THIRD-PARTY-NOTICES.md`](THIRD-PARTY-NOTICES.md).
site/install.sh · Bundled script · 1,193 lines · 2 findings marked
  1. #!/usr/bin/env bash
  2. # Intelligent UI for Claude Code: the one-line installer.
  3. #
  4. # curl -fsSL https://intelligentui.art/install.sh | bash
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 4 on GitHub
  5. #
  6. # What it does (refer to docs/install.md):
  7. # 1. Checks the system (macOS or Linux, arm64 or x86_64) and that Claude Code is installed.
  8. # 2. Typst: when no Typst 0.15 or later is found, downloads the official Typst 0.15.1
  9. # release from GitHub, checks its SHA-256 (in this file) and puts it in ~/.local/bin.
  10. # 3. Adds the razorback16 marketplace and installs the mod, with the `claude plugin`
  11. # commands (or updates both when they are there). A razorback16 marketplace from
  12. # another source (a fork, a pinned ref, a local folder) is removed and added again
  13. # from GitHub. Another user copy of the mod (from another marketplace) is uninstalled;
  14. # copies in a project are not changed, only shown.
  15. # 4. Turns on auto-update for the razorback16 marketplace in your Claude Code
  16. # settings.json (extraKnownMarketplaces), with a backup of the file before that change.
  17. # An autoUpdate: false that you set is kept.
  18. # Run it again to update. It never uses sudo.
  19. # 5. When iTerm2 or herdr is there: adds the mod's own /iui setup block (it sets
  20. # CLAUDE_CODE_FORCE_TERMINAL_IMAGES=1 in iTerm2 and herdr only) to the start file of
  21. # your login shell, with a backup. /iui setup remove removes it.
  22. # Options: IUI_NO_TYPST=1 (no Typst step), IUI_NO_AUTO_UPDATE=1 (no auto-update step),
  23. # IUI_NO_SHELL_SETUP=1 (no shell setup step).
  24. # All the work is in functions, and the last line runs it: a cut download runs nothing.
  25. if [ -z "${BASH_VERSION:-}" ]; then
  26. echo "Run this script with bash: curl -fsSL https://intelligentui.art/install.sh | bash" >&2
    • Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
    • Line 27 on GitHub
  27. exit 1
  28. fi
  29. set -euo pipefail
  30. MARKETPLACE=razorback16
  31. MARKETPLACE_REPO=razorback16/cc-intelligent-ui
  32. PLUGIN_NAME=cc-intelligent-ui
  33. PLUGIN=cc-intelligent-ui@razorback16
  34. # The oldest Claude Code that the mod works with (docs/install.md).
  35. MIN_CLAUDE=2.1.298
  36. CLAUDE_SETUP_URL=https://code.claude.com/docs/en/setup
  37. TYPST_VERSION=0.15.1
  38. TYPST_MIN=0.15
  39. TYPST_URL=https://github.com/typst/typst/releases/download/v$TYPST_VERSION
  40. # Where the mod looks for Typst when it is not on the PATH, in its order
  41. # (TYPST_FALLBACKS in hooks/lib/settings.ts). `~` is $HOME.
  42. TYPST_DIRS='/opt/homebrew/bin /usr/local/bin /usr/bin /snap/bin ~/.cargo/bin ~/.local/bin /home/linuxbrew/.linuxbrew/bin ~/.linuxbrew/bin'
  43. # SHA-256 of the official Typst 0.15.1 release files. Computed from the files
  44. # downloaded from github.com/typst/typst/releases/tag/v0.15.1, and the same as
  45. # the `digest` of each file in the GitHub release API.
  46. typst_sha256() {
  47. case $1 in
  48. typst-aarch64-apple-darwin.tar.xz) echo 48f62ed034aa3a7978309579ac6ca00045e2ef0da73114e8af27cfd8e74dc05a ;;
  49. typst-x86_64-apple-darwin.tar.xz) echo 7f9fdd9584866245de9a79e0add8f9236fae6f40a8a45e2c4771ccc14db4e0fa ;;
  50. typst-aarch64-unknown-linux-musl.tar.xz) echo 5aa8d74a3d906e60ea12a66ac2f37f8eef1b14cbad7182a745e393a10c23dcee ;;
  51. typst-x86_64-unknown-linux-musl.tar.xz) echo a6d077d0a95eed5a2eba715b2dae06be954f624ccbf85758a03f389ded33118c ;;
  52. *) return 1 ;;
  53. esac
  54. }
  55. # Output: plain ASCII; bold headings only on a terminal.
  56. BOLD=
  57. PLAIN=
  58. init_output() {
  59. if [ -t 1 ] && [ "${TERM:-dumb}" != dumb ] && [ -z "${NO_COLOR:-}" ]; then
  60. BOLD=$(printf '\033[1m')
  61. PLAIN=$(printf '\033[0m')
  62. fi
  63. }
  64. say() { printf '%s\n' "$*"; }
  65. step() { printf '\n%s%s%s\n' "$BOLD" "$*" "$PLAIN"; }
  66. note() { printf ' %s\n' "$*"; }
  67. warn() { printf ' Warning: %s\n' "$*" >&2; }
  68. die() {
  69. printf '\nError: %s\n' "$*" >&2
  70. exit 1
  71. }
  72. # Shows a claude command, then runs it (stdin closed: it can not read this script).
  73. claude_run() {
  74. printf ' $ claude %s\n' "$*"
  75. "$CLAUDE" "$@" < /dev/null
  76. }
  77. on() { [ -n "${1:-}" ] && [ "$1" != 0 ]; }
  78. # The work folder, removed at the end.
  79. WORK=
  80. cleanup() { if [ -n "$WORK" ]; then rm -rf "$WORK"; fi; }
  81. # 0 when version $1 >= $2 (dotted numbers).
  82. version_ge() {
  83. awk -v a="$1" -v b="$2" 'BEGIN {
  84. n = split(a, x, "."); m = split(b, y, "."); if (m > n) n = m
  85. for (i = 1; i <= n; i++) { if (x[i] + 0 > y[i] + 0) exit 0; if (x[i] + 0 < y[i] + 0) exit 1 }
  86. exit 0 }'
  87. }
  88. # "~/..." with $HOME, for messages and paths.
  89. tilde() {
  90. case $1 in
  91. "$HOME"/*) printf '~%s' "${1#"$HOME"}" ;;
  92. *) printf '%s' "$1" ;;
  93. esac
  94. }
  95. # --- 1. Checks -------------------------------------------------------------
  96. OS=
  97. ARCH=
  98. TARGET=
  99. check_platform() {
  100. local s m
  101. s=$(uname -s)
  102. m=$(uname -m)
  103. case $s in
  104. Darwin) OS=macos TARGET=apple-darwin ;;
  105. Linux) OS=linux TARGET=unknown-linux-musl ;;
  106. *) die "this system ($s) is not supported. Intelligent UI works on macOS and Linux." ;;
  107. esac
  108. case $m in
  109. arm64 | aarch64) ARCH=aarch64 ;;
  110. x86_64 | amd64) ARCH=x86_64 ;;
  111. *) die "this processor ($m) is not supported. Intelligent UI works on arm64 and x86_64." ;;
  112. esac
  113. # A shell under Rosetta says x86_64 on an Apple silicon Mac.
  114. if [ "$OS" = macos ] && [ "$ARCH" = x86_64 ] && [ "$(sysctl -n sysctl.proc_translated 2> /dev/null || true)" = 1 ]; then
  115. ARCH=aarch64
  116. fi
  117. note "System: $OS, $ARCH"
  118. }
  119. CLAUDE=
  120. check_claude() {
  121. local v
  122. CLAUDE=$(command -v claude 2> /dev/null || true)
  123. if [ -z "$CLAUDE" ]; then
  124. # The native installer's place, when the shell has not put it on the PATH yet.
  125. for v in "$HOME/.local/bin/claude" "$HOME/.claude/local/claude"; do
  126. if [ -x "$v" ]; then
  127. CLAUDE=$v
  128. break
  129. fi
  130. done
  131. fi
  132. if [ -z "$CLAUDE" ]; then
  133. printf '\nError: Claude Code is not installed (no claude command on your PATH).\n' >&2
  134. printf 'Install Claude Code first: %s\nThen run this installer again. Nothing was changed.\n' "$CLAUDE_SETUP_URL" >&2
  135. exit 1
  136. fi
  137. v=$("$CLAUDE" --version < /dev/null 2> /dev/null | awk 'NR == 1 { print $1 }' || true)
  138. case $v in
  139. [0-9]*.[0-9]*.[0-9]*)
  140. note "Claude Code: $v ($(tilde "$CLAUDE"))"
  141. if ! version_ge "$v" "$MIN_CLAUDE"; then
  142. warn "Intelligent UI needs Claude Code $MIN_CLAUDE or later. Update Claude Code: claude update"
  143. fi
  144. ;;
  145. *) warn "could not read the version of Claude Code ($(tilde "$CLAUDE")). Intelligent UI needs $MIN_CLAUDE or later." ;;
  146. esac
  147. }
  148. # --- 2. Typst --------------------------------------------------------------
  149. # The version of the typst at $1 (for example 0.15.1), or nothing.
  150. typst_version() {
  151. "$1" --version < /dev/null 2> /dev/null | awk 'NR == 1 && $1 == "typst" { print $2 }' || true
  152. }
  153. # The typst that the mod uses (findTypst in hooks/lib/typst.ts): a login
  154. # shell's PATH (macOS puts /usr/local/bin first there), then the PATH, then
  155. # TYPST_DIRS in order.
  156. mod_typst() {
  157. local p
  158. p=$(perl -e 'alarm 5; exec @ARGV' sh -lc 'command -v typst' < /dev/null 2> /dev/null | head -n 1 || true)
  159. case $p in /*)
  160. printf '%s' "$p"
  161. return 0
  162. ;;
  163. esac
  164. find_tool typst
  165. }
  166. # The program $1: on the PATH, else in TYPST_DIRS in order.
  167. find_tool() {
  168. local p d
  169. p=$(command -v "$1" 2> /dev/null || true)
  170. case $p in /*)
  171. printf '%s' "$p"
  172. return 0
  173. ;;
  174. esac
  175. for d in $TYPST_DIRS; do
  176. case $d in \~/*) d=$HOME/${d#\~/} ;; esac
  177. if [ -e "$d/$1" ]; then
  178. printf '%s' "$d/$1"
  179. return 0
  180. fi
  181. done
  182. return 0
  183. }
  184. sha256_of() {
  185. if command -v sha256sum > /dev/null 2>&1; then
  186. sha256sum "$1" | awk '{ print $1 }'
  187. elif command -v shasum > /dev/null 2>&1; then
  188. shasum -a 256 "$1" | awk '{ print $1 }'
  189. else
  190. perl -MDigest::SHA -e 'print Digest::SHA->new(256)->addfile($ARGV[0], "b")->hexdigest' "$1"
  191. fi
  192. }
  193. # tar extracts .tar.xz with the xz command, or by itself (bsdtar, as on macOS).
  194. tar_reads_xz() {
  195. command -v xz > /dev/null 2>&1 && return 0
  196. tar --version 2> /dev/null | grep -qi bsdtar
  197. }
  198. SUM_TYPST=
  199. UNDO_TYPST=
  200. install_typst() {
  201. local pick v dest asset want got bin
  202. step "2. Typst"
  203. if on "${IUI_NO_TYPST:-}"; then
  204. note "Skipped (IUI_NO_TYPST is set)."
  205. SUM_TYPST="not checked (IUI_NO_TYPST is set)"
  206. return 0
  207. fi
  208. dest=$HOME/.local/bin/typst
  209. pick=$(mod_typst)
  210. if [ -n "$pick" ]; then
  211. v=$(typst_version "$pick")
  212. if [ -n "$v" ] && version_ge "$v" "$TYPST_MIN"; then
  213. note "Typst $v is installed: $(tilde "$pick"). Not changed."
  214. SUM_TYPST="Typst $v, $(tilde "$pick") (already installed)"
  215. return 0
  216. fi
  217. note "Typst ${v:-of an unknown version} is at $(tilde "$pick"). Intelligent UI needs $TYPST_MIN or later."
  218. fi
  219. v=
  220. if [ -x "$dest" ]; then v=$(typst_version "$dest"); fi
  221. if [ -n "$v" ] && version_ge "$v" "$TYPST_MIN"; then
  222. note "Typst $v is in $(tilde "$dest") already. Not changed."
  223. SUM_TYPST="Typst $v, $(tilde "$dest") (already installed)"
  224. else
  225. command -v curl > /dev/null 2>&1 || die "curl is not installed. Install curl, or install Typst $TYPST_MIN yourself (refer to https://github.com/typst/typst#installation)."
  226. tar_reads_xz || die "tar can not extract .tar.xz files here. Install xz (xz-utils on Debian and Ubuntu), then run this installer again."
  227. if [ -d "$dest" ] && [ ! -L "$dest" ]; then die "$(tilde "$dest") is a folder. Typst was not installed."; fi
  228. asset=typst-$ARCH-$TARGET.tar.xz
  229. want=$(typst_sha256 "$asset") || die "no Typst release file for $ARCH-$TARGET."
  230. WORK=$(mktemp -d "${TMPDIR:-/tmp}/iui-install.XXXXXX")
  231. note "Downloading the official Typst $TYPST_VERSION release: $TYPST_URL/$asset"
  232. curl -fsSL --proto '=https' --proto-redir '=https' --tlsv1.2 --retry 2 -o "$WORK/$asset" "$TYPST_URL/$asset" < /dev/null \
  233. || die "the download of Typst failed. Nothing was installed."
  234. got=$(sha256_of "$WORK/$asset")
  235. if [ "$got" != "$want" ]; then
  236. die "the SHA-256 of the downloaded Typst file is not correct (expected $want, got $got). The file was deleted, and nothing was installed."
  237. fi
  238. note "SHA-256 is correct: $got"
  239. mkdir "$WORK/x"
  240. tar -xJf "$WORK/$asset" -C "$WORK/x" < /dev/null || die "tar could not extract $asset. Nothing was installed."
  241. bin=$WORK/x/typst-$ARCH-$TARGET/typst
  242. if [ ! -f "$bin" ] || [ -L "$bin" ]; then die "no typst program in $asset. Nothing was installed."; fi
  243. chmod 755 "$bin"
  244. v=$(typst_version "$bin")
  245. [ "$v" = "$TYPST_VERSION" ] || die "the downloaded typst does not run here (it gave '${v}'). Nothing was installed."
  246. mkdir -p "$HOME/.local/bin"
  247. # A copy in the same folder, then one rename: never a half-written typst.
  248. cp "$bin" "$HOME/.local/bin/.typst.iui-$$"
  249. chmod 755 "$HOME/.local/bin/.typst.iui-$$"
  250. mv -f "$HOME/.local/bin/.typst.iui-$$" "$dest"
  251. note "Installed Typst $TYPST_VERSION: $(tilde "$dest")"
  252. SUM_TYPST="Typst $TYPST_VERSION, $(tilde "$dest") (downloaded and installed)"
  253. UNDO_TYPST="rm ~/.local/bin/typst"
  254. fi
  255. case ":$PATH:" in
  256. *":$HOME/.local/bin:"*) ;;
  257. *) note "Your PATH does not have ~/.local/bin. Intelligent UI finds Typst there. To run typst in a shell, add ~/.local/bin to your PATH." ;;
  258. esac
  259. pick=$(mod_typst)
  260. if [ -n "$pick" ] && [ "$pick" != "$dest" ]; then
  261. warn "Intelligent UI uses the first Typst it finds: $(tilde "$pick") (Typst $(typst_version "$pick")). Remove or update that one, or put ~/.local/bin before it in your PATH."
  262. fi
  263. }
  264. # --- JSON (perl) -------------------------------------------------------------
  265. # A small strict JSON reader that keeps the byte place of each value, so a
  266. # change to settings.json inserts text and keeps all other bytes. It needs
  267. # only core perl (no modules). Modes:
  268. # marketplace NAME stdin: the marketplace list (a JSON array); prints 3 lines for "name": NAME:
  269. # official or other, the source for `marketplace add`, and a description.
  270. # Exit 1: no such marketplace.
  271. # plugin ID stdin: the plugin list; prints the "version" and "enabled" of "id": ID, "scope": "user"
  272. # copies NAME stdin: the plugin list; prints "id TAB scope TAB version TAB enabled TAB projectPath"
  273. # for each copy of the plugin NAME (any marketplace, any scope); a copy with no
  274. # marketplace (@skills-dir, @inline) has its folder (installPath) for projectPath
  275. # entry FILE prints declared, or off (autoUpdate: false), for extraKnownMarketplaces.razorback16
  276. # in FILE. Exit 1: not there. Exit 2: FILE can not be read.
  277. # settings FILE BACKUP [OFF]
  278. # sets extraKnownMarketplaces.razorback16 (source and autoUpdate: true, or false with OFF)
  279. # in FILE; prints created, changed, unchanged or off (false already, kept).
  280. # Exit 2: not changed (the reason on stdout).
  281. # Exit 3: stdin is not a JSON array.
  282. json_pl() {
  283. cat << 'PERL'
  284. use strict; use warnings; no warnings 'recursion';
  285. use Fcntl;
  286. my ($mode, @args) = @ARGV;
  287. my $s;
  288. sub err { die "not valid JSON (byte " . (pos($s) // 0) . ": expected $_[0])\n" }
  289. sub ws { $s =~ /\G[ \t\n\r]*/gc }
  290. # The next byte (no zero-length match: perl allows no two at one place).
  291. sub peek { substr($s, pos($s), 1) eq $_[0] }
  292. sub str {
  293. $s =~ /\G"((?:[^"\\\x00-\x1f]++|\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4}))*+)"/gc or err('a string');
  294. my $r = $1;
  295. my %e = (n => "\n", t => "\t", b => "\b", f => "\f", r => "\r");
  296. # \u escapes as UTF-8 bytes (a pair for a character past U+FFFF), as the file's own bytes.
  297. $r =~ s{\\u([dD][89abAB][0-9a-fA-F]{2})\\u([dD][c-fC-F][0-9a-fA-F]{2})|\\u([0-9a-fA-F]{4})|\\(.)}
  298. {defined $1 ? u8(0x10000 + ((hex($1) - 0xD800) << 10) + hex($2) - 0xDC00) : defined $3 ? u8(hex $3) : ($e{$4} // $4)}ge;
  299. return $r;
  300. }
  301. sub u8 { my $c = chr(shift); utf8::encode($c); return $c }
  302. sub val {
  303. ws();
  304. my $b = pos($s);
  305. if ($s =~ /\G\{/gc) {
  306. my @m;
  307. ws();
  308. unless ($s =~ /\G\}/gc) {
  309. while (1) {
  310. ws();
  311. my $ks = pos($s);
  312. peek('"') or err('a key');
  313. my $k = str();
  314. my $ke = pos($s);
  315. ws();
  316. $s =~ /\G:/gc or err("':'");
  317. my $v = val();
  318. push @m, { k => $k, ks => $ks, ke => $ke, v => $v };
  319. ws();
  320. next if $s =~ /\G,/gc;
  321. last if $s =~ /\G\}/gc;
  322. err("',' or '}'");
  323. }
  324. }
  325. return { t => 'o', m => \@m, b => $b, e => pos($s) };
  326. }
  327. if ($s =~ /\G\[/gc) {
  328. my @l;
  329. ws();
  330. unless ($s =~ /\G\]/gc) {
  331. while (1) {
  332. push @l, val();
  333. ws();
  334. next if $s =~ /\G,/gc;
  335. last if $s =~ /\G\]/gc;
  336. err("',' or ']'");
  337. }
  338. }
  339. return { t => 'a', l => \@l, b => $b, e => pos($s) };
  340. }
  341. if (peek('"')) { my $x = str(); return { t => 's', s => $x, b => $b, e => pos($s) } }
  342. if ($s =~ /\G-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][-+]?[0-9]+)?/gc) { return { t => 'n', b => $b, e => pos($s) } }
  343. if ($s =~ /\G(true|false|null)/gc) { return { t => $1, b => $b, e => pos($s) } }
  344. err('a value');
  345. }
  346. sub parse {
  347. $s = $_[0];
  348. pos($s) = ($s =~ /^\xEF\xBB\xBF/) ? 3 : 0;
  349. my $v = val();
  350. ws();
  351. pos($s) == length($s) or err('the end of the file');
  352. return $v;
  353. }
  354. # The last member named $k (JSON.parse keeps the last one).
  355. sub member { my ($o, $k) = @_; my $f; for (@{ $o->{m} }) { $f = $_ if $_->{k} eq $k } return $f }
  356. # A string member, or undef.
  357. sub sv { my ($o, $k) = @_; my $m = member($o, $k); return ($m && $m->{v}{t} eq 's') ? $m->{v}{s} : undef }
  358. # No control bytes (for the shell's messages); other bytes, such as UTF-8 letters, are kept.
  359. sub clean { my $x = shift // ''; $x =~ s/[\x00-\x1f\x7f]|\xc2[\x80-\x9f]//g; return $x }
  360. # 1 when a source (an object with source, repo, url, ref, path) is the official
  361. # one: GitHub razorback16/cc-intelligent-ui, with no ref, path or sparse paths.
  362. sub official {
  363. my $o = shift;
  364. for my $k (qw(ref path)) { my $x = sv($o, $k); return 0 if defined $x && $x ne '' }
  365. return 0 if member($o, 'sparsePaths');
  366. my $kind = sv($o, 'source') // '';
  367. my $repo = sv($o, 'repo') // '';
  368. my $url = sv($o, 'url') // '';
  369. return 1 if $kind eq 'github' && lc($repo) eq 'razorback16/cc-intelligent-ui';
  370. return 1 if $kind eq 'git' && $url =~ m{\Ahttps://github\.com/razorback16/cc-intelligent-ui(?:\.git)?\z}i;
  371. return 0;
  372. }
  373. if ($mode eq 'marketplace' || $mode eq 'plugin' || $mode eq 'copies') {
  374. local $/; my $in = <STDIN> // '';
  375. my $v = eval { parse($in) } or exit 3;
  376. exit 3 unless $v->{t} eq 'a';
  377. for my $x (@{ $v->{l} }) {
  378. next unless $x->{t} eq 'o';
  379. if ($mode eq 'marketplace') {
  380. next unless (sv($x, 'name') // '') eq $args[0];
  381. my ($kind, $ref, $path) = map { clean(sv($x, $_)) } qw(source ref path);
  382. my ($spec, $desc);
  383. if ($kind eq 'github' || $kind eq 'git') {
  384. my $at = clean(sv($x, $kind eq 'git' ? 'url' : 'repo'));
  385. $spec = $at . ($ref ne '' ? "#$ref" : '');
  386. $desc = ($kind eq 'git' ? "the git URL $at" : "the GitHub repository $at") . ($ref ne '' ? " (ref $ref)" : '') . ($path ne '' ? " (folder $path)" : '');
  387. } elsif ($kind eq 'directory' || $kind eq 'file') {
  388. $spec = $path;
  389. $desc = ($kind eq 'file' ? 'the local file ' : 'the local folder ') . $path;
  390. } elsif ($kind eq 'url') {
  391. $spec = clean(sv($x, 'url'));
  392. $desc = "the URL $spec";
  393. } else {
  394. $spec = '';
  395. $desc = "a source of the type '$kind'";
  396. }
  397. print official($x) ? 'official' : 'other', "\n$spec\n$desc\n";
  398. exit 0;
  399. }
  400. my ($id, $sc, $ver, $en) = map { member($x, $_) } qw(id scope version enabled);
  401. next unless $id && $id->{v}{t} eq 's';
  402. my $vs = ($ver && $ver->{v}{t} eq 's') ? $ver->{v}{s} : '?';
  403. $vs =~ s/[^\x21-\x7e]//g;
  404. my $state = ($en && $en->{v}{t} eq 'false') ? 'disabled' : 'enabled';
  405. if ($mode eq 'plugin') {
  406. next unless $id->{v}{s} eq $args[0];
  407. next unless $sc && $sc->{v}{t} eq 's' && $sc->{v}{s} eq 'user';
  408. print $vs eq '' ? '?' : $vs, " $state\n";
  409. exit 0;
  410. }
  411. # copies: only ids that are safe to give to `claude plugin`.
  412. next unless $id->{v}{s} =~ /\A\Q$args[0]\E\@[A-Za-z0-9._-]+\z/;
  413. my $scope = clean(sv($x, 'scope'));
  414. $scope = '?' unless $scope =~ /\A[a-z]+\z/;
  415. my $where = sv($x, $id->{v}{s} =~ /\@(?:skills-dir|inline)\z/ ? 'installPath' : 'projectPath');
  416. print join("\t", $id->{v}{s}, $scope, $vs eq '' ? '?' : $vs, $state, clean($where)), "\n";
  417. }
  418. exit($mode eq 'copies' ? 0 : 1);
  419. }
  420. my $name = 'razorback16';
  421. if ($mode eq 'entry') {
  422. my $f = $args[0];
  423. exit 1 unless -e $f;
  424. open(my $fh, '<:raw', $f) or exit 2;
  425. local $/; my $t = <$fh> // ''; close $fh;
  426. exit 1 if $t =~ /\A\s*\z/;
  427. my $root = eval { parse($t) } or exit 2;
  428. exit 2 unless $root->{t} eq 'o';
  429. my $ekm = member($root, 'extraKnownMarketplaces');
  430. exit 1 unless $ekm && $ekm->{v}{t} eq 'o';
  431. my $rb = member($ekm->{v}, $name) or exit 1;
  432. my $au = $rb->{v}{t} eq 'o' ? member($rb->{v}, 'autoUpdate') : undef;
  433. print $au && $au->{v}{t} eq 'false' ? "off\n" : "declared\n";
  434. exit 0;
  435. }
  436. exit 4 unless $mode eq 'settings';
  437. my ($file, $bak, $off) = @args;
  438. my $want = $off ? 'false' : 'true';
  439. my @source = ([source => '"github"'], [repo => '"razorback16/cc-intelligent-ui"']);
  440. sub refuse { print "$_[0]\n"; exit 2 }
  441. my $real = $file;
  442. if (-l $file) {
  443. require Cwd;
  444. $real = Cwd::realpath($file);
  445. refuse("$file is a link to a file that is not there") unless defined $real && -e $real;
  446. }
  447. my ($old, $text);
  448. if (-e $real) {
  449. refuse("$file is not a file") unless -f $real;
  450. open(my $fh, '<:raw', $real) or refuse("can not read $file: $!");
  451. local $/; $old = <$fh> // ''; close $fh;
  452. }
  453. # Writes: a new file in the same folder, then one rename.
  454. sub put {
  455. my ($path, $data, $fmode, $then) = @_;
  456. my $tmp = "$path.iui-$$";
  457. unlink $tmp;
  458. sysopen(my $fh, $tmp, O_WRONLY | O_CREAT | O_EXCL, defined $fmode ? 0600 : 0666) or die "can not write $tmp: $!\n";
  459. binmode $fh;
  460. unless ((print {$fh} $data) && close $fh) { my $e = $!; unlink $tmp; die "can not write $tmp: $e\n" }
  461. chmod($fmode, $tmp) if defined $fmode;
  462. # The backup only when the new file is written.
  463. if ($then) { eval { $then->(); 1 } or do { unlink $tmp; die $@ } }
  464. rename($tmp, $path) or do { my $e = $!; unlink $tmp; die "can not write $path: $e\n" };
  465. }
  466. # A file that is not writable, or one with more names (hard links), is not replaced.
  467. sub writable {
  468. my $nl = (stat $real)[3];
  469. refuse("$file is not writable") unless -w $real;
  470. refuse("$file has $nl hard links, and a new file would break them") if $nl > 1;
  471. }
  472. # The line end of the file (CRLF kept).
  473. our $NL = (defined $old && $old =~ /\r\n/) ? "\r\n" : "\n";
  474. # JSON text for a value: [key, value] lists are objects, a string is raw JSON.
  475. sub render {
  476. my ($v, $ind, $unit, $multi, $kv) = @_;
  477. return $v unless ref $v;
  478. my @p = map { '"' . $_->[0] . '"' . $kv . render($_->[1], $ind . $unit, $unit, $multi, $kv) } @$v;
  479. return $multi ? "{$NL" . join(",$NL", map { "$ind$unit$_" } @p) . "$NL$ind}" : '{' . join($kv eq ':' ? ',' : ', ', @p) . '}';
  480. }
  481. my $out;
  482. if (!defined $old || $old =~ /\A\s*\z/) {
  483. $text = render([[extraKnownMarketplaces => [[$name => [[source => \@source], [autoUpdate => $want]]]]]], '', ' ', 1, ': ') . "\n";
  484. $out = defined $old ? 'changed' : 'created';
  485. } else {
  486. my $root = eval { parse($old) };
  487. unless ($root) { chomp(my $why = $@); refuse("$file is $why") }
  488. refuse("$file is not a JSON object") unless $root->{t} eq 'o';
  489. my $lineind = sub { my $p = shift; my $l = rindex($old, "\n", $p - 1) + 1; substr($old, $l) =~ /^([ \t]*)/; $1 };
  490. my $nl = ($old =~ /\n/);
  491. my ($unit, $kv) = (' ', ': ');
  492. if (@{ $root->{m} }) {
  493. my $f = $root->{m}[0];
  494. my $gap = substr($old, $root->{b} + 1, $f->{ks} - $root->{b} - 1);
  495. $unit = $1 if $gap =~ /\n([ \t]+)\z/;
  496. $kv = (substr($old, $f->{ke}, $f->{v}{b} - $f->{ke}) =~ / /) ? ': ' : ':';
  497. } elsif (!$nl) {
  498. $kv = ':';
  499. }
  500. # Each change: [begin, end, new text].
  501. my @edits;
  502. my $add = sub {
  503. my ($o, @members) = @_;
  504. my $li = $lineind->($o->{b});
  505. if (@{ $o->{m} }) {
  506. my $f = $o->{m}[0];
  507. my $l = $o->{m}[-1];
  508. my $gap = substr($old, $o->{b} + 1, $f->{ks} - $o->{b} - 1);
  509. my $okv = (substr($old, $f->{ke}, $f->{v}{b} - $f->{ke}) =~ / /) ? ': ' : ':';
  510. if ($gap =~ /\n([ \t]*)\z/) {
  511. my $mi = $1;
  512. my $u = (length($mi) > length($li) && substr($mi, 0, length $li) eq $li) ? substr($mi, length $li) : $unit;
  513. push @edits, [$l->{v}{e}, $l->{v}{e}, join('', map { ",$NL$mi\"$_->[0]\"$okv" . render($_->[1], $mi, $u, 1, $okv) } @members)];
  514. } else {
  515. my $sep = $okv eq ':' ? ',' : ', ';
  516. push @edits, [$l->{v}{e}, $l->{v}{e}, join('', map { "$sep\"$_->[0]\"$okv" . render($_->[1], '', '', 0, $okv) } @members)];
  517. }
  518. } else {
  519. push @edits, [$o->{b}, $o->{e}, render(\@members, $li, $unit, $nl ? 1 : 0, $kv)];
  520. }
  521. };
  522. my $ekm = member($root, 'extraKnownMarketplaces');
  523. if (!$ekm) {
  524. $add->($root, [extraKnownMarketplaces => [[$name => [[source => \@source], [autoUpdate => $want]]]]]);
  525. } elsif ($ekm->{v}{t} ne 'o') {
  526. refuse("extraKnownMarketplaces in $file is not an object");
  527. } else {
  528. my $rb = member($ekm->{v}, $name);
  529. if (!$rb) {
  530. $add->($ekm->{v}, [$name => [[source => \@source], [autoUpdate => $want]]]);
  531. } elsif ($rb->{v}{t} ne 'o') {
  532. refuse("extraKnownMarketplaces.$name in $file is not an object");
  533. } else {
  534. my $src = member($rb->{v}, 'source');
  535. refuse("extraKnownMarketplaces.$name in $file has another source, not the GitHub repository razorback16/cc-intelligent-ui")
  536. if $src && !($src->{v}{t} eq 'o' && official($src->{v}));
  537. my $au = member($rb->{v}, 'autoUpdate');
  538. if ($au && $au->{v}{t} eq 'true') { print "unchanged\n"; exit 0 }
  539. # Off by the person's choice (Disable auto-update): kept.
  540. if ($au && $au->{v}{t} eq 'false') { print "off\n"; exit 0 }
  541. if ($au) {
  542. push @edits, [$au->{v}{b}, $au->{v}{e}, $want];
  543. } else {
  544. $add->($rb->{v}, (member($rb->{v}, 'source') ? () : [source => \@source]), [autoUpdate => $want]);
  545. }
  546. }
  547. }
  548. $text = $old;
  549. for my $e (sort { $b->[0] <=> $a->[0] } @edits) { substr($text, $e->[0], $e->[1] - $e->[0]) = $e->[2] }
  550. $out = 'changed';
  551. }
  552. # The new text must read back with the entry set.
  553. my $check = eval { parse($text) };
  554. my $ok = $check && $check->{t} eq 'o';
  555. for my $k ('extraKnownMarketplaces', $name, 'autoUpdate') {
  556. last unless $ok;
  557. my $m = member($check, $k);
  558. $ok = $m && ($k eq 'autoUpdate' ? $m->{v}{t} eq $want : $m->{v}{t} eq 'o');
  559. $check = $m->{v} if $ok;
  560. }
  561. refuse("the change of $file did not read back (nothing was written)") unless $ok;
  562. writable() if defined $old;
  563. my $fmode = defined $old ? (stat $real)[2] & 07777 : undef;
  564. eval {
  565. put($real, $text, $fmode, defined $old ? sub { put($bak, $old, $fmode) } : undef);
  566. 1;
  567. } or do { chomp(my $why = $@); refuse($why) };
  568. print "$out\n";
  569. PERL
  570. }
  571. # LC_ALL=C: no perl locale warnings (a LANG that is not installed).
  572. json() { LC_ALL=C perl -e "$(json_pl)" "$@"; }
  573. # --- 3. The mod ----------------------------------------------------------------
  574. SUM_PLUGIN=
  575. COPIES=
  576. # Undo lines of step 3 that are not always there (one per line).
  577. UNDO_MORE=
  578. TAB=$(printf '\t')
  579. # $1 quoted for a shell command line, when it needs quotes.
  580. shq() {
  581. case $1 in
  582. '' | *[!A-Za-z0-9_./:@#%+=,-]*) printf "'%s'" "$(printf '%s' "$1" | sed "s/'/'\\\\''/g")" ;;
  583. *) printf '%s' "$1" ;;
  584. esac
  585. }
  586. # The version in a plugin_state line, or "?".
  587. ver_of() {
  588. local v=${1%% *}
  589. printf '%s' "${v:-?}"
  590. }
  591. # "VERSION enabled|disabled" of the mod in user scope, or nothing.
  592. plugin_state() {
  593. "$CLAUDE" plugin list --json < /dev/null 2> /dev/null | json plugin "$PLUGIN" 2> /dev/null || true
  594. }
  595. # Each copy of the mod, from any marketplace, in any scope (lines of
  596. # id, scope, version, enabled and projectPath, with tabs).
  597. plugin_copies() {
  598. "$CLAUDE" plugin list --json < /dev/null 2> /dev/null | json copies "$PLUGIN_NAME" 2> /dev/null || true
  599. }
  600. # The razorback16 marketplace. MKT_KIND: official, other (another source:
  601. # MKT_SPEC and MKT_DESC tell which), none (not known) or unknown (no JSON list).
  602. MKT_KIND=
  603. MKT_SPEC=
  604. MKT_DESC=
  605. marketplace_source() {
  606. local out info rc=0
  607. MKT_KIND=unknown
  608. if out=$("$CLAUDE" plugin marketplace list --json < /dev/null 2> /dev/null); then
  609. info=$(printf '%s' "$out" | json marketplace "$MARKETPLACE" 2> /dev/null) || rc=$?
  610. case $rc in
  611. 0)
  612. {
  613. IFS= read -r MKT_KIND
  614. IFS= read -r MKT_SPEC
  615. IFS= read -r MKT_DESC
  616. } << INFO || true
  617. $info
  618. INFO
  619. return 0
  620. ;;
  621. 1)
  622. MKT_KIND=none
  623. return 0
  624. ;;
  625. esac
  626. fi
  627. # No JSON: the text list. The source is not known.
  628. if ! "$CLAUDE" plugin marketplace list < /dev/null 2> /dev/null | grep -qw "$MARKETPLACE"; then MKT_KIND=none; fi
  629. }
  630. # The user settings file of Claude Code.
  631. settings_file() { printf '%s/settings.json' "${CLAUDE_CONFIG_DIR:-$HOME/.claude}"; }
  632. # The razorback16 entry of the user settings: none, declared, off (autoUpdate
  633. # false) or unknown (the file can not be read).
  634. user_entry() {
  635. local f out rc=0
  636. f=$(settings_file)
  637. case $f in /*) ;; *)
  638. printf unknown
  639. return 0
  640. ;;
  641. esac
  642. out=$(json entry "$f" 2> /dev/null) || rc=$?
  643. case $rc in
  644. 0) printf '%s' "$out" ;;
  645. 1) printf none ;;
  646. *) printf unknown ;;
  647. esac
  648. }
  649. # The marketplace has another source (a fork, a pinned ref, a local folder):
  650. # an update from it can not get the newest version. Remove its entry in the
  651. # user settings, then add the official one. Claude Code can uninstall the mod
  652. # with the marketplace; if it does, the installer installs it again.
  653. OLD_STATE=
  654. REPOINTED=
  655. AUTO_OFF=
  656. repoint_marketplace() {
  657. local id scope ver pp undo entry
  658. warn "the $MARKETPLACE marketplace comes from $MKT_DESC, not from the GitHub repository $MARKETPLACE_REPO. An update from there can not get the newest version of the mod."
  659. note "So the installer adds the $MARKETPLACE marketplace again from $MARKETPLACE_REPO."
  660. note "Claude Code can uninstall the mod with the old marketplace; if it does, the installer installs it again."
  661. note "Kept: your /iui settings (Claude Code keeps them under the name $PLUGIN). The mod has no other saved options, secrets or data."
  662. OLD_STATE=$(plugin_state)
  663. entry=$(user_entry)
  664. # Auto-update that you turned off stays off for the new source.
  665. if [ "$entry" = off ]; then AUTO_OFF=1; fi
  666. while IFS=$TAB read -r id scope ver _ pp; do
  667. if [ "$id" = "$PLUGIN" ] && [ "$scope" != user ]; then
  668. note "Claude Code can also remove the copy of the mod in $scope scope for ${pp:-a project}."
  669. fi
  670. done << COPIES
  671. $COPIES
  672. COPIES
  673. if [ -n "$MKT_SPEC" ]; then
  674. undo="claude plugin marketplace remove $MARKETPLACE, then claude plugin marketplace add $(shq "$MKT_SPEC")"
  675. else
  676. undo="claude plugin marketplace remove $MARKETPLACE, then add $MKT_DESC again"
  677. fi
  678. # `remove --scope user` fails when the user settings do not declare it (an
  679. # older Claude Code, or another scope); then `add` changes its source by itself.
  680. if [ "$entry" = none ]; then
  681. note "Your user settings do not declare the $MARKETPLACE marketplace, so claude plugin marketplace add changes its source."
  682. if ! claude_run plugin marketplace add "$MARKETPLACE_REPO"; then
  683. die "Claude Code could not add the marketplace $MARKETPLACE_REPO. The old marketplace was not changed. The mod was not updated."
  684. fi
  685. else
  686. claude_run plugin marketplace remove "$MARKETPLACE" --scope user || die "Claude Code could not remove the marketplace $MARKETPLACE (from $MKT_DESC). The mod was not updated."
  687. if ! claude_run plugin marketplace add "$MARKETPLACE_REPO"; then
  688. die "Claude Code could not add the marketplace $MARKETPLACE_REPO. To add the old one back: claude plugin marketplace add $(shq "${MKT_SPEC:-?}")"
  689. fi
  690. fi
  691. note "The $MARKETPLACE marketplace comes from $MARKETPLACE_REPO now (before: $MKT_DESC)."
  692. REPOINTED=1
  693. UNDO_MORE="${UNDO_MORE}Old source: $undo
  694. "
  695. }
  696. # A copy that is in $2 (copies lines) with the id, scope and path of line $1.
  697. copy_in() {
  698. local id scope pp i s p
  699. IFS=$TAB read -r id scope _ _ pp << LINE
  700. $1
  701. LINE
  702. while IFS=$TAB read -r i s _ _ p; do
  703. if [ "$i" = "$id" ] && [ "$s" = "$scope" ] && [ "$p" = "$pp" ]; then return 0; fi
  704. done << LIST
  705. $2
  706. LIST
  707. return 1
  708. }
  709. install_plugin() {
  710. local before after rc=0 mkt_ok=1 now line id scope ver pp old new
  711. step "3. The mod: $PLUGIN"
  712. COPIES=$(plugin_copies)
  713. marketplace_source
  714. case $MKT_KIND in
  715. none) claude_run plugin marketplace add "$MARKETPLACE_REPO" || die "Claude Code could not add the marketplace $MARKETPLACE_REPO." ;;
  716. other) repoint_marketplace ;;
  717. *)
  718. if ! claude_run plugin marketplace update "$MARKETPLACE"; then
  719. mkt_ok=
  720. warn "the marketplace update failed. The mod is updated from the copy of the marketplace that Claude Code has, which can be old."
  721. fi
  722. ;;
  723. esac
  724. before=$(plugin_state)
  725. if [ -n "$before" ]; then
  726. claude_run plugin update "$PLUGIN" --scope user || rc=$?
  727. after=$(plugin_state)
  728. if [ "$rc" != 0 ]; then
  729. warn "the update of the mod failed. The installed version ($(ver_of "$after")) stays."
  730. SUM_PLUGIN="$PLUGIN_NAME $(ver_of "$after") (NOT updated: the update failed, refer to the warning above)"
  731. PROBLEM=1
  732. elif [ "$(ver_of "$after")" != "$(ver_of "$before")" ]; then
  733. SUM_PLUGIN="$PLUGIN_NAME $(ver_of "$after") (updated from $(ver_of "$before"))"
  734. elif [ -z "$mkt_ok" ]; then
  735. SUM_PLUGIN="$PLUGIN_NAME $(ver_of "$after") (NOT checked for a newer version: the marketplace update failed)"
  736. PROBLEM=1
  737. elif [ "$MKT_KIND" = unknown ]; then
  738. SUM_PLUGIN="$PLUGIN_NAME $(ver_of "$after") (no newer version found)"
  739. else
  740. SUM_PLUGIN="$PLUGIN_NAME $(ver_of "$after") (the newest version was installed already)"
  741. fi
  742. else
  743. claude_run plugin install "$PLUGIN" --scope user || die "Claude Code could not install $PLUGIN."
  744. after=$(plugin_state)
  745. SUM_PLUGIN="$PLUGIN_NAME $(ver_of "$after") (installed)"
  746. fi
  747. if [ -n "$REPOINTED" ] && [ "$rc" = 0 ]; then
  748. SUM_PLUGIN="$PLUGIN_NAME $(ver_of "$after") (from $MARKETPLACE_REPO now; before: $(ver_of "$OLD_STATE") from $MKT_DESC)"
  749. # A local folder can have a version that is not released yet.
  750. old=$(ver_of "$OLD_STATE")
  751. new=$(ver_of "$after")
  752. if [ "$old" != '?' ] && [ "$new" != '?' ] && [ "$old" != "$new" ] && version_ge "$old" "$new"; then
  753. warn "the version from the old source ($old) is newer than the version on GitHub ($new). To use the old source again: $(printf '%s' "$UNDO_MORE" | sed -n 's/^Old source: *//p')"
  754. fi
  755. fi
  756. # A mod that was disabled before the new marketplace stays disabled.
  757. case $OLD_STATE:$after in
  758. *' disabled:'*' enabled')
  759. claude_run plugin disable "$PLUGIN" --scope user || warn "Claude Code could not disable the mod again."
  760. after=$(plugin_state)
  761. ;;
  762. esac
  763. case $after in
  764. *' disabled') warn "the mod is disabled in Claude Code. To turn it on: claude plugin enable $PLUGIN" ;;
  765. esac
  766. now=$(plugin_copies)
  767. # A copy with no marketplace: Claude Code can not uninstall it.
  768. while IFS=$TAB read -r id scope ver _ pp; do
  769. case $id in
  770. *@skills-dir) warn "a copy of the mod is in a skills folder of Claude Code ($(tilde "${pp:-${CLAUDE_CONFIG_DIR:-$HOME/.claude}/skills}")): $id $ver. It has no marketplace, so Claude Code can not uninstall it. The copy from $MARKETPLACE is used, not that one. To remove it, delete its folder (claude plugin list shows it)." ;;
  771. *@inline) warn "a copy of the mod is loaded with --plugin-dir${pp:+ from $pp}: $id $ver. Claude Code can not uninstall it. To stop it, start Claude Code without that --plugin-dir." ;;
  772. esac
  773. done << NOW
  774. $now
  775. NOW
  776. # Another copy in user scope (from another marketplace) would run too.
  777. if [ -n "$after" ]; then
  778. while IFS=$TAB read -r id scope ver _ pp; do
  779. case $id in '' | "$PLUGIN" | *@skills-dir | *@inline) continue ;; esac
  780. [ "$scope" = user ] || continue
  781. note "Another copy of the mod is installed for your user: $id $ver. Two copies would both run, so the installer uninstalls that one."
  782. if claude_run plugin uninstall "$id" --scope user; then
  783. note "Uninstalled $id. Its /iui settings are kept under its own name; set them again with /iui if you want."
  784. UNDO_MORE="${UNDO_MORE}Other copy: claude plugin install $id --scope user
  785. "
  786. else
  787. warn "Claude Code could not uninstall $id. Two copies of the mod run. To remove it: claude plugin uninstall $id --scope user"
  788. PROBLEM=1
  789. fi
  790. done << NOW
  791. $now
  792. NOW
  793. now=$(plugin_copies)
  794. fi
  795. # Copies in a project: not changed. In that folder, they can hide the user copy.
  796. while IFS=$TAB read -r id scope ver _ pp; do
  797. case $scope in '' | user) continue ;; esac
  798. case $id in *@skills-dir | *@inline) continue ;; esac
  799. warn "a copy of the mod is installed in $scope scope for ${pp:-a project}: $id $ver. In that project it can be used instead of the version above. To remove it: cd $(shq "${pp:-.}") && claude plugin uninstall $id --scope $scope"
  800. done << NOW
  801. $now
  802. NOW
  803. # Copies that Claude Code removed with the old marketplace.
  804. if [ -n "$REPOINTED" ]; then
  805. while IFS= read -r line; do
  806. IFS=$TAB read -r id scope _ _ pp << LINE
  807. $line
  808. LINE
  809. case $scope in '' | user) continue ;; esac
  810. [ "$id" = "$PLUGIN" ] || continue
  811. copy_in "$line" "$now" && continue
  812. warn "Claude Code removed the copy of the mod in $scope scope for ${pp:-a project} with the old marketplace. To install it there again: cd $(shq "${pp:-.}") && claude plugin install $PLUGIN --scope $scope"
  813. done << COPIES
  814. $COPIES
  815. COPIES
  816. fi
  817. }
  818. # --- 4. Auto-update ------------------------------------------------------------
  819. SUM_AUTO=
  820. AUTO_ON=
  821. UNDO_AUTO=
  822. PROBLEM=
  823. manual_auto_update() {
  824. say " To turn on auto-update yourself: in Claude Code, type /plugin, go to Marketplaces," >&2
  825. say " select $MARKETPLACE, then select Enable auto-update. Or add this to $1:" >&2
  826. cat >&2 << EOF
  827. "extraKnownMarketplaces": {
  828. "$MARKETPLACE": {
  829. "source": { "source": "github", "repo": "$MARKETPLACE_REPO" },
  830. "autoUpdate": true
  831. }
  832. }
  833. EOF
  834. }
  835. # Auto-update turned on: $1 is created or changed, $2 the file.
  836. auto_on() {
  837. AUTO_ON=1
  838. if [ "$1" = created ]; then
  839. note "Made $(tilde "$2") with extraKnownMarketplaces.$MARKETPLACE.autoUpdate = true."
  840. SUM_AUTO="on ($(tilde "$2"), new file)"
  841. return 0
  842. fi
  843. note "Set extraKnownMarketplaces.$MARKETPLACE.autoUpdate = true in $(tilde "$2")."
  844. note "All other settings are kept. The file before this auto-update change: $(tilde "$2").bak-iui"
  845. note "(It has the changes of step 3 already: the backup undoes only the auto-update change.)"
  846. SUM_AUTO="on ($(tilde "$2"))"
  847. UNDO_AUTO="copy $(tilde "$2").bak-iui (the file before the auto-update change only) back to $(tilde "$2")"
  848. }
  849. auto_update() {
  850. local dir file result rc t
  851. step "4. Auto-update for the $MARKETPLACE marketplace"
  852. if on "${IUI_NO_AUTO_UPDATE:-}"; then
  853. note "Skipped (IUI_NO_AUTO_UPDATE is set)."
  854. SUM_AUTO="not changed (IUI_NO_AUTO_UPDATE is set)"
  855. return 0
  856. fi
  857. dir=${CLAUDE_CONFIG_DIR:-$HOME/.claude}
  858. file=$(settings_file)
  859. case $dir in
  860. /*) ;;
  861. *)
  862. warn "CLAUDE_CONFIG_DIR ($dir) is not an absolute path, so the settings file is not known. Nothing was changed."
  863. manual_auto_update "your settings.json"
  864. SUM_AUTO="NOT turned on (refer to the warning above)"
  865. PROBLEM=1
  866. return 0
  867. ;;
  868. esac
  869. if ! command -v perl > /dev/null 2>&1; then
  870. warn "perl is not installed, so $(tilde "$file") was not changed."
  871. manual_auto_update "$(tilde "$file")"
  872. SUM_AUTO="NOT turned on (refer to the warning above)"
  873. PROBLEM=1
  874. return 0
  875. fi
  876. if [ ! -e "$file" ] && [ ! -L "$file" ]; then mkdir -p "$dir"; fi
  877. rc=0
  878. # Only stdout is the result; perl's stderr goes to the screen.
  879. result=$(json settings "$file" "$file.bak-iui" ${AUTO_OFF:+off}) || rc=$?
  880. t="~"
  881. result=${result//"$HOME"/$t}
  882. case $rc:$result in
  883. 0:unchanged)
  884. note "Auto-update is on already ($(tilde "$file")). Not changed."
  885. SUM_AUTO="on (it was on already)"
  886. AUTO_ON=1
  887. ;;
  888. 0:off)
  889. note "Auto-update is off: you turned it off (extraKnownMarketplaces.$MARKETPLACE.autoUpdate = false in $(tilde "$file")). Not changed."
  890. SUM_AUTO="off (your choice; not changed)"
  891. ;;
  892. 0:created | 0:changed)
  893. if [ -z "$AUTO_OFF" ]; then
  894. auto_on "$result" "$file"
  895. else
  896. note "Auto-update stays off for the new source, as you set it: extraKnownMarketplaces.$MARKETPLACE.autoUpdate = false in $(tilde "$file")."
  897. if [ "$result" = changed ]; then note "The file before this change: $(tilde "$file").bak-iui"; fi
  898. SUM_AUTO="off (your choice; kept for the new source)"
  899. fi
  900. ;;
  901. *)
  902. warn "$(tilde "$file") was not changed: ${result:-an unknown error}"
  903. manual_auto_update "$(tilde "$file")"
  904. SUM_AUTO="NOT turned on (refer to the warning above)"
  905. PROBLEM=1
  906. ;;
  907. esac
  908. }
  909. # --- 5. Pictures in iTerm2 and herdr -------------------------------------------
  910. # The mod's own setup block (SETUP_START, SETUP_END and setupBlock() of
  911. # hooks/lib/setup.ts, byte for byte): Claude Code shows pictures in iTerm2 and
  912. # herdr only with CLAUDE_CODE_FORCE_TERMINAL_IMAGES=1 when it starts. The mod's
  913. # /iui setup sees this block as done, and /iui setup remove removes it.
  914. SETUP_START='# >>> cc-intelligent-ui: Claude Code pictures in iTerm2 >>>'
  915. SETUP_END='# <<< cc-intelligent-ui <<<'
  916. # shellcheck disable=SC2016 # the shell reads these lines later, not now
  917. SETUP_SH='if { [ "$TERM_PROGRAM" = "iTerm.app" ] || [ "$TERM_PROGRAM" = "herdr" ]; } && [ -z "$TMUX" ] && [ -z "$STY" ]; then export CLAUDE_CODE_FORCE_TERMINAL_IMAGES=1; fi'
  918. # shellcheck disable=SC2016
  919. SETUP_FISH='if test "$TERM_PROGRAM" = "iTerm.app" -o "$TERM_PROGRAM" = "herdr"; and not set -q TMUX; and not set -q STY; set -gx CLAUDE_CODE_FORCE_TERMINAL_IMAGES 1; end'
  920. # Puts the block in a start file as the mod's withSetup() does: an older block
  921. # of the mod is replaced, one blank line goes before the block, and the exact
  922. # block already there changes nothing. Args: FILE START LINE END BACKUP. A link
  923. # keeps its place and its file changes. Prints created, changed (block added),
  924. # updated (an older block replaced) or unchanged. Exit 2: not changed (the reason on stdout).
  925. setup_pl() {
  926. cat << 'PERL'
  927. use strict; use warnings;
  928. use Fcntl;
  929. my ($file, $start, $line, $end, $bak) = @ARGV;
  930. sub refuse { print "$_[0]\n"; exit 2 }
  931. my $real = $file;
  932. if (-l $file) {
  933. require Cwd;
  934. $real = Cwd::realpath($file);
  935. refuse("$file is a link to a file that is not there") unless defined $real && -e $real;
  936. }
  937. my $old;
  938. if (-e $real) {
  939. refuse("$file is not a regular file") unless -f $real;
  940. refuse("$file is larger than 4 MB") if -s $real > 4 * 1024 * 1024;
  941. open(my $fh, '<:raw', $real) or refuse("can not read $file: $!");
  942. local $/; $old = <$fh>; close $fh;
  943. refuse("can not read $file") unless defined $old;
  944. }
  945. my $text = $old // '';
  946. my $block = "$start\n$line\n$end\n";
  947. if (index($text, $block) >= 0) { print "unchanged\n"; exit 0 }
  948. # withoutSetup(): each START ... END block goes, with one blank line before it.
  949. my @lines = split /\n/, $text, -1;
  950. my @out;
  951. my $replaced = 0;
  952. for (my $i = 0; $i < @lines; $i++) {
  953. if ($lines[$i] ne $start) { push @out, $lines[$i]; next }
  954. my $e = -1;
  955. for my $j ($i .. $#lines) { if ($lines[$j] eq $end) { $e = $j; last } }
  956. if ($e < 0) { push @out, $lines[$i]; next }
  957. pop @out if @out && $out[-1] eq '';
  958. $i = $e;
  959. $replaced++;
  960. }
  961. my $base = join("\n", @out);
  962. $base =~ s/\n*\z//;
  963. my $new = $base . ($base ne '' ? "\n\n" : '') . $block;
  964. # Writes: a new file in the same folder, then one rename.
  965. sub put {
  966. my ($path, $data, $fmode, $then) = @_;
  967. my $tmp = "$path.iui-$$";
  968. unlink $tmp;
  969. sysopen(my $fh, $tmp, O_WRONLY | O_CREAT | O_EXCL, defined $fmode ? 0600 : 0666) or die "can not write $tmp: $!\n";
  970. binmode $fh;
  971. unless ((print {$fh} $data) && close $fh) { my $e = $!; unlink $tmp; die "can not write $tmp: $e\n" }
  972. chmod($fmode, $tmp) if defined $fmode;
  973. # The backup only when the new file is written.
  974. if ($then) { eval { $then->(); 1 } or do { unlink $tmp; die $@ } }
  975. rename($tmp, $path) or do { my $e = $!; unlink $tmp; die "can not write $path: $e\n" };
  976. }
  977. # A file that is not writable, or one with more names (hard links), is not replaced.
  978. if (defined $old) {
  979. my $nl = (stat $real)[3];
  980. refuse("$file is not writable") unless -w $real;
  981. refuse("$file has $nl hard links, and a new file would break them") if $nl > 1;
  982. }
  983. my $fmode = defined $old ? (stat $real)[2] & 07777 : undef;
  984. eval {
  985. put($real, $new, $fmode, defined $old ? sub { put($bak, $old, $fmode) } : undef);
  986. 1;
  987. } or do { chomp(my $why = $@); refuse($why) };
  988. print !defined $old ? "created\n" : $replaced ? "updated\n" : "changed\n";
  989. PERL
  990. }
  991. # 0 when iTerm2 is installed (macOS). IUI_TEST_ROOT is only for the tests.
  992. has_iterm() {
  993. local p
  994. [ "$OS" = macos ] || return 1
  995. for p in "${IUI_TEST_ROOT:-}/Applications/iTerm.app" "$HOME/Applications/iTerm.app"; do
  996. if [ -d "$p" ]; then return 0; fi
  997. done
  998. command -v mdfind > /dev/null 2>&1 || return 1
  999. # Spotlight, stopped after 5 s.
  1000. p=$(perl -e 'alarm 5; exec @ARGV' mdfind "kMDItemCFBundleIdentifier == 'com.googlecode.iterm2'" < /dev/null 2> /dev/null | grep -m 1 '\.app$' || true)
  1001. [ -n "$p" ]
  1002. }
  1003. SUM_SHELL=
  1004. UNDO_SHELL=
  1005. shell_setup() {
  1006. local apps='' name file kind line result rc t f
  1007. step "5. Pictures in iTerm2 and herdr"
  1008. if on "${IUI_NO_SHELL_SETUP:-}"; then
  1009. note "Skipped (IUI_NO_SHELL_SETUP is set)."
  1010. SUM_SHELL="not changed (IUI_NO_SHELL_SETUP is set)"
  1011. return 0
  1012. fi
  1013. if has_iterm; then apps=iTerm2; fi
  1014. if [ -n "$(find_tool herdr)" ]; then apps=${apps:+$apps and }herdr; fi
  1015. if [ -z "$apps" ]; then
  1016. note "No iTerm2 or herdr found. Not needed: other terminals need no setup."
  1017. SUM_SHELL="not needed (no iTerm2 or herdr)"
  1018. return 0
  1019. fi
  1020. note "$apps found. Claude Code shows pictures there only with CLAUDE_CODE_FORCE_TERMINAL_IMAGES=1."
  1021. # The start file of the login shell, as the mod's shellRcOf() picks it.
  1022. name=${SHELL:-}
  1023. name=${name##*/}
  1024. case $name in
  1025. zsh) file=${ZDOTDIR:-$HOME}/.zshrc kind='sh' ;;
  1026. bash)
  1027. kind='sh'
  1028. file=$HOME/.bashrc
  1029. if [ "$OS" = macos ]; then
  1030. # Login bash reads only the first of these that exists: a new .bash_profile would hide the others.
  1031. file=$HOME/.bash_profile
  1032. for f in .bash_profile .bash_login .profile; do
  1033. if [ -e "$HOME/$f" ] || [ -L "$HOME/$f" ]; then
  1034. file=$HOME/$f
  1035. break
  1036. fi
  1037. done
  1038. fi
  1039. ;;
  1040. fish) file=${XDG_CONFIG_HOME:-$HOME/.config}/fish/conf.d/cc-intelligent-ui.fish kind='fish' ;;
  1041. *)
  1042. note "Your shell (${name:-not known}) is not one that the mod knows, so no file was changed."
  1043. note "Add this to your shell's start file: export CLAUDE_CODE_FORCE_TERMINAL_IMAGES=1 (only in iTerm2 and herdr, not in tmux or screen)"
  1044. SUM_SHELL="NOT added (your shell is not known; refer to the lines above)"
  1045. return 0
  1046. ;;
  1047. esac
  1048. if [ "$kind" = fish ]; then line=$SETUP_FISH; else line=$SETUP_SH; fi
  1049. if ! command -v perl > /dev/null 2>&1; then
  1050. result="perl is not installed"
  1051. rc=2
  1052. else
  1053. if [ "$kind" = fish ] && [ ! -e "$file" ] && [ ! -L "$file" ]; then mkdir -p "${file%/*}"; fi
  1054. rc=0
  1055. # Only stdout is the result (LC_ALL=C: no perl locale warnings).
  1056. result=$(LC_ALL=C perl -e "$(setup_pl)" "$file" "$SETUP_START" "$line" "$SETUP_END" "$file.bak-iui") || rc=$?
  1057. fi
  1058. t="~"
  1059. result=${result//"$HOME"/$t}
  1060. case $rc:$result in
  1061. 0:unchanged)
  1062. note "$(tilde "$file") has the Intelligent UI block already. Not changed."
  1063. SUM_SHELL="set already in $(tilde "$file")"
  1064. ;;
  1065. 0:created)
  1066. note "Made $(tilde "$file") with the Intelligent UI block."
  1067. SUM_SHELL="added to $(tilde "$file") (open a new tab or pane)"
  1068. ;;
  1069. 0:changed)
  1070. note "Added the Intelligent UI block to $(tilde "$file")."
  1071. note "The file before this change: $(tilde "$file").bak-iui"
  1072. SUM_SHELL="added to $(tilde "$file") (open a new tab or pane)"
  1073. ;;
  1074. 0:updated)
  1075. note "Updated the Intelligent UI block in $(tilde "$file") (an older block of the mod is replaced)."
  1076. note "The file before this change: $(tilde "$file").bak-iui"
  1077. SUM_SHELL="updated in $(tilde "$file") (open a new tab or pane)"
  1078. ;;
  1079. *)
  1080. warn "$(tilde "$file") was not changed: ${result:-an unknown error}"
  1081. say " To set it yourself, add these lines to $(tilde "$file"), or run /iui setup in Claude Code in iTerm2 or herdr:" >&2
  1082. printf ' %s\n' "$SETUP_START" "$line" "$SETUP_END" >&2
  1083. SUM_SHELL="NOT added (refer to the warning above)"
  1084. PROBLEM=1
  1085. return 0
  1086. ;;
  1087. esac
  1088. UNDO_SHELL="/iui setup remove in Claude Code, or delete the lines from '$SETUP_START' to '$SETUP_END' in $(tilde "$file")"
  1089. }
  1090. # --- 6. Summary ----------------------------------------------------------------
  1091. summary() {
  1092. step "Done"
  1093. note "Typst: $SUM_TYPST"
  1094. note "Mod: $SUM_PLUGIN"
  1095. note "Auto-update: $SUM_AUTO"
  1096. note "Pictures in iTerm2/herdr: $SUM_SHELL"
  1097. say ""
  1098. say "Restart Claude Code, or type /reload-plugins in a session that runs now."
  1099. say "Intelligent UI works best in fullscreen mode: type /tui fullscreen in Claude Code."
  1100. say "Pictures show only in some terminals (kitty, Ghostty, iTerm2 and others). To see why"
  1101. say "pictures do or do not show, type /iui details. Docs: https://github.com/razorback16/cc-intelligent-ui"
  1102. say ""
  1103. say "To undo:"
  1104. if [ -n "$UNDO_TYPST" ]; then note "Typst: $UNDO_TYPST"; fi
  1105. note "Mod: claude plugin uninstall $PLUGIN"
  1106. note "Marketplace: claude plugin marketplace remove $MARKETPLACE (also removes its settings entry)"
  1107. if [ -n "$UNDO_MORE" ]; then printf '%s' "$UNDO_MORE" | sed 's/^/ /'; fi
  1108. if [ -n "$AUTO_ON" ]; then
  1109. note "Auto-update: /plugin > Marketplaces > $MARKETPLACE > Disable auto-update"
  1110. note " (it also sets extraKnownMarketplaces.$MARKETPLACE.autoUpdate to false in settings.json)"
  1111. if [ -n "$UNDO_AUTO" ]; then note " or $UNDO_AUTO"; fi
  1112. fi
  1113. if [ -n "$UNDO_SHELL" ]; then note "Shell setup: $UNDO_SHELL"; fi
  1114. case $SUM_AUTO in off*)
  1115. say ""
  1116. say "Auto-update is off, as you set it. To turn it on: in Claude Code, type /plugin, go to"
  1117. say "Marketplaces, select $MARKETPLACE, then select Enable auto-update."
  1118. ;;
  1119. esac
  1120. }
  1121. main() {
  1122. init_output
  1123. trap cleanup EXIT
  1124. trap 'exit 130' INT
  1125. trap 'exit 143' TERM
  1126. say "${BOLD}Intelligent UI for Claude Code: installer${PLAIN}"
  1127. say "It installs Typst $TYPST_VERSION (when no Typst $TYPST_MIN or later is found), the mod $PLUGIN,"
  1128. say "turns on auto-update for the $MARKETPLACE marketplace, and sets up pictures in iTerm2 and herdr."
  1129. say "It never uses sudo."
  1130. step "1. Checks"
  1131. check_platform
  1132. check_claude
  1133. install_typst
  1134. cleanup
  1135. WORK=
  1136. install_plugin
  1137. auto_update
  1138. shell_setup
  1139. summary
  1140. if [ -n "$PROBLEM" ]; then
  1141. say ""
  1142. say "Finished with a problem: refer to the warning above."
  1143. exit 1
  1144. fi
  1145. }
  1146. main "$@"

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.