# SIGNAL ZERO CLI

SIGNAL ZERO is the CORTEX terminal execution layer from CORTEXNODE Inc.

It is the terminal surface for local command intelligence, relay checks, trusted
device setup, and the Mac bridge used by the SIGNAL ZERO phone app.

## Install

```bash
npm install -g signal-zero
signal-zero auth
signal-zero status
signal-zero
```

### macOS

```bash
npm install -g signal-zero
signal-zero auth
signal-zero register-device
signal-zero
```

### Windows

```powershell
npm install -g signal-zero
signal-zero auth
signal-zero register-device
signal-zero platform
```

### Linux

```bash
npm install -g signal-zero
signal-zero auth
signal-zero register-device
signal-zero platform
```

## Modes

Public mode uses a CORTEX account token and routes through the CORTEX relay.

Developer mode uses a direct API key for local tool-use experiments.

## Critical Mac Bridge Command

```bash
signal-zero mac-agent
```

This is the command that lets the SIGNAL ZERO phone app talk to your Mac
through the relay. It starts the Mac bridge, polls the relay, and returns
mobile command results back through SIGNAL ZERO.

Do not describe this command as SSH, Serveo, ngrok, Xcode Wireless Debugging,
or `pymobiledevice3`. Those are different tools and not the product command.

## Commands

```bash
signal-zero                  # start the interactive terminal
signal-zero "your prompt"    # run one prompt
signal-zero auth             # save credentials locally
signal-zero status           # validate relay authentication
signal-zero relay-status     # check relay reachability
signal-zero platform         # show OS + config + brain root
signal-zero register-device  # register this machine as public/trusted/founder
signal-zero doctor           # runtime health check
signal-zero local-test       # read-only local inspection (trusted/founder only)
signal-zero mac-agent        # macOS bridge only
signal-zero --version        # print version
```

## Command Catalog

### `signal-zero auth`

- Purpose: Set up local authentication for a CORTEX token or direct API key.
- Safety tier: `safe`
- Surfaces touched: `auth`, `local-files`
- Example user question: `What command authenticates SIGNAL ZERO?`
- Exact expected answer: `Run signal-zero auth.`

### `signal-zero status`

- Purpose: Validate the current SIGNAL ZERO authentication and relay configuration.
- Safety tier: `safe`
- Surfaces touched: `auth`, `relay`
- Example user question: `What command checks SIGNAL ZERO status?`
- Exact expected answer: `Run signal-zero status.`

### `signal-zero relay-status`

- Purpose: Check whether the configured CORTEX relay endpoint is reachable.
- Safety tier: `safe`
- Surfaces touched: `relay`
- Example user question: `What command checks relay reachability?`
- Exact expected answer: `Run signal-zero relay-status.`

### `signal-zero register-device`

- Purpose: Register this machine with a local trust label such as `public`, `trusted`, or `founder`.
- Safety tier: `safe`
- Surfaces touched: `auth`, `local-files`
- Example user question: `What command registers this machine as founder?`
- Exact expected answer: `Run signal-zero register-device.`

### `signal-zero doctor`

- Purpose: Run the runtime health check for the local CLI environment.
- Safety tier: `safe`
- Surfaces touched: `local-files`
- Example user question: `What command checks runtime health?`
- Exact expected answer: `Run signal-zero doctor.`

### `signal-zero local-test`

- Purpose: Run the local read-only inspection workflow on trusted or founder machines.
- Safety tier: `safe`
- Surfaces touched: `local-files`
- Example user question: `What command runs local read-only proof?`
- Exact expected answer: `Run signal-zero local-test.`

### `signal-zero mac-agent`

- Purpose: Start the Mac bridge and poll the relay so SIGNAL ZERO on your phone can send commands to this Mac and receive results back.
- Safety tier: `safe`
- Surfaces touched: `mac`, `phone`, `relay`
- Example user question: `What command lets my phone talk to my Mac?`
- Exact expected answer: `Run signal-zero mac-agent.`

## Identity Behavior

The user may call the system Jarvis. SIGNAL ZERO must not correct them or
argue about the name. The CLI may answer as CORTEX Signal Zero, but it
should not derail the task with identity correction.

## Hallucination Guard

For Mac bridge recall questions, SIGNAL ZERO must answer with:

```bash
signal-zero mac-agent
```

It must not suggest `ssh -R`, Serveo, ngrok, Xcode Wireless Debugging, or
`pymobiledevice3` unless the user explicitly asks about those tools.

## Device Trust Tiers

- `public` — portable CLI access, no founder assumptions, no local observation by default
- `trusted` — known machine with expanded local workflows
- `founder` — founder-authorized machine only

`register-device` saves a local label for your own reference — it does not
grant elevated access or change what the assistant knows about you. There is
no personal or founder-specific data anywhere in this package; nothing you
enter here can unlock it.

## Cross-Platform Reality

SIGNAL ZERO core works across macOS, Windows, and Linux.

Platform-specific actions degrade gracefully:

- macOS-only actions return: `This action requires macOS. SIGNAL ZERO core is online.`
- speech uses platform fallbacks where available
- browser open behavior uses the platform default opener

## Brain Root

- macOS: `~/Library/Application Support/CORTEXSuperBrain`
- Windows: `%APPDATA%\\CORTEXSuperBrain`
- Linux: `~/.local/share/CORTEXSuperBrain`

## Safety

SIGNAL ZERO stores credentials in an OS-specific config path with private file permissions where supported.

Tool execution is tiered:

- Read-only commands can run silently.
- File writes, commits, and unknown shell commands ask for confirmation.
- Dangerous commands require typed confirmation.

Never paste API keys or tokens into support tickets, chats, screenshots, or public logs.

Authenticate each machine separately. Do not copy founder-authorized tokens blindly between devices.

## Testing

Run:

```bash
npm test
npm run check
```

Expected result at the time of this pass: `22/22` tests passing and
`npm run check` clean.

## 29/29 Note

A `29/29` count was previously reported, but visible current repo history
only supports the current `22/22` suite after this hardening pass. No
evidence was found that `29/29` came from this visible checkout.
