Skip to content

Commit bbef3b5

Browse files
committed
fix: security hardening + README improvements
Security: - OpenClaw config file permissions 0644 → 0600 (contains API key) - Windows OpenBrowser: use rundll32 instead of cmd /c start (prevent injection) - URL validation before opening browser - .gitignore: add .env, *.pem, *.key README: - Add Claude Code launch guide - Reorganize: Quick Start + How It Works with real terminal output - Add commands table with descriptions - Move Authorize Device image to repo (docs/images/) - Clarify OpenClaw-specific features (Telegram, gateway)
1 parent 01f9a86 commit bbef3b5

5 files changed

Lines changed: 102 additions & 202 deletions

File tree

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,8 @@ dist/
1414

1515
# Config (local testing)
1616
config.json
17+
18+
# Secrets
19+
.env
20+
*.pem
21+
*.key

README.md

Lines changed: 85 additions & 197 deletions
Original file line numberDiff line numberDiff line change
@@ -1,247 +1,143 @@
11
# hpphub
22

3-
HPP Hub CLI — connect [OpenClaw](https://openclaw.ai/) to [HPP Hub](https://hub.hpp.io) with a single command.
3+
HPP Hub CLI — connect AI tools to [HPP Hub](https://hub.hpp.io) with a single command.
44

55
```bash
6-
hpphub launch openclaw
6+
hpphub launch openclaw # OpenClaw (AI assistant)
7+
hpphub launch claude # Claude Code (coding agent)
78
```
89

9-
Like `ollama launch openclaw` connects OpenClaw to local models, `hpphub launch openclaw` connects OpenClaw to HPP's cloud models.
10-
1110
## Install
1211

13-
### One-line install (macOS / Linux)
14-
12+
**macOS / Linux:**
1513
```bash
1614
curl -fsSL https://raw.githubusercontent.com/hpp-io/hpphub-cli/main/install.sh | sudo bash
1715
```
1816

19-
This detects your OS and architecture, downloads the latest binary from [GitHub Releases](https://github.com/hpp-io/hpphub-cli/releases), and installs it to `/usr/local/bin/hpphub`.
20-
21-
### Windows (PowerShell)
22-
17+
**Windows (PowerShell):**
2318
```powershell
2419
irm https://raw.githubusercontent.com/hpp-io/hpphub-cli/main/install.ps1 | iex
2520
```
2621

27-
> **Note:** If you see an Execution Policy error, run this first:
28-
> ```powershell
29-
> Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
30-
> ```
31-
> After installation, **restart the terminal** for PATH to take effect.
32-
33-
On Windows, the OpenClaw gateway runs in foreground mode. Keep the terminal open while using Telegram/WhatsApp channels.
34-
35-
### Windows (WSL2) — Recommended
36-
37-
WSL2 provides the best experience on Windows (background gateway, full compatibility):
22+
> If you see an Execution Policy error, run `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` first.
23+
> After installation, restart the terminal for PATH to take effect.
3824
25+
**Windows (WSL2) — Recommended:**
3926
```bash
4027
curl -fsSL https://raw.githubusercontent.com/hpp-io/hpphub-cli/main/install.sh | sudo bash
4128
```
4229

43-
### Build from source (Go 1.24+)
44-
30+
**Build from source (Go 1.24+):**
4531
```bash
46-
git clone https://github.com/hpp-io/hpphub-cli.git
47-
cd hpphub-cli
32+
git clone https://github.com/hpp-io/hpphub-cli.git && cd hpphub-cli
4833
go build -o hpphub ./cmd/hpphub/
4934
```
5035

51-
## Getting Started
52-
53-
### For New Users (no HPP Hub account)
36+
## Quick Start
5437

55-
If you don't have an HPP Hub account yet, `hpphub` will guide you through the entire process:
38+
### OpenClaw — AI assistant on your messaging apps
5639

5740
```bash
58-
$ hpphub launch openclaw
41+
hpphub launch openclaw
5942
```
6043

61-
**Step 1 — OpenClaw Installation**
44+
### Claude Code — AI coding agent in your terminal
6245

63-
```
64-
Checking OpenClaw installation...
65-
✗ OpenClaw not found
66-
Install OpenClaw? (Y/n): Y
67-
Installing OpenClaw...
68-
✓ OpenClaw detected
46+
```bash
47+
hpphub launch claude
6948
```
7049

71-
If OpenClaw is already installed, this step is skipped automatically.
50+
Both commands handle everything automatically — install, login, configure, and start. Already logged in? It skips straight to setup.
7251

73-
> OpenClaw requires Node.js 22+. If Node.js is not installed, the OpenClaw installer will handle it.
52+
See [How It Works](#how-it-works) for the full flow.
7453

75-
**Step 2 — HPP Hub Login**
54+
## Commands
7655

77-
```
78-
Not logged in. Starting login flow...
79-
Your code: ABCD-1234
80-
Browser opened. Enter the code and authorize.
81-
Waiting for approval...
82-
```
56+
| Command | Description |
57+
|---------|-------------|
58+
| `hpphub launch openclaw` | Install + login + configure + start OpenClaw with HPP |
59+
| `hpphub launch openclaw --model <m>` | Same as above, with a specific model (skip selection prompt) |
60+
| `hpphub launch openclaw --config` | Update OpenClaw settings only (useful for changing model without restarting) |
61+
| `hpphub launch claude` | Install + login + launch Claude Code with HPP |
62+
| `hpphub login` | Log in to HPP Hub |
63+
| `hpphub logout` | Log out |
64+
| `hpphub whoami` | Show current login status |
65+
| `hpphub models` | List available models with pricing |
66+
| `hpphub setup telegram` | Connect a Telegram bot to OpenClaw |
67+
| `hpphub uninstall` | Remove hpphub and its configuration |
8368

84-
A browser window opens to `hub.hpp.io`. Since you don't have an account:
69+
## How It Works
8570

86-
1. Click **Sign in with Google** (or your preferred login method)
87-
2. Complete the sign-up process:
88-
- Agree to Terms of Service
89-
- A wallet and API credentials are automatically created for you
90-
3. After sign-up, you are redirected to the **Authorize Device** page
91-
4. Enter the code shown in your terminal (e.g., `ABCD-1234`)
92-
5. Click **Authorize**
71+
### OpenClaw — AI assistant on your messaging apps
9372

94-
![Authorize Device](https://github.com/user-attachments/assets/d7134077-5e1b-4cb9-b599-bca35dcd97f6)
73+
```bash
74+
$ hpphub launch openclaw
9575

96-
```
97-
✓ Logged in as you@example.com
98-
✓ API key saved: ...xxxx
76+
Checking OpenClaw installation...
77+
✓ OpenClaw detected # auto-installs if missing
78+
79+
Not logged in. Starting login flow...
80+
Your code: ABCD-1234 # enter this code in the browser
81+
Browser opened. Enter the code and authorize.
9982
```
10083

101-
**Step 3 — Model Selection**
84+
![Authorize Device](docs/images/authorize-device.png)
10285

10386
```
87+
✓ Logged in as you@example.com
88+
✓ API key saved
89+
10490
Available models:
10591
1. anthropic/claude-sonnet-4-6 ($3.00/$15.00 per M tokens)
10692
2. openai/gpt-5-mini ($0.25/$2.00 per M tokens)
107-
...
108-
Select model (number): 2
109-
```
110-
111-
Or skip with `--model`:
112-
113-
```bash
114-
hpphub launch openclaw --model openai/gpt-5-mini
115-
```
116-
117-
**Step 4 — Done**
93+
Select model (number): 2 # pick a model
11894
119-
```
12095
✓ HPP provider configured in OpenClaw
121-
✓ OpenClaw gateway running
122-
123-
You're all set! Send a message via Telegram, WhatsApp, or other connected channels.
124-
```
125-
126-
### For Existing Users (already have an HPP Hub account)
127-
128-
```bash
129-
$ hpphub launch openclaw
96+
✓ OpenClaw gateway running # ready to use
13097
```
13198

132-
The flow is the same, but faster — no sign-up needed:
133-
134-
1. Browser opens → log in with your existing account
135-
2. Enter the code → Authorize
136-
3. Your existing API key is reused (no duplicate keys)
137-
4. Select a model → OpenClaw configured and running
99+
Now send a message to your bot on Telegram, WhatsApp, or Slack — it responds using your chosen HPP model.
138100

139-
If you've already run `hpphub launch openclaw` before, your login and API key are cached in `~/.hpphub/config.json`. Running the command again will skip login and go straight to configuration.
101+
### Claude Code — AI coding agent in your terminal
140102

141-
## Commands
103+
First time (not logged in yet):
142104

143105
```bash
144-
hpphub launch openclaw # Full setup: install → login → configure → start
145-
hpphub launch openclaw --config # Configure only, don't start gateway
146-
hpphub launch openclaw --model <m> # Use a specific model
147-
148-
hpphub login # Log in to HPP Hub
149-
hpphub logout # Log out
150-
hpphub whoami # Show current login status
151-
152-
hpphub models # List available models with pricing
153-
154-
hpphub setup telegram # Set up Telegram bot connection
106+
$ hpphub launch claude
155107

156-
hpphub uninstall # Remove hpphub and its configuration
157-
```
158-
159-
## Available Models
108+
Checking Claude Code installation...
109+
✓ Claude Code detected # auto-installs if missing
160110

161-
After login, `hpphub models` shows all available models:
162-
163-
```
164-
PROVIDER MODEL INPUT OUTPUT
165-
──────────────────────────────────────────────────────────────────────────────
166-
anthropic anthropic/claude-sonnet-4-6 $3.00/M $15.00/M
167-
openai openai/gpt-5-mini $0.15/M $0.60/M
168-
openai openai/gpt-5 $1.25/M $10.00/M
169-
...
170-
```
171-
172-
## How It Works
173-
174-
```
175-
hpphub launch openclaw
176-
177-
├─ OpenClaw installed? → detect or auto-install
178-
├─ Logged in? → Device Code Flow (browser-based)
179-
├─ API key? → auto-create on login
180-
├─ Model? → interactive selection or --model flag
181-
├─ Configure OpenClaw → inject HPP provider into ~/.openclaw/openclaw.json
182-
└─ Start gateway → openclaw gateway start
183-
```
111+
Not logged in. Starting login flow...
112+
Your code: WXYZ-5678 # same Device Code Flow as OpenClaw
113+
Browser opened. Enter the code and authorize.
114+
✓ Logged in as you@example.com
115+
✓ API key saved
116+
✓ Model: claude-sonnet-4-6
184117

185-
After setup, OpenClaw routes messages through HPP:
118+
Starting Claude Code with HPP...
186119

120+
$ claude > # Claude Code prompt, powered by HPP
187121
```
188-
Telegram/WhatsApp/Slack → OpenClaw → HPP Hub (router.hpp.io) → LLM → response
189-
```
190-
191-
## Authentication
192122

193-
`hpphub login` uses [Device Code Flow (RFC 8628)](https://datatracker.ietf.org/doc/html/rfc8628):
123+
Already logged in (via any previous `hpphub` command):
194124

195125
```bash
196-
$ hpphub login
197-
Your code: ABCD-1234
198-
Browser opened. Enter the code and authorize.
199-
Waiting for approval...
200-
✓ Logged in as user@example.com
201-
✓ API key saved: ...a3f2
202-
```
203-
204-
Works in all environments including WSL and SSH sessions.
126+
$ hpphub launch claude
205127

206-
Credentials are stored in `~/.hpphub/config.json`.
128+
Checking Claude Code installation...
129+
✓ Claude Code detected
130+
✓ Logged in as you@example.com # login skipped
131+
✓ Model: claude-sonnet-4-6
207132

208-
## Configuration
209-
210-
### CLI config
211-
212-
Stored at `~/.hpphub/config.json` after login:
133+
Starting Claude Code with HPP...
213134

214-
```json
215-
{
216-
"api_key": "hpph_...",
217-
"base_url": "https://router.hpp.io/llm/v1",
218-
"email": "user@example.com"
219-
}
220-
```
221-
222-
### OpenClaw config
223-
224-
`hpphub launch openclaw` adds HPP as a provider in `~/.openclaw/openclaw.json`:
225-
226-
```json
227-
{
228-
"models": {
229-
"mode": "merge",
230-
"providers": {
231-
"hpp": {
232-
"baseUrl": "https://router.hpp.io/llm/v1",
233-
"apiKey": "hpph_...",
234-
"api": "openai-completions",
235-
"models": [...]
236-
}
237-
}
238-
}
239-
}
135+
$ claude >
240136
```
241137

242-
## After Setup
138+
## OpenClaw — Telegram Setup
243139

244-
### Connect Telegram
140+
After `hpphub launch openclaw`, connect a Telegram bot:
245141

246142
```bash
247143
$ hpphub setup telegram
@@ -262,37 +158,29 @@ $ hpphub setup telegram
262158
✓ Telegram bot connected!
263159
```
264160

265-
Send a message to your bot in Telegram — it should respond using HPP models.
266-
267-
### Connect Other Channels
268-
161+
Other channels (WhatsApp, Discord, Slack, etc.):
269162
```bash
270-
# Interactive setup for WhatsApp, Discord, Slack, Signal, etc.
271163
openclaw configure --section channels
272164
```
273165

274-
### Change Model
166+
## Configuration
275167

276-
```bash
277-
hpphub launch openclaw --config --model anthropic/claude-sonnet-4-6
168+
**CLI config**`~/.hpphub/config.json`:
169+
```json
170+
{
171+
"api_key": "hpph_...",
172+
"base_url": "https://router.hpp.io/llm/v1",
173+
"email": "user@example.com"
174+
}
278175
```
279176

280-
### Manage
281-
282-
```bash
283-
# Check gateway status
284-
openclaw health
285-
286-
# Stop the gateway
287-
openclaw gateway stop
177+
**OpenClaw config**`~/.openclaw/openclaw.json` (auto-generated by `hpphub launch openclaw`)
288178

289-
# View logs
290-
tail -f ~/.openclaw/logs/gateway.log
179+
## Windows Notes
291180

292-
# Re-login with a different account
293-
hpphub logout
294-
hpphub login
295-
```
181+
- **Gateway**: Runs in foreground on Windows native. Keep the terminal open for Telegram/WhatsApp. WSL2 supports background mode.
182+
- **Execution Policy**: May need `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` before install.
183+
- **Terminal restart**: Required after install for PATH to take effect.
296184

297185
## License
298186

docs/images/authorize-device.png

172 KB
Loading

0 commit comments

Comments
 (0)