@quireco/cli 0.0.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.
Files changed (2) hide show
  1. package/README.md +152 -0
  2. package/package.json +73 -0
package/README.md ADDED
@@ -0,0 +1,152 @@
1
+ # Quire CLI
2
+
3
+ The local `quire` command for Quire authentication and investigations.
4
+
5
+ ## Development
6
+
7
+ - Install dependencies:
8
+
9
+ ```bash
10
+ vp install
11
+ ```
12
+
13
+ - Run the unit tests:
14
+
15
+ ```bash
16
+ vp test
17
+ ```
18
+
19
+ - Build the library:
20
+
21
+ ```bash
22
+ vp pack
23
+ ```
24
+
25
+ - Run the built CLI after building:
26
+
27
+ ```bash
28
+ node dist/quire.mjs --help
29
+ ```
30
+
31
+ ## Workspace target (`quire env`)
32
+
33
+ `quire env` manages the `.quire/environment.json` file that tells Quire what application to investigate. Configure the target once, then `investigate` will pick it up automatically:
34
+
35
+ ```bash
36
+ quire env init --web --base-url http://localhost:3000 # scaffold a web target
37
+ quire env init --mobile --ios # scaffold a mobile target
38
+ quire env # print the resolved target
39
+ quire env --json # machine-readable form
40
+
41
+ quire env set platform=ios provider=local appId=com.example.app
42
+ quire env set kind=mobile platform=android # switch web → mobile
43
+ quire env unset device
44
+ ```
45
+
46
+ `set` accepts one or more `key=value` pairs and validates the result against the schema before writing. Valid keys depend on `kind`:
47
+
48
+ - **Web**: `baseUrl`
49
+ - **Mobile**: `platform` (`ios`/`android`), `provider`, `device`, `appiumUrl`, `url`, `appId`, `appPath`
50
+
51
+ Setting `kind=mobile` (or `kind=web`) switches the union shape and drops incompatible fields. Use `quire env init --force` to start over from a stub.
52
+
53
+ ## Doctor
54
+
55
+ `quire doctor` diagnoses the current setup before you start an investigation. It checks identity (auth + model broker), workspace (`.quire/environment.json` + target reachability), and run state (runs root writable, no stuck runs):
56
+
57
+ ```bash
58
+ quire doctor # human-readable report, grouped by section
59
+ quire doctor --json # structured report for agents/CI
60
+ quire doctor --strict # exit non-zero on warnings as well as failures
61
+ ```
62
+
63
+ Each check has a stable `id` (e.g. `auth.present`, `target.web.reachable`, `target.mobile.device`) so coding agents can act on specific failures without parsing prose. Failing checks include a `fix.command` you can run to resolve them. Exit code is `0` when all checks pass (or only warnings in non-strict mode) and `1` otherwise.
64
+
65
+ Target reachability runs by default: web environments are probed with a HEAD request, iOS local environments check `xcrun simctl list devices booted`, Android local checks `adb devices`, and Appium providers ping `/status`.
66
+
67
+ ## Investigations
68
+
69
+ The primary interface is text-in, durable-run-handle-out. `investigate` starts a background run and returns immediately so coding agents do not need to keep a subprocess open for long investigations:
70
+
71
+ ```bash
72
+ quire investigate "Reproduce the checkout crash" --json
73
+ cat issue.md | quire investigate --stdin --json
74
+ quire report <run-id> --wait --json
75
+ ```
76
+
77
+ `investigate` carries a deliberately small flag surface — everything that describes the target (platform, provider, device, app id, etc.) lives in `.quire/environment.json` via `quire env`. The run-level flags are:
78
+
79
+ - `--stdin` reads plain-text investigation context from stdin. If a positional prompt is also present, stdin is treated as additional context.
80
+ - `--json` reserves stdout for the started run handle JSON only.
81
+ - `--watch` attaches to the live run log after starting the investigation. Ctrl-C detaches.
82
+ - `--headed` shows the browser window for web targets.
83
+ - `--url <url>` overrides the configured web `baseUrl` for one run.
84
+ - `--no-sync` keeps an authenticated run local instead of uploading it to the Quire web app. Default behavior syncs evidence-tier artifacts.
85
+
86
+ Top-level shortcuts mirror the most common run subcommands:
87
+
88
+ ```bash
89
+ quire watch <run-id> # alias for `quire runs watch`
90
+ quire report <run-id> # alias for `quire runs report`
91
+ ```
92
+
93
+ Less common run operations stay under the canonical `runs` namespace: `quire runs status|cancel|list|sync ...`.
94
+
95
+ Each run writes `metadata.json`, `report.json`, and raw `emit-report.json` under `~/.quire/runs/<workspace-key>/<run-id>/` by default. Set `QUIRE_RUNS_DIR` to override the run-artifact root.
96
+
97
+ Local investigations run the Pi agent loop on your machine. Quire prefers local Pi/OpenAI Codex provider auth when it is configured, then falls back to Quire Credits through Quire's authenticated broker. Quire-owned provider auth is read from `~/.quire/model-auth.json` by default, with compatibility fallback to Pi's existing auth file. Set `QUIRE_MODEL_AUTH_PATH` to override the Quire-owned model auth file. `quire login` associates local runs with your Quire account for identity, wallet access, run upload, and future hosted workflows; personal model-provider auth remains a separate local-provider concern.
98
+
99
+ ## Hosted Model-Source Status
100
+
101
+ Use `quire whoami --json` to check the authenticated account and hosted model-source status before relying on remote Quire Credits behavior:
102
+
103
+ ```json
104
+ {
105
+ "authenticated": true,
106
+ "user": { "id": "user_123", "email": "alice@example.com" },
107
+ "modelSourceBroker": {
108
+ "available": true,
109
+ "status": "available",
110
+ "selectedProviderMode": "quire_wallet",
111
+ "selectedOrder": ["quire_wallet"],
112
+ "reason": "wallet_available",
113
+ "requiredNextAction": null,
114
+ "requiredBalance": 1,
115
+ "remainingBalance": 100,
116
+ "recentUsage": [
117
+ {
118
+ "modelId": "gpt-4.1-mini",
119
+ "status": "succeeded",
120
+ "totalTokens": 13,
121
+ "runId": "run_123",
122
+ "createdAt": "2026-05-18T06:00:00.000Z"
123
+ }
124
+ ]
125
+ }
126
+ }
127
+ ```
128
+
129
+ The hosted status is a redacted summary from Quire's server-side model-source API. It does not include provider credentials, sealed envelopes, raw tokens, prompts, or completions. Local `quire investigate` can use local Pi/OpenAI auth when configured; Quire Credits and hosted/Slack-triggered execution use Quire-managed billing.
130
+
131
+ Example web environment (write with `quire env init --web` and edit via `quire env set`):
132
+
133
+ ```json
134
+ {
135
+ "version": 1,
136
+ "app": { "kind": "web", "baseUrl": "http://localhost:3000" }
137
+ }
138
+ ```
139
+
140
+ Example mobile environment:
141
+
142
+ ```json
143
+ {
144
+ "version": 1,
145
+ "app": {
146
+ "kind": "mobile",
147
+ "platform": "ios",
148
+ "provider": "local",
149
+ "appId": "com.example.app"
150
+ }
151
+ }
152
+ ```
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@quireco/cli",
3
+ "version": "0.0.1",
4
+ "description": "Triage and investigation CLI for Quire.",
5
+ "homepage": "https://github.com/quireco/quire-mono#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/quireco/quire-mono/issues"
8
+ },
9
+ "license": "MIT",
10
+ "author": "Quire",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/quireco/quire-mono.git",
14
+ "directory": "apps/cli"
15
+ },
16
+ "bin": {
17
+ "quire": "./dist/quire.mjs"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "type": "module",
23
+ "exports": {
24
+ ".": "./dist/index.mjs",
25
+ "./quire": "./dist/quire.mjs",
26
+ "./package.json": "./package.json"
27
+ },
28
+ "publishConfig": {
29
+ "access": "public"
30
+ },
31
+ "scripts": {
32
+ "build": "vp pack && node scripts/prepare-package-json.mjs",
33
+ "dev": "vp pack --watch",
34
+ "quire": "node dist/quire.mjs",
35
+ "test": "vp test",
36
+ "check": "vp check",
37
+ "prepublishOnly": "vp run build"
38
+ },
39
+ "dependencies": {
40
+ "@mariozechner/pi-ai": "^0.73.0",
41
+ "@mariozechner/pi-coding-agent": "^0.73.0",
42
+ "@sinclair/typebox": "^0.34.49",
43
+ "citty": "^0.2.2"
44
+ },
45
+ "devDependencies": {
46
+ "@types/node": "^25.6.2",
47
+ "@typescript/native-preview": "7.0.0-dev.20260509.2",
48
+ "agent-mobile": "workspace:*",
49
+ "bumpp": "^11.1.0",
50
+ "typescript": "^6.0.3",
51
+ "vite-plus": "^0.1.20"
52
+ },
53
+ "inlinedDependencies": {
54
+ "@limrun/api": "0.28.6",
55
+ "@nodable/entities": "2.1.0",
56
+ "agent-base": "7.1.4",
57
+ "debug": "4.4.3",
58
+ "eventsource-client": "1.2.0",
59
+ "eventsource-parser": "3.0.8",
60
+ "fast-xml-parser": "5.7.3",
61
+ "has-flag": "4.0.0",
62
+ "https-proxy-agent": "7.0.6",
63
+ "ignore": "7.0.5",
64
+ "ms": "2.1.3",
65
+ "path-expression-matcher": "1.5.0",
66
+ "proxy-from-env": "2.1.0",
67
+ "strnum": "2.3.0",
68
+ "supports-color": "7.2.0",
69
+ "undici": "7.24.7",
70
+ "ws": "8.20.0",
71
+ "xdelta3-wasm": "1.0.0"
72
+ }
73
+ }