@peerapat.srs/toc
v1.1.2
Published
OpenShift-assisted local port-forward CLI with a Web UI
Downloads
1,257
Maintainers
Readme
@peerapat.srs/toc
OpenShift-assisted local port-forward CLI with a Web UI.
ช่วย oc login / เลือกโปรเจกต์ / เปิด oc port-forward ผ่าน UI บนเครื่องคุณ
npm: https://www.npmjs.com/package/@peerapat.srs/toc
เริ่มใช้งาน (ไทย)
ติดตั้ง
ต้องมี OpenShift CLI (oc) ใน PATH และ Node.js ≥ 20
oc version
npm i -g @peerapat.srs/toc
tocmacOS: brew install openshift-cli
ทางเลือกโดยไม่ติดตั้ง global:
npx @peerapat.srs/tocหมายเหตุ: กล่อง Install บน npmjs.com แสดง
npm i @peerapat.srs/toc(local) เสมอ — แก้ไม่ได้ผ่าน package.json สำหรับ CLI ให้ใช้-gตามด้านบน
รัน
toc
# หรือ
toc startเปิดเบราว์เซอร์ที่ http://127.0.0.1:3847 อัตโนมัติ → login ด้วย credentials ของ OpenShift cluster
ไม่เปิดเบราว์เซอร์:
toc --no-openเปลี่ยนพอร์ต:
toc -p 4000What it is
toc starts a local HTTP server and opens a Web UI so you can:
- Log in to an OpenShift cluster via real
oc login - Browse projects / services / routes / secrets / configmaps
- Start and manage local
oc port-forwardsessions
No mock auth by default — production path uses your installed oc.
Prerequisites
| Requirement | Notes |
|---|---|
| Node.js | >= 20 |
| OpenShift CLI (oc) | Must be on PATH before install and use |
oc versionInstall docs: Getting started with the OpenShift CLI
Skip the postinstall oc check (CI only):
TOC_SKIP_OC_CHECK=1 npm i -g @peerapat.srs/tocInstall
Primary (global — recommended for a CLI):
npm i -g @peerapat.srs/toc
tocAlternative without a global install:
npx @peerapat.srs/tocNote: The npmjs.com Install sidebar always shows local
npm i @peerapat.srs/toc— that string is hardcoded by npm and cannot be changed via package.json. For this CLI, use-gas above.
Run
Binary name: toc
Default command is start (so plain toc is enough):
toc
toc startDefault bind: http://127.0.0.1:3847 — browser opens automatically.
Common flags
| Flag | Default | Description |
|---|---|---|
| -p, --port <number> | 3847 | Listen port |
| --host <host> | 127.0.0.1 | Bind address |
| --no-open | (opens browser) | Do not open the browser |
| -V, --version | | Print version |
| -h, --help | | Help |
Examples:
toc --no-open
toc -p 4000
toc --host 127.0.0.1 --port 4000 --no-open
toc start -p 3847Typical flow
- Install
ocand runnpm i -g @peerapat.srs/toc - Run
toc - In the UI, log in with cluster URL + username/password (
oc login) - Pick a project and start port-forwards as needed
Cluster profiles (URLs you logged into successfully) are stored at ~/.toc/clusters.json — passwords are not stored.
License
UNLICENSED
