# SkyQUBi CLI · control plane (`skyqubictl`)

**Pattern:** One CLI manages the appliance; humans get a dashboard; scripts get nouns/verbs; new capabilities register as modules.

## Front door

| Entry | Role |
|-------|------|
| **`skyqubictl`** | **Default control plane** — especially **headless / SSH** |
| `s7` | Short alias for `skyqubictl` |
| `skyqubi` | Classic verbs; bare `skyqubi` on headless → `skyqubictl` |
| Desktop **SkyQUBi Terminal** | **Konsole** control plane (`skyqubi-console`) — type `neofetch`/`htop`/`pods` or **Shift+F1–F10** |

### Desktop Konsole console

Double-click **SkyQUBi Terminal** → Konsole (never a browser).

| Type | Or key | Action |
|------|--------|--------|
| `keys` | **Ctrl+F1** / Alt+1 | Key map |
| `neofetch` | **Ctrl+F2** / Alt+2 | Branded L→R panel |
| `fastfetch` | **Ctrl+F3** / Alt+3 | Fastfetch panel |
| `htop` | **Ctrl+F4** / Alt+4 | Process details |
| `pods` | **Ctrl+F5** / Alt+5 | Podman pod details |
| `stack` | **Ctrl+F6** / Alt+6 | Stack pulse |
| `admin` | **Ctrl+F7** / Alt+7 | Admin menus |
| `logs` | **Ctrl+F8** / Alt+8 | Runtime journal |
| `edit notes` | **Ctrl+F9** / Alt+9 | Nano work notes |
| `mon` | **Ctrl+F10** / Alt+0 | Monitoring snapshot |
| `downloads` | — | Pull / download management |

**Note:** Do not use Shift+F* — those are desktop/OS shortcuts and never reach Konsole.

See `branding/konsole/KEYBINDS.md`.

```bash
sudo dnf install -y htop nano btop aria2   # recommended
```

### Headless is the product face

On SSH, console, or any session without a desktop (`DISPLAY` / `WAYLAND` empty):

1. **`skyqubictl` is the default CLI** (not a browser UI).
2. Login opens the **dashboard** (banner + Samuel + admin menu).
3. `exit` returns to a shell with `s7` / `skyqubictl` on `PATH`.

```bash
# one-time install (user, no sudo)
bash ~/Documents/skyqubi-private/bin/install-headless-cli.sh

# then SSH in — or:
S7_HEADLESS=1 bash -l
```

| Escape | Effect |
|--------|--------|
| `touch ~/.config/skyqubi/no-auto-dashboard` | Shell only (no auto menu) |
| `S7_HEADLESS_AUTO_DASHBOARD=0` | Same for this session |
| `S7_HEADLESS=0` | Treat as desktop even over SSH |
| `S7_HEADLESS=1` | Force headless behavior on a GUI box |

```bash
export PATH="$HOME/Documents/skyqubi-private/bin:$PATH"

skyqubictl                    # TTY → dashboard
s7 help
s7 version
s7 health
s7 get stack
s7 fetch both                 # neofetch + fastfetch
```

## Command map

| Task | Command |
|------|---------|
| Interactive dashboard | `skyqubictl dashboard` |
| Health | `skyqubictl health` |
| List services | `skyqubictl get services` |
| Service control | `skyqubictl service start|stop|restart <unit>` |
| Logs | `skyqubictl logs runtime 80` |
| Version / bind | `skyqubictl version` |
| Apply branding | `skyqubictl apply theme` / `icons` |

### Orientation
```
skyqubictl version
skyqubictl health | status
skyqubictl dashboard | menu
skyqubictl fetch [neofetch|fastfetch|both]
```

### Resources
```
skyqubictl get services
skyqubictl get models
skyqubictl get ports
skyqubictl get stack
skyqubictl get disks
skyqubictl get pressures          # Neural / Device Sensors → QUANTi capacity
# UnRAID GOLD: NVIDIA 8 GB CUDA (Quadro M4000). No MemryX M.2 on this box.
```

### Lifecycle
```
skyqubictl start | stop | enable | disable
skyqubictl service list
skyqubictl service restart runtime
skyqubictl logs caddy 50
```

### Intelligence
```
skyqubictl samuel                 # interactive
skyqubictl samuel "Who are you?"  # one-shot
skyqubictl reason "What is OCTi?"
skyqubictl retrieve "QUANTi L1"
skyqubictl council "…"
skyqubictl models list | pull
```

### Ops
```
skyqubictl backup pre-change
skyqubictl backup status
skyqubictl apply theme            # prints sudo handoff
skyqubictl apply icons
skyqubictl open cc | live | website
```

## Expand (modules)

Drop a file under `bin/skyqubi.d/`:

```bash
# bin/skyqubi.d/50-example.sh
cmd_example() { echo ping; }
skyqubi_register example "sample extension" cmd_example
```

Then:

```bash
skyqubictl help          # lists under Extensions
skyqubictl example
```

**Conventions**

- Load order: `NN-name.sh` (numeric prefix)
- Libraries: `_*.sh` (not registered as commands)
- Example scaffold: `bin/skyqubi.d/90-example.sh` → `skyqubictl example ping`

## Administrative monitor (expanded multi-column)

**Default `neofetch` / `skyqubictl fetch`** draws the **expanded SkyQUBi administrative monitor** (`bin/skyqubi-admin-monitor`):

| Row | Panels |
|-----|--------|
| 1 | QiAM mark · **PRODUCT** · **SYSTEM** · **LIFE GRAPH** · **NEURAL / DEVICE** · **HARDWARE** |
| 2 | **STACK MONITOR** — Runtime/CC/CWS/Live/Caddy/Pod/Img/Boot LEDs · ports · unit states |
| 3 | **STORAGE** · **NETWORK** · **INTELLIGENCE** (HOT + models) · **ADMIN · CLI** |

| Panel | Content |
|-------|---------|
| **PRODUCT** | Version · CWS · PE theme · plane · Samuel · **QUANTi capacity** |
| **SYSTEM** | Host · OS · kernel · uptime · shell · DE · pkgs · procs |
| **LIFE GRAPH** | CPU/MEM/DSK/LOAD bars · loadavg · mem · disk IO MB/s |
| **NEURAL / DEVICE** | Neural / Device Sensors — Memory · Storage · CPU PSI · **QUANTi capacity** (L3\|L2\|L1\|HOLD) |
| **HARDWARE** | CPU · cores · RAM · NVIDIA 8 GB CUDA (this GOLD box) |
| **STACK** | 8 service LEDs · ports including image-gen :57083 |
| **STORAGE** | `/` · bulk · mempalace · home · StorP + IO |
| **NETWORK** | IP · all local service endpoints |
| **INTELLIGENCE** | HOT bank A/B/C · model tags · Samuel |
| **ADMIN · CLI** | health · mon · pods · samuel · keys · fetch |

**Neural / Device Sensors** (also `pressures` / `s7 get pressures` / Control Center Console · `/api/pressures`):

- **Memory Pressure** — Linux PSI memory + RAM/swap fill (neural path load)  
- **Storage Pressure** — PSI io + disk fill + diskstats rates (device path)  
- **CPU Pressure** — PSI cpu  
- **Neural / Device Sensors** — aggregate severity badge  
- Maps to **system QUANTi capacity** (not chat QB gate L*)

```bash
skyqubictl fetch                 # expanded multi-column admin monitor
neofetch                         # same (console alias)
mon                              # monitor + listener snapshot
pressures                        # Neural / Device Sensors → QUANTi capacity
s7 get pressures --json
S7_FETCH=fastfetch skyqubictl fetch   # classic fastfetch only
S7_FETCH_RAW=1 skyqubictl fetch       # legacy neofetch binary layout
```

Renderer: `bin/skyqubi-admin-monitor` (Python grid). Optional: `branding/neofetch/`, `branding/fastfetch/`.

## HOT banks · Deep Thought consensus (A · B · C)

Three banks of **7 training models** each. Switching a letter makes that set **HOT** for Deep Thought consensus at different performance tiers.

| Bank | Mode | Atom tier | Role |
|------|------|----------:|------|
| **A** | 3 | 369 | Light density / fast consensus |
| **B** | 6 | 2214 | Specialty ring (code/reason/chat) |
| **C** | 9 | 3327 | Deep Thought + personas |

```bash
hot                 # list banks + ingest/encoding readiness
hot A               # make bank A HOT
hot B               # switch to B
hot C               # switch to C (deep)
hot models          # HOT 7 detail · Modelfile · runtime
hot smoke           # consensus smoke on HOT 7
s7 hot A            # same via skyqubictl
```

Config: `config/hot-banks.json` · state: `~/.config/skyqubi/hot-bank.json`  
When HOT is set, `select_witnesses()` prefers the HOT seven (`engine/s7_hot_banks.py`).  
Door/Guardian stay **outside** the vote.

## External pull · AnythingLLM-style dropdown

Same download path AnythingLLM uses when **LLM provider = Ollama**: model dropdown + import any tag / HF GGUF, landing in the Ollama store (`:57081`).

| Command | Action |
|---------|--------|
| `catalog` / `s7 pull` / `downloads` | Dropdown catalog (local vs pull) |
| `pull <tag>` | Stream download via `POST /api/pull` |
| `pull-hot` / `hot pull` | Pull base GGUFs for current HOT bank |
| `hot pull A` | Pull bases for bank A (also B/C) |
| `pull remote` | Popular tags from ollama.com |
| `anythingllm` | Bridge status + UI setup for ALLM → `:57081` |

```bash
catalog
pull llama3.2:3b
pull hf.co/prism-ml/Bonsai-27B-gguf:Q1_0
hot pull A          # download missing bases for bank A
hot A               # make A HOT after bases land
anythingllm         # point ALLM UI at http://127.0.0.1:57081
```

Config: `config/model-catalog.json` · tool: `bin/skyqubi-external-pull`  
Env: `S7_ANYTHINGLLM_URL` (default `http://127.0.0.1:3001`) when ALLM is installed.

## 3-Level Deep Consensus · 7 Frontier AI APIs · 7 Continents

```
L1  SkyQUBi Core          Foundation (atoms · ternary · product truth)
L2  Training Models       HOT banks A|B|C — 7 local witnesses each
    Witness Reporter      Door (s7-samuel:bonsai) — FERTILE|BABEL, no vote
L3  7 Frontier AI APIs    Deep Consensus — one ring · seven continents
```

**Seven continents:** Africa · Antarctica · Asia · Europe · North America · South America · Oceania

### Level-3 seats (exactly 7 · independent labs · no wrappers)

| # | Continent | Provider | Lab | Env key |
|---|-----------|----------|-----|---------|
| 1 | North America | **Grok** | xAI | `XAI_API_KEY` |
| 2 | South America | **ChatGPT** | OpenAI | `OPENAI_API_KEY` |
| 3 | Oceania | **Claude** | Anthropic | `ANTHROPIC_API_KEY` |
| 4 | Africa | **Gemini** | Google DeepMind | `GEMINI_API_KEY` |
| 5 | Asia | **DeepSeek** | DeepSeek | `DEEPSEEK_API_KEY` |
| 6 | Europe | **Mistral** | Mistral AI | `MISTRAL_API_KEY` |
| 7 | Antarctica | **Command** | Cohere | `COHERE_API_KEY` |

**Excluded:** Perplexity — not independent (reuses Claude/Anthropic-class stacks).

**Pipeline:** L1 Core → history → current events → **L2 HOT ForToken** →
**L3 Frontier ForToken/RevToken** → **Door / Witness Reporter**.

```bash
export S7_FRONTIER=1
export S7_LIVE_SEARCH=1
frontier status
frontier reason --local 7 "…"
frontier reason --providers grok,openai,anthropic,gemini,deepseek,mistral,cohere "…"
```

Config: `config/frontier-providers.json` · CLI: `bin/skyqubi-frontier`

## Control Center · Console tab (browser-contained)

The full Konsole CLI remains on the desktop. For browser-only ops, Control Center
has a **Console** tab:

| Surface | URL |
|---------|-----|
| Console tab | `http://127.0.0.1:57080/#console` |
| API snapshot | `GET /api/console` |
| Switch HOT | `POST /api/console/hot` `{"bank":"A"}` (operator token) |

Shows L1–L3 architecture, port LEDs, HOT A/B/C switcher, 7 Frontier seats, CLI list, and an **xterm.js** session.

### xterm.js security (read this)

| Control | Behavior |
|---------|----------|
| **Default mode** | `restricted` — allowlisted verbs only (`help`, `hot`, `status`, …) · **no free shell** |
| **Full shell** | Only if `S7_CONSOLE_PTY=shell` on Control Center · **high risk (RCE as your user)** |
| **Network** | WebSocket `/ws/console` · **loopback clients only** · reverse-proxy **not** operator |
| **Auth** | When `S7_OPERATOR_TOKEN` is set, token required (`?token=` / `X-S7-Operator`) |
| **Still risky** | XSS in CC page, stolen operator token, or bind beyond 127.0.0.1 expands blast radius |

**Yes, a browser terminal can invite issues** — that is why the default is allowlist, not bash. Prefer **desktop Konsole** when browsing untrusted content. Never expose `:57080` to the LAN without token + TLS edge.

```bash
# default (safe-ish)
# S7_CONSOLE_PTY=restricted   # or unset

# opt-in full shell (operator-only · loopback)
# S7_CONSOLE_PTY=shell
```

## Covenant

Backup before migrate / ingest / schema / stop:

```bash
skyqubictl backup pre-<action>
```
