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

codehub-sbs-cli

v1.0.0

Published

Command-line client for CodeHub repositories.

Readme

CodeHub CLI

Cross-platform command-line client for CodeHub repositories. It supports Windows PowerShell and Command Prompt, Linux terminals, and macOS Terminal on Node.js 18 or newer.

Install

npm install -g codehub-cli
codehub --version
codehub --help

For local development, run npm link in this package directory. The package is not published automatically.

Sign in

codehub login
codehub whoami

The password prompt does not echo input. CodeHub stores only the access token, expiry, username, user ID, and API URL in the operating system application-data directory:

  • Windows: %APPDATA%\CodeHub\credentials.json
  • Linux: ~/.config/codehub/credentials.json
  • macOS: ~/Library/Application Support/CodeHub/credentials.json

Passwords and tokens are never stored in .codehub or printed by commands. Run codehub logout to remove the credential.

Clone

codehub clone https://codehub.sbs/Puskar/project-name
cd project-name
codehub status

Puskar/project-name and legacy repository IDs are also accepted. Clone refuses non-empty destinations, validates every path, preserves nested folders, and creates portable .codehub metadata.

Connect an existing project

codehub init https://codehub.sbs/Puskar/project-name
codehub add .
codehub status
codehub commit -m "Initial commit"
codehub push

add and commit are local operations. Only push sends data, and the backend rechecks repository role, remote branch head, branch protection, file hashes, size limits, and protected paths.

Branch and pull-request workflow

codehub branch feature/my-change
codehub checkout feature/my-change
codehub add .
codehub commit -m "My change"
codehub push

The CLI prints a pull-request URL after a feature-branch push. Direct pushes to protected branches fail unless the configured owner or maintainer bypass permits them.

Synchronization and history

codehub fetch
codehub pull
codehub history
codehub log --oneline --limit 20

fetch updates remote refs without changing files. pull refuses to overwrite dirty files or unpushed commits. Push finalization uses the expected remote head and returns REMOTE_CHANGED instead of silently overwriting concurrent work.

Staging and branches

codehub add src/App.jsx
codehub add src
codehub add -A
codehub reset src/App.jsx
codehub reset
codehub branch
codehub switch feature/my-change
codehub remote -v
codehub config --list

.codehubignore supports comments, blank lines, *, **, ?, directory patterns, and negation. The CLI always excludes .codehub, .git, dependencies, generated output, .env variants, PEM/key files, private-key names, service-account.json, and credentials.json. The backend independently enforces the same security boundary.

API configuration

Production defaults to https://api.codehub.sbs. Override it for development or self-hosting:

codehub --api-url http://localhost:3002 whoami
codehub config api.url http://localhost:3002

CODEHUB_API_URL is also supported. Priority is CLI flag, environment variable, global configuration, then the production default.

Troubleshooting

  • AUTH_REQUIRED or TOKEN_EXPIRED: run codehub login.
  • PERMISSION_DENIED: ask the repository owner for an appropriate collaborator role.
  • BRANCH_PROTECTED: create and push a feature branch, then open a pull request.
  • REMOTE_CHANGED: run codehub fetch and codehub pull, then reconcile changes.
  • PROTECTED_FILE: remove the secret or credential file before staging.
  • FILE_TOO_LARGE: reduce files below the 25 MB per-file limit.
  • DIRTY_WORKTREE: commit or reset local changes before pulling or switching.

Use --json on supported commands such as status for machine-readable output, and --verbose to include debugging details. Tokens are never included in either output mode.