fuzzi-cli 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,92 +1,121 @@
1
1
  # Fuzzi CLI
2
2
 
3
- Node.js/TypeScript command-line tool for running Fuzzi security scans without a browser. Supports an interactive shell (`fuzzi`) and direct commands for CI/CD (`fuzzi scan <url>`).
4
-
5
- ## Install
3
+ Run Fuzzi security scans from your terminal. Interactive shell for daily use, scriptable commands for CI.
6
4
 
7
5
  ```bash
8
6
  npm install -g fuzzi-cli
9
- # or zero-install
10
- npx fuzzi-cli@latest scan https://example.com
7
+ fuzzi
11
8
  ```
12
9
 
13
- ## Quick start
10
+ ---
14
11
 
15
- 1. Generate an API key at [app.fuzzi.dev/settings/api-keys](https://app.fuzzi.dev/settings/api-keys)
16
- 2. Log in:
12
+ ## First run (30 seconds)
17
13
 
18
- ```bash
19
- fuzzi auth login
14
+ 1. **Install** the CLI (above)
15
+ 2. **Run** `fuzzi`
16
+ 3. You'll see **Sign in to continue** — press **Enter**
17
+ 4. Your **browser opens** to app.fuzzi.dev — log in or sign up
18
+ 5. After authorizing, return to the terminal — you're in
19
+
20
+ ```
21
+ › /scan example.com # scan a site (https:// added automatically)
22
+ › /scans # browse past scans
23
+ › /help # all commands
24
+ › /palette # search commands
20
25
  ```
21
26
 
22
- 3. Run a scan:
27
+ No browser? Use **`/auth-key`** to paste an API key from [Settings → API Keys](https://app.fuzzi.dev/settings/api-keys).
23
28
 
24
- ```bash
25
- fuzzi scan https://example.com
26
- ```
29
+ ---
27
30
 
28
- ## Two modes
31
+ ## Two ways to use it
29
32
 
30
- | Invocation | Behavior |
31
- |------------|----------|
32
- | `fuzzi` | Interactive home screen + `>` slash-command REPL |
33
- | `fuzzi scan <url>` | One-shot command, exits (CI/scripting) |
33
+ | You want… | Do this |
34
+ |-----------|---------|
35
+ | Explore scans interactively | `fuzzi` (opens the shell) |
36
+ | One command in CI / a script | `fuzzi scan <url> --fail-on critical` |
34
37
 
35
- ### Interactive slash commands
38
+ ---
36
39
 
37
- ```
38
- /scan <url> Run scan with live progress
39
- /scans Browse recent scans
40
- /status Auth status & rate limits
41
- /keys View/revoke API keys
42
- /config k=v Set local config
43
- /changelog Release notes
44
- /help All commands
45
- /exit Leave the shell
46
- ```
40
+ ## Interactive shell
47
41
 
48
- ### Direct commands
42
+ Slash commands (type at the `›` prompt):
49
43
 
50
- ```bash
51
- fuzzi scan <url> [--title] [--env production|staging|development] [--wait] [--no-wait] [--format table|json|markdown] [--fail-on low|medium|high|critical] [--fail-threshold 0.0-1.0]
52
- fuzzi scans list [--status] [--risk-level] [--limit 20] [--format table|json]
53
- fuzzi scans get <scan-id> [--format table|json|markdown]
54
- fuzzi report <scan-id> --format pdf|csv|json [--output ./path]
55
- fuzzi whatif <scan-id> --set dimension=value [--format json]
56
- fuzzi compare <scan-a> <scan-b> [--format table|json]
57
- fuzzi auth login [--api-key] | logout | status
58
- fuzzi config get [key] | set <key> <value> | list
59
- fuzzi --version
60
- fuzzi --help
61
- ```
44
+ | Command | What it does |
45
+ |---------|----------------|
46
+ | `/scan <url>` | Run a scan, show live progress |
47
+ | `/scans` | Browse recent scans |
48
+ | `/status` | Account, API key expiry, rate limits |
49
+ | `/keys` | List / revoke / create API keys |
50
+ | `/auth` | Sign in via browser again |
51
+ | `/auth-key` | Paste an API key manually |
52
+ | `/config key=value` | Set CLI defaults |
53
+ | `/palette` | Fuzzy-search all commands |
54
+ | `/help` | Command reference |
55
+ | `/exit` | Quit |
62
56
 
63
- ## CI exit codes
57
+ **Tips**
64
58
 
65
- | Code | Meaning |
66
- |------|---------|
67
- | 0 | Success; scan risk below `--fail-on` threshold |
68
- | 1 | Scan succeeded but risk meets/exceeds `--fail-on` |
69
- | 2 | Command failed (network, auth, invalid URL, etc.) |
59
+ - **Tab** completes command names
60
+ - Bare domains work: `/scan netflix.com` → `https://netflix.com`
61
+ - `auth login` and `fuzzi auth login` are rewritten to `/auth` in the shell
62
+
63
+ ---
64
+
65
+ ## Scriptable commands (CI & automation)
70
66
 
71
67
  ```bash
72
- fuzzi scan https://staging.example.com --fail-on critical
73
- # exit 0 = risk < CRITICAL
74
- # exit 1 = risk >= CRITICAL (intentional gate)
75
- # exit 2 = scan error
76
- ```
68
+ # Scan and wait for result (default)
69
+ fuzzi scan https://staging.example.com
77
70
 
78
- ## Configuration
71
+ # Fail CI if risk is HIGH or above
72
+ fuzzi scan https://staging.example.com --fail-on high
79
73
 
80
- **Credentials:** `~/.fuzzi/credentials` (mode 600)
74
+ # JSON for pipelines
75
+ fuzzi scan https://example.com --format json
76
+
77
+ # Machine-readable exit codes
78
+ # 0 = success, risk below threshold
79
+ # 1 = scan done, risk at/above --fail-on
80
+ # 2 = error (network, auth, bad URL)
81
+ ```
81
82
 
82
- **CLI config:** `~/.fuzzi/config`
83
+ ### All commands
83
84
 
84
85
  ```bash
85
- fuzzi config set default_env staging
86
- fuzzi config set default_format markdown
86
+ fuzzi auth login # browser sign-in (default)
87
+ fuzzi auth login --api-key # paste key non-interactively
88
+ fuzzi auth status
89
+ fuzzi auth logout
90
+
91
+ fuzzi scan <url> [--wait] [--no-wait] [--format table|json|markdown]
92
+ [--env production|staging|development]
93
+ [--fail-on low|medium|high|critical]
94
+ [--fail-threshold 0.0-1.0]
95
+
96
+ fuzzi scans list [--status] [--risk-level] [--limit 20]
97
+ fuzzi scans get <scan-id> [--format table|json|markdown]
98
+ fuzzi report <scan-id> --format pdf|csv|json [-o file]
99
+ fuzzi whatif <scan-id> --set dimension=0.5
100
+ fuzzi compare <scan-a> <scan-b>
101
+
102
+ fuzzi config list | get [key] | set <key> <value>
103
+ fuzzi status
104
+ fuzzi --help
87
105
  ```
88
106
 
89
- **Project config:** `.fuzzirc` (JSON) or `fuzzi.toml` in the working directory:
107
+ ---
108
+
109
+ ## Configuration
110
+
111
+ | File | Purpose |
112
+ |------|---------|
113
+ | `~/.fuzzi/credentials` | API key (mode 600) |
114
+ | `~/.fuzzi/config` | CLI defaults (`default_env`, `default_format`) |
115
+ | `~/.fuzzi/history` | Shell command history |
116
+ | `.fuzzirc` or `fuzzi.toml` | Project defaults in repo root |
117
+
118
+ **Example `.fuzzirc`:**
90
119
 
91
120
  ```json
92
121
  {
@@ -95,29 +124,71 @@ fuzzi config set default_format markdown
95
124
  "environment": "staging",
96
125
  "fail_on": "high"
97
126
  },
98
- "output": {
99
- "format": "markdown"
100
- }
127
+ "output": { "format": "markdown" }
101
128
  }
102
129
  ```
103
130
 
104
- CLI flags override project config values.
131
+ Flags on the command line override file values.
132
+
133
+ ```bash
134
+ fuzzi config set default_env staging
135
+ fuzzi config set default_format markdown
136
+ export FUZZI_API_URL=https://app.fuzzi.dev/api # override API
137
+ export FUZZI_DEBUG=1 # debug logging
138
+ ```
139
+
140
+ ---
141
+
142
+ ## CI example (GitHub Actions)
143
+
144
+ ```yaml
145
+ - name: Fuzzi security gate
146
+ run: |
147
+ npm install -g fuzzi-cli
148
+ fuzzi auth login --api-key "${{ secrets.FUZZI_API_KEY }}"
149
+ fuzzi scan https://staging.example.com --fail-on critical --format markdown
150
+ ```
151
+
152
+ ---
153
+
154
+ ## For web / frontend developers
155
+
156
+ The CLI browser login flow requires pages and API routes on **app.fuzzi.dev**.
157
+
158
+ See **[docs/frontend-integration.md](./docs/frontend-integration.md)** for:
159
+
160
+ - `/cli-auth` page spec
161
+ - `POST /api/cli/handoff` contract
162
+ - API keys settings UI
163
+ - Full feature parity checklist
164
+
165
+ ---
105
166
 
106
167
  ## Development
107
168
 
108
169
  ```bash
170
+ git clone <repo>
171
+ cd fuzzi-cli
109
172
  npm install
110
- npm run build
111
173
  npm test
112
- npm link # optional global `fuzzi` command
174
+ npm run build
175
+ npm link # optional: global `fuzzi` command
113
176
  ```
114
177
 
115
- ## Brand
178
+ ---
116
179
 
117
- - Accent: `#4FC3A1` (teal)
118
- - Risk colors: LOW green, MEDIUM amber, HIGH red, CRITICAL purple
180
+ ## Publish to npm
119
181
 
120
- ## v2 (not yet)
182
+ ```bash
183
+ npm login
184
+ npm publish --access public
185
+ ```
186
+
187
+ Or tag `v0.1.0` and let GitHub Actions publish (requires `NPM_TOKEN` secret).
188
+
189
+ ---
121
190
 
122
- - Browser login (`fuzzi auth login --browser`)
123
- - GitHub Action wrapper
191
+ ## Brand
192
+
193
+ - Accent: `#4FC3A1` (teal)
194
+ - Risk: LOW green · MEDIUM amber · HIGH red · CRITICAL purple
@@ -1,4 +1,14 @@
1
1
  [
2
+ {
3
+ "version": "0.1.1",
4
+ "date": "2026-06-19",
5
+ "highlights": [
6
+ "Browser sign-in on startup — press Enter to open app.fuzzi.dev",
7
+ "Full-width terminal UI and command palette",
8
+ "/auth-key fallback for API key paste",
9
+ "Frontend integration docs for web team"
10
+ ]
11
+ },
2
12
  {
3
13
  "version": "0.1.0",
4
14
  "date": "2026-06-19",