nexusquant-cli 0.2.0__tar.gz → 0.2.1__tar.gz

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 (26) hide show
  1. nexusquant_cli-0.2.1/PKG-INFO +269 -0
  2. nexusquant_cli-0.2.1/README.md +257 -0
  3. nexusquant_cli-0.2.1/nexusquant_cli/__init__.py +1 -0
  4. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/pyproject.toml +1 -1
  5. nexusquant_cli-0.2.0/PKG-INFO +0 -139
  6. nexusquant_cli-0.2.0/README.md +0 -127
  7. nexusquant_cli-0.2.0/dist_archive/nexusquant_cli-0.1.1-py3-none-any.whl +0 -0
  8. nexusquant_cli-0.2.0/dist_archive/nexusquant_cli-0.1.1.tar.gz +0 -0
  9. nexusquant_cli-0.2.0/dist_archive/nexusquant_cli-0.1.2-py3-none-any.whl +0 -0
  10. nexusquant_cli-0.2.0/dist_archive/nexusquant_cli-0.1.2.tar.gz +0 -0
  11. nexusquant_cli-0.2.0/nexusquant_cli/__init__.py +0 -1
  12. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/.gitignore +0 -0
  13. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/CLAUDE.md +0 -0
  14. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/__main__.py +0 -0
  15. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/api_client.py +0 -0
  16. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/auth_pkce.py +0 -0
  17. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/commands/__init__.py +0 -0
  18. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/commands/_util.py +0 -0
  19. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/commands/auth/__init__.py +0 -0
  20. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/commands/auth/cmd.py +0 -0
  21. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/commands/policy/__init__.py +0 -0
  22. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/commands/policy/cmd.py +0 -0
  23. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/commands/strategy/__init__.py +0 -0
  24. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/commands/strategy/cmd.py +0 -0
  25. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/config.py +0 -0
  26. {nexusquant_cli-0.2.0 → nexusquant_cli-0.2.1}/nexusquant_cli/main.py +0 -0
@@ -0,0 +1,269 @@
1
+ Metadata-Version: 2.5
2
+ Name: nexusquant-cli
3
+ Version: 0.2.1
4
+ Summary: NexusQuant strategy provider CLI
5
+ Requires-Python: >=3.10
6
+ Requires-Dist: httpx>=0.27
7
+ Requires-Dist: nexusquant-sdk>=0.2
8
+ Requires-Dist: platformdirs>=4.2
9
+ Requires-Dist: rich>=13.7
10
+ Requires-Dist: typer>=0.12
11
+ Description-Content-Type: text/markdown
12
+
13
+ # nexusquant-cli
14
+
15
+ Command line tool for NexusQuant strategy providers.
16
+
17
+ It supports browser login through Cognito, stores tokens locally, refreshes tokens, and calls the Nexus strategy provider APIs. Provider commands require a Cognito user with `custom:userType=strategyProvider` or `custom:userType=admin`.
18
+
19
+ ## Install
20
+
21
+ ```bash
22
+ python3 -m pip install -e .
23
+ ```
24
+
25
+ ```bash
26
+ pip install nexusquant-cli
27
+ ```
28
+
29
+ ## Login
30
+
31
+ ```bash
32
+ nexusquant auth
33
+ nexusquant auth --status
34
+ nexusquant auth --refresh
35
+ nexusquant auth --logout
36
+ ```
37
+
38
+ Tokens are stored in the current OS user's config directory, for example `~/Library/Application Support/nexusquant-cli/credentials.json` on macOS. The file is written with `0600` permissions when supported.
39
+
40
+ ## Strategy Commands
41
+
42
+ Create or update a strategy:
43
+
44
+ ```bash
45
+ nexusquant strategy create \
46
+ --strategy-id my_alpha_001 \
47
+ --name "My Alpha" \
48
+ --schema-file schema.json \
49
+ --output-unit SHARE_COUNT
50
+ ```
51
+
52
+ List strategies registered by the current provider. Admin users see all strategies:
53
+
54
+ ```bash
55
+ nexusquant strategy list
56
+ ```
57
+
58
+ List signal history for one strategy:
59
+
60
+ ```bash
61
+ nexusquant strategy signal my_alpha_001 --history --limit 20
62
+ ```
63
+
64
+ Send a single signal:
65
+
66
+ ```bash
67
+ nexusquant strategy signal my_alpha_001 \
68
+ --strategy-name "My Alpha" \
69
+ --ticker AAPL \
70
+ --direction buy \
71
+ --price 150.25 \
72
+ --quantity 100 \
73
+ --order-type MARKET
74
+ ```
75
+
76
+ `--order-type` is a signal-level setting: `MARKET` or `LIMIT` (limit uses `--price`). Legacy `NORMAL` is accepted by the CLI as an alias for `LIMIT`. If omitted, the API defaults to `MARKET`.
77
+
78
+ Send a multi-route `signals` map:
79
+
80
+ ```bash
81
+ nexusquant strategy signal my_alpha_001 \
82
+ --strategy-name "My Alpha" \
83
+ --signals-file signals.json
84
+ ```
85
+
86
+ Get non-PII subscriber config for a strategy:
87
+
88
+ ```bash
89
+ nexusquant strategy sub config my_alpha_001
90
+ ```
91
+
92
+ ## Policy Commands
93
+
94
+ A SizingPolicy replaces the fixed `--quantity` on a signal with a **formula** that
95
+ decides the order quantity — and optionally a limit price — at order time. You
96
+ publish the formula once; each signal then carries only the parameter values it
97
+ needs. Values that depend on the individual subscriber's account are never sent by
98
+ you: they are bound inside that user's own container when the order is placed.
99
+
100
+ Requires `custom:userType=strategyProvider` or `admin`, the same as the strategy
101
+ commands.
102
+
103
+ ### See which names a formula may use
104
+
105
+ The server registry is the authority — a name outside it cannot be published. Run
106
+ this before writing a formula:
107
+
108
+ ```bash
109
+ nexusquant policy features
110
+ nexusquant policy features --scope shared # names you send with each signal
111
+ nexusquant policy features --scope account # names bound in the user's container
112
+ nexusquant policy features --json # raw output for scripting
113
+ ```
114
+
115
+ Account-scoped names carry a "suppliable" flag: a name that exists but that the
116
+ container cannot currently supply will pass your editor and fail at publish.
117
+
118
+ ### Publish a formula
119
+
120
+ ```bash
121
+ nexusquant policy publish --strategy-id my_alpha --ticker TQQQ --file tqqq.json
122
+ nexusquant policy publish --strategy-id my_alpha --ticker TQQQ --file tqqq.json --profile normal
123
+ ```
124
+
125
+ `--file` holds the two things a policy is made of — the formulas keyed by output
126
+ slot, and the names you promise to supply with every signal:
127
+
128
+ ```json
129
+ {
130
+ "expr": {
131
+ "f_depth": "exp(-k_depth * depth / 10)",
132
+ "buy.quantity": "target_shares * f_depth * clamp(1 - pos_ratio, 0, 1)",
133
+ "buy.price": "ref_price * (1 - slip)",
134
+ "sell.quantity": "held_shares * exit_frac"
135
+ },
136
+ "params": ["target_shares", "k_depth", "depth", "ref_price", "slip", "exit_frac"]
137
+ }
138
+ ```
139
+
140
+ Output slots — the container picks the one matching the signal's direction:
141
+
142
+ | Slot | What the formula yields |
143
+ |---|---|
144
+ | `buy.quantity` / `sell.quantity` | **Share count** (floored) |
145
+ | `buy.price` / `sell.price` | **Limit price** — supplied ⇒ limit order, omitted ⇒ market order |
146
+
147
+ Intermediate names (`f_depth`) are fine, but an `expr` must define at least one
148
+ output slot, and an intermediate name may not contain a dot. `--ticker` is separate
149
+ from the file because it is not part of the artifact: the same formula pointed at
150
+ another symbol is the same formula.
151
+
152
+ ⚠️ **`publish` IS the go-live action.** There is no shadow or canary step, and the
153
+ previous version on the same slot is deactivated. `--profile` defaults to `normal`.
154
+
155
+ Before sending anything, the CLI fetches the registry and checks locally that every
156
+ free name in your formula has someone to supply it — forgetting to list a name in
157
+ `params` is the most common mistake. `--skip-name-check` disables that fetch, and
158
+ then local success does not imply the server will accept.
159
+
160
+ ### List and stop
161
+
162
+ ```bash
163
+ nexusquant policy list my_alpha
164
+ nexusquant policy list my_alpha --ticker TQQQ --mode active # --mode active / off
165
+
166
+ # Emergency stop for a live version — not a promotion step, since publish already went live
167
+ nexusquant policy set-mode --policy-id 'TQQQ/normal/…/abc123' --mode off
168
+ nexusquant policy set-mode --policy-id 'TQQQ/normal/…/abc123' --mode active
169
+ ```
170
+
171
+ ### Send a signal against a policy
172
+
173
+ Every declared parameter must be present, or the signal is rejected:
174
+
175
+ ```bash
176
+ nexusquant policy send-signal \
177
+ --strategy-id my_alpha --ticker TQQQ --price 51.2 --direction buy \
178
+ -p target_shares=10 -p k_depth=0.5 -p depth=3 \
179
+ -p ref_price=51.2 -p slip=0.002 -p exit_frac=0.25
180
+
181
+ # Or pass all parameter values as a JSON object
182
+ nexusquant policy send-signal --strategy-id my_alpha --ticker TQQQ \
183
+ --price 51.2 --direction buy --params-file params.json
184
+
185
+ # Validate and print the payload without sending it
186
+ nexusquant policy send-signal ... --dry-run
187
+ ```
188
+
189
+ | Flag | Meaning |
190
+ |---|---|
191
+ | `--param` / `-p` | One parameter value, `name=value`; repeat per declared name |
192
+ | `--params-file` | A JSON object with all parameter values instead |
193
+ | `--policy-id` | Defaults to the active policy on this `(strategy, ticker)` |
194
+ | `--quantity` | Used when the formula has no slot for this direction |
195
+ | `--order-type` | `MARKET` / `LIMIT` |
196
+ | `--strategy-name` | Defaults to the strategy id |
197
+ | `--no-fetch` | Skip fetching the policy — see below |
198
+ | `--dry-run` | Validate and print the payload, send nothing |
199
+
200
+ By default the CLI fetches the active policy first and uses it to validate and
201
+ coerce your values. Three checks, each mirroring the server:
202
+
203
+ | Situation | Result | Why not something else |
204
+ |---|---|---|
205
+ | A declared parameter is missing | Error | No defaults — a default turns "unknown" into "known" |
206
+ | A name you did not declare | Error | The formula cannot reference it; extra names mean the two sides disagree |
207
+ | An account-state name (`pos_ratio`, `held_shares`, …) | Error | Its value never leaves the execution plane |
208
+
209
+ `--no-fetch` skips the fetch, and then **only the account-state rule is checked** —
210
+ the rest is unknowable locally, so it is not pretended.
211
+
212
+ ⚠️ **The server is always the authority.** Passing local validation does not mean
213
+ the server will accept — policy state and review status live there. This layer only
214
+ moves the obvious mistakes onto your machine, where you can see which field is
215
+ wrong instead of guessing from a rejection.
216
+
217
+ ⚠️ **There is no publish-time bound on order size.** Parameters are names only,
218
+ with no declared domain, so nothing proves at publish time that a formula stays
219
+ under a limit. How large an order it can place is clamped at order time by the
220
+ subscriber's own `max_order_cash_usd`. Keep your formulas in a sane range yourself.
221
+
222
+ ## JSON Inputs
223
+
224
+ `--schema-file` must contain the `strategy_schema` object accepted by `nexus-service`, for example:
225
+
226
+ ```json
227
+ {
228
+ "type": "object",
229
+ "properties": {
230
+ "window": {
231
+ "type": "integer",
232
+ "default": 14,
233
+ "title": "Window",
234
+ "source": "user"
235
+ }
236
+ },
237
+ "required": []
238
+ }
239
+ ```
240
+
241
+ `--signals-file` must contain a JSON object whose keys are `default` or user ids:
242
+
243
+ ```json
244
+ {
245
+ "default": {
246
+ "ticker": "AAPL",
247
+ "time": "2026-04-26T19:30:00Z",
248
+ "price": 150.25,
249
+ "direction": "buy",
250
+ "order_type": "LIMIT",
251
+ "quantity": 100,
252
+ "metadata": {}
253
+ }
254
+ }
255
+ ```
256
+
257
+ ## Environment Overrides
258
+
259
+ Normal use does not require configuration. For staging or local development:
260
+
261
+ | Variable | Meaning |
262
+ | ------------------------------ | ------------------------------------------------------------------------------------- |
263
+ | `NEXUSQUANT_API_ENDPOINT` | API endpoint host, default `https://api.nexusquant.co`; CLI calls `/api/...` under it |
264
+ | `NEXUSQUANT_API_BASE_URL` | Optional full API base override, e.g. `https://api.nexusquant.co/api` |
265
+ | `NEXUSQUANT_COGNITO_DOMAIN` | Cognito Hosted UI host, default `auth.lookatwallstreet.com` |
266
+ | `NEXUSQUANT_COGNITO_CLIENT_ID` | Cognito app client id |
267
+ | `NEXUSQUANT_REDIRECT_URI` | OAuth callback, default `http://127.0.0.1:8251/callback` |
268
+
269
+ There is also a hidden typo-compatible alias: `nexusquant startegy ...` maps to `nexusquant strategy ...`.
@@ -0,0 +1,257 @@
1
+ # nexusquant-cli
2
+
3
+ Command line tool for NexusQuant strategy providers.
4
+
5
+ It supports browser login through Cognito, stores tokens locally, refreshes tokens, and calls the Nexus strategy provider APIs. Provider commands require a Cognito user with `custom:userType=strategyProvider` or `custom:userType=admin`.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ python3 -m pip install -e .
11
+ ```
12
+
13
+ ```bash
14
+ pip install nexusquant-cli
15
+ ```
16
+
17
+ ## Login
18
+
19
+ ```bash
20
+ nexusquant auth
21
+ nexusquant auth --status
22
+ nexusquant auth --refresh
23
+ nexusquant auth --logout
24
+ ```
25
+
26
+ Tokens are stored in the current OS user's config directory, for example `~/Library/Application Support/nexusquant-cli/credentials.json` on macOS. The file is written with `0600` permissions when supported.
27
+
28
+ ## Strategy Commands
29
+
30
+ Create or update a strategy:
31
+
32
+ ```bash
33
+ nexusquant strategy create \
34
+ --strategy-id my_alpha_001 \
35
+ --name "My Alpha" \
36
+ --schema-file schema.json \
37
+ --output-unit SHARE_COUNT
38
+ ```
39
+
40
+ List strategies registered by the current provider. Admin users see all strategies:
41
+
42
+ ```bash
43
+ nexusquant strategy list
44
+ ```
45
+
46
+ List signal history for one strategy:
47
+
48
+ ```bash
49
+ nexusquant strategy signal my_alpha_001 --history --limit 20
50
+ ```
51
+
52
+ Send a single signal:
53
+
54
+ ```bash
55
+ nexusquant strategy signal my_alpha_001 \
56
+ --strategy-name "My Alpha" \
57
+ --ticker AAPL \
58
+ --direction buy \
59
+ --price 150.25 \
60
+ --quantity 100 \
61
+ --order-type MARKET
62
+ ```
63
+
64
+ `--order-type` is a signal-level setting: `MARKET` or `LIMIT` (limit uses `--price`). Legacy `NORMAL` is accepted by the CLI as an alias for `LIMIT`. If omitted, the API defaults to `MARKET`.
65
+
66
+ Send a multi-route `signals` map:
67
+
68
+ ```bash
69
+ nexusquant strategy signal my_alpha_001 \
70
+ --strategy-name "My Alpha" \
71
+ --signals-file signals.json
72
+ ```
73
+
74
+ Get non-PII subscriber config for a strategy:
75
+
76
+ ```bash
77
+ nexusquant strategy sub config my_alpha_001
78
+ ```
79
+
80
+ ## Policy Commands
81
+
82
+ A SizingPolicy replaces the fixed `--quantity` on a signal with a **formula** that
83
+ decides the order quantity — and optionally a limit price — at order time. You
84
+ publish the formula once; each signal then carries only the parameter values it
85
+ needs. Values that depend on the individual subscriber's account are never sent by
86
+ you: they are bound inside that user's own container when the order is placed.
87
+
88
+ Requires `custom:userType=strategyProvider` or `admin`, the same as the strategy
89
+ commands.
90
+
91
+ ### See which names a formula may use
92
+
93
+ The server registry is the authority — a name outside it cannot be published. Run
94
+ this before writing a formula:
95
+
96
+ ```bash
97
+ nexusquant policy features
98
+ nexusquant policy features --scope shared # names you send with each signal
99
+ nexusquant policy features --scope account # names bound in the user's container
100
+ nexusquant policy features --json # raw output for scripting
101
+ ```
102
+
103
+ Account-scoped names carry a "suppliable" flag: a name that exists but that the
104
+ container cannot currently supply will pass your editor and fail at publish.
105
+
106
+ ### Publish a formula
107
+
108
+ ```bash
109
+ nexusquant policy publish --strategy-id my_alpha --ticker TQQQ --file tqqq.json
110
+ nexusquant policy publish --strategy-id my_alpha --ticker TQQQ --file tqqq.json --profile normal
111
+ ```
112
+
113
+ `--file` holds the two things a policy is made of — the formulas keyed by output
114
+ slot, and the names you promise to supply with every signal:
115
+
116
+ ```json
117
+ {
118
+ "expr": {
119
+ "f_depth": "exp(-k_depth * depth / 10)",
120
+ "buy.quantity": "target_shares * f_depth * clamp(1 - pos_ratio, 0, 1)",
121
+ "buy.price": "ref_price * (1 - slip)",
122
+ "sell.quantity": "held_shares * exit_frac"
123
+ },
124
+ "params": ["target_shares", "k_depth", "depth", "ref_price", "slip", "exit_frac"]
125
+ }
126
+ ```
127
+
128
+ Output slots — the container picks the one matching the signal's direction:
129
+
130
+ | Slot | What the formula yields |
131
+ |---|---|
132
+ | `buy.quantity` / `sell.quantity` | **Share count** (floored) |
133
+ | `buy.price` / `sell.price` | **Limit price** — supplied ⇒ limit order, omitted ⇒ market order |
134
+
135
+ Intermediate names (`f_depth`) are fine, but an `expr` must define at least one
136
+ output slot, and an intermediate name may not contain a dot. `--ticker` is separate
137
+ from the file because it is not part of the artifact: the same formula pointed at
138
+ another symbol is the same formula.
139
+
140
+ ⚠️ **`publish` IS the go-live action.** There is no shadow or canary step, and the
141
+ previous version on the same slot is deactivated. `--profile` defaults to `normal`.
142
+
143
+ Before sending anything, the CLI fetches the registry and checks locally that every
144
+ free name in your formula has someone to supply it — forgetting to list a name in
145
+ `params` is the most common mistake. `--skip-name-check` disables that fetch, and
146
+ then local success does not imply the server will accept.
147
+
148
+ ### List and stop
149
+
150
+ ```bash
151
+ nexusquant policy list my_alpha
152
+ nexusquant policy list my_alpha --ticker TQQQ --mode active # --mode active / off
153
+
154
+ # Emergency stop for a live version — not a promotion step, since publish already went live
155
+ nexusquant policy set-mode --policy-id 'TQQQ/normal/…/abc123' --mode off
156
+ nexusquant policy set-mode --policy-id 'TQQQ/normal/…/abc123' --mode active
157
+ ```
158
+
159
+ ### Send a signal against a policy
160
+
161
+ Every declared parameter must be present, or the signal is rejected:
162
+
163
+ ```bash
164
+ nexusquant policy send-signal \
165
+ --strategy-id my_alpha --ticker TQQQ --price 51.2 --direction buy \
166
+ -p target_shares=10 -p k_depth=0.5 -p depth=3 \
167
+ -p ref_price=51.2 -p slip=0.002 -p exit_frac=0.25
168
+
169
+ # Or pass all parameter values as a JSON object
170
+ nexusquant policy send-signal --strategy-id my_alpha --ticker TQQQ \
171
+ --price 51.2 --direction buy --params-file params.json
172
+
173
+ # Validate and print the payload without sending it
174
+ nexusquant policy send-signal ... --dry-run
175
+ ```
176
+
177
+ | Flag | Meaning |
178
+ |---|---|
179
+ | `--param` / `-p` | One parameter value, `name=value`; repeat per declared name |
180
+ | `--params-file` | A JSON object with all parameter values instead |
181
+ | `--policy-id` | Defaults to the active policy on this `(strategy, ticker)` |
182
+ | `--quantity` | Used when the formula has no slot for this direction |
183
+ | `--order-type` | `MARKET` / `LIMIT` |
184
+ | `--strategy-name` | Defaults to the strategy id |
185
+ | `--no-fetch` | Skip fetching the policy — see below |
186
+ | `--dry-run` | Validate and print the payload, send nothing |
187
+
188
+ By default the CLI fetches the active policy first and uses it to validate and
189
+ coerce your values. Three checks, each mirroring the server:
190
+
191
+ | Situation | Result | Why not something else |
192
+ |---|---|---|
193
+ | A declared parameter is missing | Error | No defaults — a default turns "unknown" into "known" |
194
+ | A name you did not declare | Error | The formula cannot reference it; extra names mean the two sides disagree |
195
+ | An account-state name (`pos_ratio`, `held_shares`, …) | Error | Its value never leaves the execution plane |
196
+
197
+ `--no-fetch` skips the fetch, and then **only the account-state rule is checked** —
198
+ the rest is unknowable locally, so it is not pretended.
199
+
200
+ ⚠️ **The server is always the authority.** Passing local validation does not mean
201
+ the server will accept — policy state and review status live there. This layer only
202
+ moves the obvious mistakes onto your machine, where you can see which field is
203
+ wrong instead of guessing from a rejection.
204
+
205
+ ⚠️ **There is no publish-time bound on order size.** Parameters are names only,
206
+ with no declared domain, so nothing proves at publish time that a formula stays
207
+ under a limit. How large an order it can place is clamped at order time by the
208
+ subscriber's own `max_order_cash_usd`. Keep your formulas in a sane range yourself.
209
+
210
+ ## JSON Inputs
211
+
212
+ `--schema-file` must contain the `strategy_schema` object accepted by `nexus-service`, for example:
213
+
214
+ ```json
215
+ {
216
+ "type": "object",
217
+ "properties": {
218
+ "window": {
219
+ "type": "integer",
220
+ "default": 14,
221
+ "title": "Window",
222
+ "source": "user"
223
+ }
224
+ },
225
+ "required": []
226
+ }
227
+ ```
228
+
229
+ `--signals-file` must contain a JSON object whose keys are `default` or user ids:
230
+
231
+ ```json
232
+ {
233
+ "default": {
234
+ "ticker": "AAPL",
235
+ "time": "2026-04-26T19:30:00Z",
236
+ "price": 150.25,
237
+ "direction": "buy",
238
+ "order_type": "LIMIT",
239
+ "quantity": 100,
240
+ "metadata": {}
241
+ }
242
+ }
243
+ ```
244
+
245
+ ## Environment Overrides
246
+
247
+ Normal use does not require configuration. For staging or local development:
248
+
249
+ | Variable | Meaning |
250
+ | ------------------------------ | ------------------------------------------------------------------------------------- |
251
+ | `NEXUSQUANT_API_ENDPOINT` | API endpoint host, default `https://api.nexusquant.co`; CLI calls `/api/...` under it |
252
+ | `NEXUSQUANT_API_BASE_URL` | Optional full API base override, e.g. `https://api.nexusquant.co/api` |
253
+ | `NEXUSQUANT_COGNITO_DOMAIN` | Cognito Hosted UI host, default `auth.lookatwallstreet.com` |
254
+ | `NEXUSQUANT_COGNITO_CLIENT_ID` | Cognito app client id |
255
+ | `NEXUSQUANT_REDIRECT_URI` | OAuth callback, default `http://127.0.0.1:8251/callback` |
256
+
257
+ There is also a hidden typo-compatible alias: `nexusquant startegy ...` maps to `nexusquant strategy ...`.
@@ -0,0 +1 @@
1
+ __version__ = "0.2.1"
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "nexusquant-cli"
7
- version = "0.2.0"
7
+ version = "0.2.1"
8
8
  description = "NexusQuant strategy provider CLI"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,139 +0,0 @@
1
- Metadata-Version: 2.5
2
- Name: nexusquant-cli
3
- Version: 0.2.0
4
- Summary: NexusQuant strategy provider CLI
5
- Requires-Python: >=3.10
6
- Requires-Dist: httpx>=0.27
7
- Requires-Dist: nexusquant-sdk>=0.2
8
- Requires-Dist: platformdirs>=4.2
9
- Requires-Dist: rich>=13.7
10
- Requires-Dist: typer>=0.12
11
- Description-Content-Type: text/markdown
12
-
13
- # nexusquant-cli
14
-
15
- Command line tool for NexusQuant strategy providers.
16
-
17
- It supports browser login through Cognito, stores tokens locally, refreshes tokens, and calls the Nexus strategy provider APIs. Provider commands require a Cognito user with `custom:userType=strategyProvider` or `custom:userType=admin`.
18
-
19
- ## Install
20
-
21
- ```bash
22
- python3 -m pip install -e .
23
- ```
24
-
25
- ```bash
26
- pip install nexusquant-cli
27
- ```
28
-
29
- ## Login
30
-
31
- ```bash
32
- nexusquant auth
33
- nexusquant auth --status
34
- nexusquant auth --refresh
35
- nexusquant auth --logout
36
- ```
37
-
38
- Tokens are stored in the current OS user's config directory, for example `~/Library/Application Support/nexusquant-cli/credentials.json` on macOS. The file is written with `0600` permissions when supported.
39
-
40
- ## Strategy Commands
41
-
42
- Create or update a strategy:
43
-
44
- ```bash
45
- nexusquant strategy create \
46
- --strategy-id my_alpha_001 \
47
- --name "My Alpha" \
48
- --schema-file schema.json \
49
- --output-unit SHARE_COUNT
50
- ```
51
-
52
- List strategies registered by the current provider. Admin users see all strategies:
53
-
54
- ```bash
55
- nexusquant strategy list
56
- ```
57
-
58
- List signal history for one strategy:
59
-
60
- ```bash
61
- nexusquant strategy signal my_alpha_001 --history --limit 20
62
- ```
63
-
64
- Send a single signal:
65
-
66
- ```bash
67
- nexusquant strategy signal my_alpha_001 \
68
- --strategy-name "My Alpha" \
69
- --ticker AAPL \
70
- --direction buy \
71
- --price 150.25 \
72
- --quantity 100 \
73
- --order-type MARKET
74
- ```
75
-
76
- `--order-type` is a signal-level setting: `MARKET` or `LIMIT` (limit uses `--price`). Legacy `NORMAL` is accepted by the CLI as an alias for `LIMIT`. If omitted, the API defaults to `MARKET`.
77
-
78
- Send a multi-route `signals` map:
79
-
80
- ```bash
81
- nexusquant strategy signal my_alpha_001 \
82
- --strategy-name "My Alpha" \
83
- --signals-file signals.json
84
- ```
85
-
86
- Get non-PII subscriber config for a strategy:
87
-
88
- ```bash
89
- nexusquant strategy sub config my_alpha_001
90
- ```
91
-
92
- ## JSON Inputs
93
-
94
- `--schema-file` must contain the `strategy_schema` object accepted by `nexus-service`, for example:
95
-
96
- ```json
97
- {
98
- "type": "object",
99
- "properties": {
100
- "window": {
101
- "type": "integer",
102
- "default": 14,
103
- "title": "Window",
104
- "source": "user"
105
- }
106
- },
107
- "required": []
108
- }
109
- ```
110
-
111
- `--signals-file` must contain a JSON object whose keys are `default` or user ids:
112
-
113
- ```json
114
- {
115
- "default": {
116
- "ticker": "AAPL",
117
- "time": "2026-04-26T19:30:00Z",
118
- "price": 150.25,
119
- "direction": "buy",
120
- "order_type": "LIMIT",
121
- "quantity": 100,
122
- "metadata": {}
123
- }
124
- }
125
- ```
126
-
127
- ## Environment Overrides
128
-
129
- Normal use does not require configuration. For staging or local development:
130
-
131
- | Variable | Meaning |
132
- | ------------------------------ | ------------------------------------------------------------------------------------- |
133
- | `NEXUSQUANT_API_ENDPOINT` | API endpoint host, default `https://api.nexusquant.co`; CLI calls `/api/...` under it |
134
- | `NEXUSQUANT_API_BASE_URL` | Optional full API base override, e.g. `https://api.nexusquant.co/api` |
135
- | `NEXUSQUANT_COGNITO_DOMAIN` | Cognito Hosted UI host, default `auth.lookatwallstreet.com` |
136
- | `NEXUSQUANT_COGNITO_CLIENT_ID` | Cognito app client id |
137
- | `NEXUSQUANT_REDIRECT_URI` | OAuth callback, default `http://127.0.0.1:8251/callback` |
138
-
139
- There is also a hidden typo-compatible alias: `nexusquant startegy ...` maps to `nexusquant strategy ...`.
@@ -1,127 +0,0 @@
1
- # nexusquant-cli
2
-
3
- Command line tool for NexusQuant strategy providers.
4
-
5
- It supports browser login through Cognito, stores tokens locally, refreshes tokens, and calls the Nexus strategy provider APIs. Provider commands require a Cognito user with `custom:userType=strategyProvider` or `custom:userType=admin`.
6
-
7
- ## Install
8
-
9
- ```bash
10
- python3 -m pip install -e .
11
- ```
12
-
13
- ```bash
14
- pip install nexusquant-cli
15
- ```
16
-
17
- ## Login
18
-
19
- ```bash
20
- nexusquant auth
21
- nexusquant auth --status
22
- nexusquant auth --refresh
23
- nexusquant auth --logout
24
- ```
25
-
26
- Tokens are stored in the current OS user's config directory, for example `~/Library/Application Support/nexusquant-cli/credentials.json` on macOS. The file is written with `0600` permissions when supported.
27
-
28
- ## Strategy Commands
29
-
30
- Create or update a strategy:
31
-
32
- ```bash
33
- nexusquant strategy create \
34
- --strategy-id my_alpha_001 \
35
- --name "My Alpha" \
36
- --schema-file schema.json \
37
- --output-unit SHARE_COUNT
38
- ```
39
-
40
- List strategies registered by the current provider. Admin users see all strategies:
41
-
42
- ```bash
43
- nexusquant strategy list
44
- ```
45
-
46
- List signal history for one strategy:
47
-
48
- ```bash
49
- nexusquant strategy signal my_alpha_001 --history --limit 20
50
- ```
51
-
52
- Send a single signal:
53
-
54
- ```bash
55
- nexusquant strategy signal my_alpha_001 \
56
- --strategy-name "My Alpha" \
57
- --ticker AAPL \
58
- --direction buy \
59
- --price 150.25 \
60
- --quantity 100 \
61
- --order-type MARKET
62
- ```
63
-
64
- `--order-type` is a signal-level setting: `MARKET` or `LIMIT` (limit uses `--price`). Legacy `NORMAL` is accepted by the CLI as an alias for `LIMIT`. If omitted, the API defaults to `MARKET`.
65
-
66
- Send a multi-route `signals` map:
67
-
68
- ```bash
69
- nexusquant strategy signal my_alpha_001 \
70
- --strategy-name "My Alpha" \
71
- --signals-file signals.json
72
- ```
73
-
74
- Get non-PII subscriber config for a strategy:
75
-
76
- ```bash
77
- nexusquant strategy sub config my_alpha_001
78
- ```
79
-
80
- ## JSON Inputs
81
-
82
- `--schema-file` must contain the `strategy_schema` object accepted by `nexus-service`, for example:
83
-
84
- ```json
85
- {
86
- "type": "object",
87
- "properties": {
88
- "window": {
89
- "type": "integer",
90
- "default": 14,
91
- "title": "Window",
92
- "source": "user"
93
- }
94
- },
95
- "required": []
96
- }
97
- ```
98
-
99
- `--signals-file` must contain a JSON object whose keys are `default` or user ids:
100
-
101
- ```json
102
- {
103
- "default": {
104
- "ticker": "AAPL",
105
- "time": "2026-04-26T19:30:00Z",
106
- "price": 150.25,
107
- "direction": "buy",
108
- "order_type": "LIMIT",
109
- "quantity": 100,
110
- "metadata": {}
111
- }
112
- }
113
- ```
114
-
115
- ## Environment Overrides
116
-
117
- Normal use does not require configuration. For staging or local development:
118
-
119
- | Variable | Meaning |
120
- | ------------------------------ | ------------------------------------------------------------------------------------- |
121
- | `NEXUSQUANT_API_ENDPOINT` | API endpoint host, default `https://api.nexusquant.co`; CLI calls `/api/...` under it |
122
- | `NEXUSQUANT_API_BASE_URL` | Optional full API base override, e.g. `https://api.nexusquant.co/api` |
123
- | `NEXUSQUANT_COGNITO_DOMAIN` | Cognito Hosted UI host, default `auth.lookatwallstreet.com` |
124
- | `NEXUSQUANT_COGNITO_CLIENT_ID` | Cognito app client id |
125
- | `NEXUSQUANT_REDIRECT_URI` | OAuth callback, default `http://127.0.0.1:8251/callback` |
126
-
127
- There is also a hidden typo-compatible alias: `nexusquant startegy ...` maps to `nexusquant strategy ...`.
@@ -1 +0,0 @@
1
- __version__ = "0.2.0"
File without changes