pixeledge-cn
v0.1.3
Published
CLI to download utility files (utils, contexts, services) from the pixeledge source repo into your project — like shadcn/ui but for pixeledge utilities.
Maintainers
Readme
pixeledge-cn
A shadcn/ui-style CLI that lets you download individual utility files, React contexts, and service helpers from the pixeledge source repo directly into your own project — no extra package to maintain, just the files you need.
Quick start
# one-off, no install required
npx pixeledge-cn add utils/CancelablePromiseOr install globally:
npm install -g pixeledge-cn
pixeledge-cn add utils/BeeApiCommands
init
Creates a pixeledge.config.json in your project root. This is optional but lets you configure the base output directory.
npx pixeledge-cn initpixeledge.config.json (defaults):
{
"baseDir": ".",
"sourceRepo": {
"owner": "sunergix",
"name": "hsi",
"branch": "develop"
}
}list
Lists every component available in the registry with a short description and its peer-dependency requirements.
npx pixeledge-cn listadd <component>
Downloads a component from the source repo and writes it to your project.
npx pixeledge-cn add utils/CancelablePromise
npx pixeledge-cn add utils/BeeApi
npx pixeledge-cn add utils/DeApi
npx pixeledge-cn add components/RedirectIfAuthenticated
npx pixeledge-cn add components/AuthRoutesOptions
| Flag | Description |
|------|-------------|
| -o, --output <dir> | Override the output directory (file name is preserved) |
| -y, --yes | Skip confirmation prompts |
Examples
# Download to the default location (src/utils/BeeApi.js)
npx pixeledge-cn add utils/BeeApi
# Download to a custom directory
npx pixeledge-cn add utils/BeeApi --output lib/apiAvailable components
| Registry key | Description | Peer deps |
|---|---|---|
| utils/CancelablePromise | Wraps any promise to support cancellation. Useful for React unmount patterns. | — |
| utils/BeeApi | Axios client with interceptors, response normalisation and cancelable request wrappers. | axios |
| utils/DeApi | Variant of BeeApi targeting a different base URL. | axios |
| components/RedirectIfAuthenticated | React Router guard that redirects authenticated users away from public pages. | react, react-router-dom |
| components/AuthRoutes | Route guard that protects private routes with fallback to /login. | react, react-router-dom |
How it works
- The CLI looks up the requested key in its local registry (
src/registry/index.js). - It fetches the raw file from
https://raw.githubusercontent.com/sunergix/hsi/develop/<sourcePath>. - It writes the file to the correct location inside your project (respecting
pixeledge.config.jsonif present).
Files are copied as-is — you own them once they're in your project and can edit them freely.
Development
git clone https://github.com/iamsatar/pixeledge-cn.git
cd pixeledge-cn
npm install
npm testTo add a new component to the registry, edit src/registry/index.js.
