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

opencode-mimikkai-connect

v1.0.3

Published

MimikkAi auth plugin for OpenCode — device authorization + LiteLLM gateway

Readme

opencode-mimikkai-connect

MimikkAi auth plugin for OpenCode — device authorization + LiteLLM gateway.

Как это работает

opencode start
   │
   ├─ plugin load (config hook)
   │     └─ регистрирует провайдер mimikkai-connect (@ai-sdk/openai-compatible)
   │        baseURL: https://litellm.mimikkai.ru/v1
   │        модели: с listLitellm /model/info (limits + capabilities парсятся из ответа)
   │
   └─ auth.loader
         └─ проверяет sanctum token (GraphQL userViewer)
            → возвращает litellm key как apiKey

Установка opencode plugin add @mimikkai/opencode-mimikkai-connect
        │
        └─ opencode устанавливает пакет в кэш
           (~/.cache/opencode/packages/@mimikkai/...)
           и добавляет запись "plugin" в конфиг

Авторизация  opencode auth login → MimikkAi → Device Authorization
        │
        ├─ device authorize → URL подтверждения (panel.mimikkai.ru)
        ├─ polling /api/auth/device/token
        ├─ sanctum token сохраняется в ~/.local/share/opencode/auth.json
        └─ LiteLLM virtual key хранится в ~/.config/opencode/mimikkai.json

Установка

Через npm (если пакет опубликован и доступен):

opencode plugin add @mimikkai/opencode-mimikkai-connect

Или из локального tarball:

bun run build          # bun build ./src/index.ts --outdir ./dist --target node
bun pm pack            # создаст opencode-mimikkai-connect-<version>.tgz
opencode plugin add ./opencode-mimikkai-connect-<version>.tgz

Замечание: opencode plugin add с путём (./...tgz) работает как file-плагин — dist/index.js импортируется напрямую, npm-зависимости не требуются (всёbundled в dist/index.js, включая proper-lockfile).

Конфигурация

После установки в opencode.json появится:

{
  "plugin": ["@mimikkai/opencode-mimikkai-connect"]
}

Провайдер mimikkai-connect и модели регистрируются plugin'ом автоматически в хук config. Хранилище ключей: ~/.config/opencode/mimikkai.json.

Аутентификация

opencode auth login
# выберите MimikkAi → Device Authorization
# подтвердите код в браузере

Логи / отладка

Плагин пишет [mimikkai:*] логи в stdout через console.debug/info/warn/error. Уровень управляется LOG_LEVEL (default warn):

LOG_LEVEL=debug opencode run "say hi"

Server-side логи opencode: ~/.local/share/opencode/log/opencode.log (проверять failed to load plugin, Plugin config error).

Разработка

bun install          # зависимости
bun run build        # сборка в dist/
bun test             # bun test (src/test)
bun pm pack          # tarball для opencode plugin add

Структура:

  • src/index.ts — Plugin entry (auth + config + dispose hooks)
  • src/mimikkai.ts — устройство-flow (authorize/poll), GraphQL, LiteLLM API
  • src/storage.ts — mimikkai.json хранилище (file lock через proper-lockfile)
  • src/logger.ts — LOG_LEVEL логгер
  • src/constants.ts — URL-ы и имя провайдера

Troubleshooting

  • Provider not found: mimikkai-connect — плагин не загрузился. Проверьте ~/.local/share/opencode/log/opencode.log; убедитесь что запись в plugin отвечает существующему файлу/пакету.
  • Invalid proxy server token (sk-...XknA) — LiteLLM virtual key ротирован. Плагин сам обновляет ключ в config hook; если не помогает — заново opencode auth login.
  • Device code expired — истекло окно авторизации, запустите login заново.
  • Masked key (sk-...) — backend скрыл ключ, требуется re-connect.

License

MIT