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

@mitsein-ai/cli

v0.3.0

Published

Mitsein CLI — dev tooling, API helpers, and workflow automation

Readme

@mitsein-ai/cli

Mitsein CLI — internal dev tool for agent verification and workflow automation.

TypeScript rewrite of backend/apps/mitsein-cli/ (Python), ported to the Bun monorepo.

Install

# From npm (once published)
bunx @mitsein-ai/cli --help

# From monorepo
cd bun-workspace/apps/mitsein-cli
bun install
bun run src/index.ts --help

Quick Start

# Login
mitsein auth login
mitsein auth whoami

# Check backend health
mitsein dev health

# Create a thread, send a message, stream the agent run
TID=$(mitsein --json thread create | jq -r .thread_id)
mitsein agent invoke "$TID" "Hello" --stream

# List threads
mitsein thread list

# Auto-generated API commands from OpenAPI
mitsein api list-tags
mitsein api list-ops threads

Commands

| Command | Description | |---------|-------------| | mitsein version | Print CLI version | | mitsein dev health | Check backend health (GET /health) | | mitsein dev token | Print resolved dev token | | mitsein dev openapi | Load and cache OpenAPI spec | | mitsein api list-tags | List available API tags | | mitsein api list-ops <tag> | List operations for a tag | | mitsein api <tag> <operation> | Execute an API operation | | mitsein thread list | List threads | | mitsein thread get <id> | Get thread details | | mitsein thread create [--name] [--agent] | Create a new thread | | mitsein thread rename <id> <name> | Rename a thread | | mitsein thread delete <id> | Delete a thread | | mitsein thread history <id> | Show message history | | mitsein agent invoke <id> <prompt> | Send message + run agent (SSE) | | mitsein agent running list | List all active runs for the account | | mitsein agent running status <tid> | Read active-run state for a thread | | mitsein agent running tail <tid> | Reconnect to an in-progress run (tail -f) | | mitsein agent running wait <tid> | Block until the thread's run completes | | mitsein agent running cancel <tid> | Cancel a thread's running agent | | mitsein files list/read/write/upload/mkdir/delete/download <tid> | Sandbox file ops | | mitsein project list | List projects | | mitsein project get <id> | Get project details | | mitsein project delete <id> | Delete a project | | mitsein auth login | Browser or device-code login | | mitsein auth logout | Remove saved credentials | | mitsein auth whoami | Show current identity |

Global Flags

| Flag | Description | |------|-------------| | --endpoint <url> | API base URL (default: http://localhost:8000) | | --token <token> | Bearer token | | --profile <name> | Profile name (default: default) | | --real | Use real account for dev token | | --json | Machine-readable JSON output | | --debug | Log HTTP details to stderr | | --timeout <sec> | HTTP timeout (0 = no timeout, default: 30) |

Architecture

Credential Provider Chain

Same 4-step chain as the Python CLI:

  1. ExplicitFlagProvider--token / --endpoint
  2. EnvProviderMITSEIN_TOKEN / MITSEIN_API_URL
  3. OAuthProvider~/.mitsein/oauth/<profile>.json
  4. DevTokenProviderscripts/dev-token.sh (localhost only)

agent invoke Modes

agent invoke always hits POST /api/next/chat which streams SSE. The three flags control how the client surfaces those events:

# Default: wait silently, emit a structured result on exit
mitsein agent invoke <tid> "msg"

# Live streaming to stdout (human-readable or NDJSON with --json)
mitsein agent invoke <tid> "msg" --stream

# Event-type filter
mitsein agent invoke <tid> "msg" --stream --filter tool_call,tool_result

# Cancel the run on Ctrl-C (default is detach-only)
mitsein agent invoke <tid> "msg" --stream --cancel-on-interrupt

Exit code: 0 on done.reason == completed, 1 on error, 124 on timeout, 130 on Ctrl-C.

Reconnect / Attach to a Running Agent

Any client can attach to a thread's running agent and keep streaming from the last delivered event:

# Read status (includes last_event_id)
mitsein agent running status <tid>

# Resume from a specific event id
mitsein agent running tail <tid> --since 1775915617543-0

# Or block-wait until the run ends
mitsein agent running wait <tid>

OpenAPI Auto-Commands

The api command dynamically generates subcommands from the backend's OpenAPI spec:

mitsein api list-tags
mitsein api list-ops threads
mitsein api threads list-threads --body '{"limit": 10}'
echo '{}' | mitsein api threads list-threads --body-stdin

Development

bun run typecheck   # TypeScript check
bun test            # Run tests
bun run build       # Build single binary

CHANGELOG

0.3.0 (2026-04-11) — /api/next migration

Breaking changes — CLI migrated from the deprecated /api/thread/* + /api/message/* + /api/agent-run/* routes to the unified POST /api/next/chat SSE endpoint.

  • Removed: mitsein thread send (was a duplicate of agent invoke)
  • Removed: mitsein messages command group entirely (backend no longer has a "add message without run" action; messages list duplicated thread history)
  • Added: mitsein thread rename (PATCH /api/next/threads/{id}), mitsein thread delete
  • Changed: mitsein agent running {list,status,tail,wait,cancel} now take <thread_id> instead of <run_id> — the backend no longer exposes per-run endpoints; a thread has at most one active run at a time
  • Changed: mitsein agent running list is now account-level (lists all active runs, not per-thread)
  • Added: --since <event_id> on running tail and running wait for precise reconnect
  • Internal: removed core/sse.ts + core/waiters.ts; replaced by core/chat-stream.ts (SSE reader with event-id support) + core/chat-run.ts (stream consumer with filter/accumulator) + core/chat-output.ts (human/NDJSON formatter)

0.2.3 (2026-04-11)

  • Fix: unify profile default from e2edefault (auth login wrote default.json but other commands read e2e.json, causing "No credentials found" immediately after login)
  • Fix: thread list/get/history + messages list + project list migrated to working routes
  • Fix: printDictHuman no longer renders nested objects as [object Object]
  • Fix: --debug now logs method and URL correctly

0.2.0 — 0.2.2

  • P5 files command group
  • Auth: browser login, device code, whoami
  • Initial Python → TS port (0.1.0)

RFC: II95V6