npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@smhd/opencode-rtl

v0.5.0

Published

Smart RTL patcher for the OpenCode desktop app (UI-only, global). Inspired by antigravity-rtl.

Readme

opencode-rtl

UI-only RTL patcher for the OpenCode desktop app (macOS, Windows, Linux). Inspired by antigravity-rtl.

  • Content-aware direction: each paragraph, list, table, and quote follows its own token-majority script, code excluded from the vote (so [x] کار فارسی and روال ویرآوا (CloudMeeting) flip RTL, pure-English stays LTR)
  • Leading > / < markers are LTR-isolated so bidi never mirrors them; leading number runs (۱۲. عنوان) are pinned to the line start
  • Code blocks, terminal, editor, diffs always stay LTR (real monospace stack)
  • Offline Vazirmatn font, base64-embedded in the stylesheet (no extra request)
  • Hover the header RTL button to see state and font status (Vazirmatn OK vs MISSING)
  • Header RTL button (top-right, beside the session actions) opens a settings popup: on/off and Force-RTL switches, font status, all shortcuts listed, debug snapshot copy
  • Hover-free: no guessing — every shortcut is shown in the popup
  • Settings persist in the app's localStorage → global across all repos
  • UI-only: no model, prompt, instruction, or tool-output changes

Usage

npx @smhd/opencode-rtl                 # patch (quit OpenCode first)
npx @smhd/opencode-rtl --status        # check state
npx @smhd/opencode-rtl --probe         # diagnose a patch failure (paste the output in an issue)
npx @smhd/opencode-rtl --restore       # revert to original

Requires Node 22.12+.

From source:

git clone https://github.com/SMhdAsadi/opencode-rtl.git
cd opencode-rtl
bun install          # once (@electron/asar)

bun bin/opencode-rtl.js            # patch (quit OpenCode first)
bun bin/opencode-rtl.js --status   # check state
bun bin/opencode-rtl.js --probe    # diagnose a patch failure
bun bin/opencode-rtl.js --restore  # revert to original

Install locations

Auto-detection searches these app.asar paths (override with --path <.../app.asar>):

| OS | Default path | Source | | ------- | --------------------------------------------------------- | --------- | | macOS | /Applications/OpenCode.app/Contents/Resources/app.asar | DMG / brew | | Windows | %LOCALAPPDATA%\Programs\OpenCode\resources\app.asar | official installer (NSIS per-user) | | Windows | %LOCALAPPDATA%\Programs\@opencodedesktop\resources\app.asar | website-install layout seen in the wild — unverified, may not be the OpenCode desktop app; if the patch fails here, run --probe and use --path | | Windows | %USERPROFILE%\scoop\apps\opencode-desktop\current\resources\app.asar | Scoop | | Windows | %PROGRAMFILES%\OpenCode\resources\app.asar | fallback (per-machine installs) | | Linux | /opt/OpenCode/resources/app.asar | .deb | | Linux | /usr/lib/OpenCode/resources/app.asar | .rpm fallback |

AppImage (~/Applications/OpenCode.AppImage, incl. the Homebrew cask) and snap (/snap/opencode) installs are read-only squashfs and cannot be patched in place — the tool errors out clearly. Use the .deb/.rpm/tarball install instead, or point --path at an extracted copy.

Permissions

  • macOS: on Permission Denied, enable System Settings → Privacy & Security → App Management for your terminal (sudo not required).
  • Windows: quit OpenCode first — a running app (or antivirus) locks app.asar (EBUSY). If access is still denied, run the terminal as Administrator.
  • Linux: /opt and /usr are root-owned — re-run with sudo (sudo npx @smhd/opencode-rtl).

On detection failure the tool prints every path it searched.

Troubleshooting a patch failure

If patching fails with "No patchable renderer entry", run npx @smhd/opencode-rtl --probe and paste the full output in an issue. It shows which app.asar was picked, whether it looks like the OpenCode desktop app (package.json identity), and what the archive actually contains (html files, oc-theme files, top-level dirs). If the auto-detected path is not your OpenCode install, re-run with --path <.../app.asar> pointing at the real one.

Notes

  • Quit OpenCode before patching; restart it afterwards.
  • Re-run after every OpenCode update (updates overwrite app.asar).
  • A clean backup is kept next to the asar (app.asar.bak) — e.g. .../Resources/app.asar.bak on macOS, .../resources/app.asar.bak on Windows/Linux. The backup is never overwritten once it exists, and restore refuses a backup that is itself patched.
  • Never run this from inside a repo you care about — it only touches the installed OpenCode app, nothing project-local.
  • Tool call groups already collapse natively in OpenCode, so this patch only collapses Thinking rows (hooked on the stable data-timeline-row="Thinking" attribute — no fragile text matching).