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

@astralyn/minicpa

v0.5.2

Published

Manage, run, and update one local CLIProxyAPI instance

Readme

MiniCPA

MiniCPA provides a cross-platform cpa command to bootstrap, manage, inspect, and update a local CLIProxyAPI instance.

Architecture & Principles

MiniCPA is designed as an un-opinionated process supervisor and binary manager around a single local CLIProxyAPI (CPA) instance:

  • Ownership Boundary: MiniCPA creates a minimal bootstrap config.yaml only on first initialization. After that, configuration, provider credentials, routing, and Web panel provisioning belong entirely to CLIProxyAPI. MiniCPA treats configuration as opaque data and never parses, modifies, or synchronizes it.
  • Two-Phase Binary Updates: Binary downloads, integrity checks, and unpacking occur in an isolated staging workspace without stopping the running service. The lifecycle lock is only acquired during the brief atomic commit phase.
  • Kernel-Level Concurrency: Concurrency control relies on operating-system-level kernel leases (Named Pipes on Windows, Abstract Unix Sockets on Linux, and Loopback listeners on macOS). Lock files serve solely as diagnostic records and cannot cause deadlock or lock stealing.
  • Process Safety: Process management tracks both PIDs and platform-specific process start markers to prevent misdirected signals caused by OS PID recycling. Outbound child process environments are automatically stripped of sensitive credentials.

Installation

Requires Node.js 24+.

npm install -g @astralyn/minicpa

Or inspect without a global install:

npx @astralyn/minicpa --help

Quick Start

cpa init    # Create the minimal bootstrap config and install the latest CPA binary
cpa start   # Start CLIProxyAPI in the background
cpa web     # Open the management Web panel in your browser
cpa status  # Check the service, versions, and any detected problems

The bootstrap configuration listens on 127.0.0.1:8317 with default bootstrap credentials (sk-cliproxyapi client key, CLIPROXYAPI management password) and enables native file logging. cpa init prints both credentials once; CLIProxyAPI hashes the management password on first start, so change both in the Web panel before exposing the instance beyond this machine. The bootstrap config also selects the CPA-Manager-Plus Web panel, which CLIProxyAPI downloads and keeps updated; see docs/security.md for this trust decision and how to change it. All subsequent configuration is performed directly inside CLIProxyAPI.

Connection Target

MiniCPA defaults to connecting via http://127.0.0.1:8317. If you configure a custom port, reverse proxy, or HTTPS in CLIProxyAPI, specify the target explicitly before any command:

cpa --api-url https://127.0.0.1:9443 start
cpa --api-url https://127.0.0.1:9443 status
cpa --api-url https://127.0.0.1:9443 web

Alternatively, set the MINICPA_API_URL environment variable.

Updates & Upgrades

MiniCPA maintains a strict distinction between the managed daemon and the management CLI:

  • CLIProxyAPI Binary Updates (cpa update): Fetches, verifies, and stages the latest or pinned CLIProxyAPI binary release from upstream GitHub, restarting the service only if the binary was replaced.

    cpa update
    cpa update --version 8.0.47
  • MiniCPA CLI Upgrades (cpa upgrade): Checks the npm registry and installs that exact latest version of the globally installed @astralyn/minicpa npm package in place. It never stops, restarts, or updates CLIProxyAPI.

    cpa upgrade

Commands Overview

| Command | Category | Purpose | |---------|----------|---------| | cpa init | Lifecycle | Create the bootstrap config once and install CLIProxyAPI | | cpa start | Lifecycle | Start CLIProxyAPI in the background and wait for readiness | | cpa stop | Lifecycle | Stop the running CLIProxyAPI | | cpa restart | Lifecycle | Restart CLIProxyAPI | | cpa status | Lifecycle | Show status, uptime, endpoints, autostart, versions, home, and detected problems | | cpa auto [on\|off] | Lifecycle | Show or set login autostart (Windows Task/Registry, systemd, launchd) | | cpa web | Interfaces | Print and open the management Web panel | | cpa tui | Interfaces | Attach to the native CLIProxyAPI terminal UI | | cpa logs | Interfaces | Show native CLIProxyAPI logs (-f follow, -n <lines>, --err request-error logs) | | cpa update | Updates | Update the CLIProxyAPI binary (--version, --force) | | cpa upgrade | Updates | Upgrade the MiniCPA npm package |

cpa status exits with 0 only when CLIProxyAPI is running and answering HTTP, so scripts can use it as a health check.

Directory Layout

| Path Target | Windows | macOS | Linux | |-------------|---------|-------|-------| | Root | %LOCALAPPDATA%\MiniCPA | ~/Library/Application Support/MiniCPA | $XDG_DATA_HOME/MiniCPA | | Instance | <root>\instance | <root>/instance | <root>/instance | | Temp | <root>\temp | <root>/temp | <root>/temp |

Instance data (configuration, authentication credentials, native logs) resides permanently under <root>/instance; cpa status prints its exact path. Uninstalling MiniCPA never removes your instance data or credentials.

For detailed architecture, concurrency, and security models, see docs/README.md.

Development

git clone https://github.com/ming-kang/MiniCPA.git
cd MiniCPA
npm ci
npm run hooks:install
npm run check
  • npm run check: Run linter, type checks, test suite, and build.
  • npm test: Run test suite with node:test.
  • npm run dev -- <command>: Execute development entry with tsx.

Follow RELEASING.md for release workflows and see CHANGELOG.md for version history.

License

MIT