jev-cli 0.4.1__tar.gz → 0.6.0__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.
- {jev_cli-0.4.1 → jev_cli-0.6.0}/PKG-INFO +131 -16
- {jev_cli-0.4.1 → jev_cli-0.6.0}/README.md +127 -13
- {jev_cli-0.4.1 → jev_cli-0.6.0}/pyproject.toml +5 -4
- {jev_cli-0.4.1 → jev_cli-0.6.0}/skills/jev-cli/SKILL.md +13 -9
- {jev_cli-0.4.1/src/jev_cli/bundled_skills → jev_cli-0.6.0/skills}/jev-cli/references/cli.md +70 -2
- {jev_cli-0.4.1 → jev_cli-0.6.0}/src/jev_cli/__init__.py +154 -36
- {jev_cli-0.4.1 → jev_cli-0.6.0}/src/jev_cli/bundled_skills/jev-cli/SKILL.md +13 -9
- {jev_cli-0.4.1/skills → jev_cli-0.6.0/src/jev_cli/bundled_skills}/jev-cli/references/cli.md +70 -2
- jev_cli-0.6.0/src/jev_cli/mcp_server.py +288 -0
- {jev_cli-0.4.1 → jev_cli-0.6.0}/tests/test_jev.py +168 -1
- jev_cli-0.6.0/tests/test_mcp_server.py +500 -0
- {jev_cli-0.4.1 → jev_cli-0.6.0}/LICENSE +0 -0
- {jev_cli-0.4.1 → jev_cli-0.6.0}/scripts/embed_skills.py +0 -0
- {jev_cli-0.4.1 → jev_cli-0.6.0}/src/jev_cli/py.typed +0 -0
- {jev_cli-0.4.1 → jev_cli-0.6.0}/tests/test_skill.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jev-cli
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Small
|
|
5
|
-
Keywords: typesafe,jev,cli,ai
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: Small CLI and stdio MCP server for TypeSafe Jev
|
|
5
|
+
Keywords: typesafe,jev,cli,mcp,ai
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
License-File: LICENSE
|
|
8
8
|
Classifier: Development Status :: 3 - Alpha
|
|
@@ -10,6 +10,7 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.13
|
|
12
12
|
Classifier: Typing :: Typed
|
|
13
|
+
Requires-Dist: mcp>=2.2.0,<3
|
|
13
14
|
Requires-Python: >=3.13
|
|
14
15
|
Project-URL: Homepage, https://github.com/tumf/jev-cli
|
|
15
16
|
Project-URL: Issues, https://github.com/tumf/jev-cli/issues
|
|
@@ -18,9 +19,9 @@ Description-Content-Type: text/markdown
|
|
|
18
19
|
|
|
19
20
|
# jev-cli
|
|
20
21
|
|
|
21
|
-
A small
|
|
22
|
+
A small CLI and stdio MCP server for [TypeSafe Jev](https://docs.typesafe.ai/introduction). Send text or JSON state, ask typed questions, and receive machine-readable `noul`, `choice`, or `score` answers.
|
|
22
23
|
|
|
23
|
-
The `jev` command is useful when application code needs a fast classification or judgment instead of generated prose.
|
|
24
|
+
The `jev` command is useful when application code needs a fast classification or judgment instead of generated prose. The `jev-mcp` command exposes the same judgments to MCP hosts over stdio.
|
|
24
25
|
|
|
25
26
|
> **Unofficial:** This is an independent community project. It is not affiliated with, maintained by, or endorsed by TypeSafe AI.
|
|
26
27
|
|
|
@@ -32,23 +33,21 @@ The `jev` command is useful when application code needs a fast classification or
|
|
|
32
33
|
- Emits compact JSON by default
|
|
33
34
|
- Can print only the primary value for shell scripts
|
|
34
35
|
- Uses structured stderr errors and meaningful exit codes
|
|
35
|
-
-
|
|
36
|
+
- Ships a stdio MCP server, `jev-mcp`, in the same installation
|
|
36
37
|
|
|
37
38
|
## Requirements
|
|
38
39
|
|
|
39
|
-
- Python 3.13 or later
|
|
40
40
|
- [uv](https://docs.astral.sh/uv/)
|
|
41
|
-
-
|
|
42
|
-
|
|
41
|
+
- An API key for the provider you use. The official TypeSafe API is the default.
|
|
42
|
+
|
|
43
|
+
`uv` installs a compatible Python 3.13 or later interpreter when needed.
|
|
43
44
|
|
|
44
45
|
## Install
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
Install `jev-cli` from PyPI with `uv tool`. This keeps the commands in an isolated environment and makes both `jev` and `jev-mcp` available on your `PATH`. There is no optional extra to select; the MCP server is part of the normal installation.
|
|
47
48
|
|
|
48
49
|
```bash
|
|
49
|
-
|
|
50
|
-
cd jev-cli
|
|
51
|
-
make install
|
|
50
|
+
uv tool install jev-cli
|
|
52
51
|
```
|
|
53
52
|
|
|
54
53
|
Verify that the command is available:
|
|
@@ -60,12 +59,12 @@ jev --version
|
|
|
60
59
|
Expected output:
|
|
61
60
|
|
|
62
61
|
```text
|
|
63
|
-
jev 0.
|
|
62
|
+
jev 0.6.0
|
|
64
63
|
```
|
|
65
64
|
|
|
66
65
|
## Authentication
|
|
67
66
|
|
|
68
|
-
The recommended approach for automation is the `TYPESAFE_API_KEY` environment variable. It takes precedence over the credential file.
|
|
67
|
+
The official TypeSafe API is the default provider. The recommended approach for automation is the `TYPESAFE_API_KEY` environment variable. It takes precedence over the credential file.
|
|
69
68
|
|
|
70
69
|
```bash
|
|
71
70
|
export TYPESAFE_API_KEY='your-api-key'
|
|
@@ -80,6 +79,50 @@ jev auth status
|
|
|
80
79
|
jev auth test
|
|
81
80
|
```
|
|
82
81
|
|
|
82
|
+
Jev is also available through Vercel AI Gateway and OpenRouter. Select a provider per command with `--provider`, or set `JEV_PROVIDER` for the process. Each provider uses its own API key and default model.
|
|
83
|
+
|
|
84
|
+
| Provider | Option | API key environment variable | Default model |
|
|
85
|
+
|---|---|---|---|
|
|
86
|
+
| TypeSafe official | `official` | `TYPESAFE_API_KEY` | `jev-latest` |
|
|
87
|
+
| Vercel AI Gateway | `vercel` | `AI_GATEWAY_API_KEY` | `typesafe-ai/jev` |
|
|
88
|
+
| OpenRouter | `openrouter` | `OPENROUTER_API_KEY` | `typesafe/jev-1.13` |
|
|
89
|
+
| Jev-compatible proxy | `custom` | `JEV_API_KEY` | `JEV_MODEL` or `jev-latest` |
|
|
90
|
+
|
|
91
|
+
Store and test a provider-specific key without exposing it in shell history:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
jev auth set --provider vercel
|
|
95
|
+
jev auth test --provider vercel
|
|
96
|
+
|
|
97
|
+
jev auth set --provider openrouter
|
|
98
|
+
jev auth test --provider openrouter
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Run the same judgment through another provider:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
jev noul \
|
|
105
|
+
--provider openrouter \
|
|
106
|
+
--question 'Does this message express urgency?' \
|
|
107
|
+
--state 'Please restore service today.' \
|
|
108
|
+
--value
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Omitting `--provider` continues to use the official TypeSafe API. `--model` can override the provider's default model.
|
|
112
|
+
|
|
113
|
+
For a proxy that implements the native Jev request and response contract, select `custom` and configure its endpoint separately. This keeps proxy credentials isolated from the built-in providers.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
export JEV_PROVIDER=custom
|
|
117
|
+
export JEV_ENDPOINT='https://proxy.example.com/v1/systemone'
|
|
118
|
+
export JEV_API_KEY='your-proxy-api-key'
|
|
119
|
+
export JEV_MODEL='jev-latest' # optional
|
|
120
|
+
|
|
121
|
+
jev noul -q 'Is this urgent?' -s 'Restore service today.' --value
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`--endpoint` can replace `JEV_ENDPOINT` for one command. The CLI sends `JEV_API_KEY` to that endpoint as a bearer token, so use only a trusted HTTPS endpoint.
|
|
125
|
+
|
|
83
126
|
For non-interactive automation, piping the key to `jev auth set` remains supported.
|
|
84
127
|
|
|
85
128
|
`auth status` reports only whether a key is available. `auth test` sends a minimal request to Jev and verifies that the key is accepted. Neither command prints the key.
|
|
@@ -254,6 +297,78 @@ A request can also be piped through stdin:
|
|
|
254
297
|
cat request.json | jev run - --pretty
|
|
255
298
|
```
|
|
256
299
|
|
|
300
|
+
## MCP server
|
|
301
|
+
|
|
302
|
+
`jev-mcp` is a stdio [MCP](https://modelcontextprotocol.io) server installed alongside `jev`. It exposes four tools that map to the CLI commands:
|
|
303
|
+
|
|
304
|
+
| Tool | Purpose | Required inputs |
|
|
305
|
+
|---|---|---|
|
|
306
|
+
| `noul` | One yes/no judgment with a probability | `state`, `question` |
|
|
307
|
+
| `choice` | One selection from a typed option map | `state`, `question`, `options` |
|
|
308
|
+
| `score` | One evaluation against ordered levels | `state`, `question`, `levels` |
|
|
309
|
+
| `run` | A complete multi-question System One request | `request` |
|
|
310
|
+
|
|
311
|
+
`choice` requires at least two options and `score` requires at least two levels; a smaller request is rejected as a tool error before any provider call.
|
|
312
|
+
|
|
313
|
+
Every argument is described in the published tool schemas, so a host can construct a call without reading this page. `run` takes one complete System One request; its `questions` keys become the answer keys in the response:
|
|
314
|
+
|
|
315
|
+
```json
|
|
316
|
+
{
|
|
317
|
+
"request": {
|
|
318
|
+
"state": {"message": "The invoice is wrong again and I want a refund."},
|
|
319
|
+
"questions": {
|
|
320
|
+
"urgent": {"type": "noul", "instructions": "Does this need a reply today?"},
|
|
321
|
+
"team": {
|
|
322
|
+
"type": "choice",
|
|
323
|
+
"instructions": "Which team should own this?",
|
|
324
|
+
"criteria": {"billing": "Invoice or payment problem", "support": "Product or account problem"}
|
|
325
|
+
},
|
|
326
|
+
"anger": {
|
|
327
|
+
"type": "score",
|
|
328
|
+
"instructions": "How frustrated is the sender?",
|
|
329
|
+
"criteria": ["Calm", "Annoyed", "Angry"]
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
Request members this client does not know are forwarded to the provider unchanged.
|
|
337
|
+
|
|
338
|
+
Every tool also accepts the optional `provider`, `model`, and `endpoint` arguments. Authentication, provider selection, model defaults, endpoint resolution, and response normalization are the same as for `jev`, including `JEV_PROVIDER` and the credential store, so no separate setup is required.
|
|
339
|
+
|
|
340
|
+
Add the server to an MCP host with a minimal stdio entry:
|
|
341
|
+
|
|
342
|
+
```json
|
|
343
|
+
{
|
|
344
|
+
"mcpServers": {
|
|
345
|
+
"jev": {
|
|
346
|
+
"command": "jev-mcp"
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Pass provider configuration through the host's environment block when the default is not wanted:
|
|
353
|
+
|
|
354
|
+
```json
|
|
355
|
+
{
|
|
356
|
+
"mcpServers": {
|
|
357
|
+
"jev": {
|
|
358
|
+
"command": "jev-mcp",
|
|
359
|
+
"env": {
|
|
360
|
+
"JEV_PROVIDER": "openrouter",
|
|
361
|
+
"OPENROUTER_API_KEY": "your-api-key"
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
`state` is sent verbatim over MCP. Unlike the CLI, `-` does not read stdin and a leading `@` does not read a file, because stdin carries the MCP protocol frames. Read a file in the host and pass its content as `state`.
|
|
369
|
+
|
|
370
|
+
Invalid input and provider failures are returned as MCP tool errors and never include the API key. stdout carries MCP protocol frames only; diagnostics go to stderr.
|
|
371
|
+
|
|
257
372
|
## Output and automation
|
|
258
373
|
|
|
259
374
|
The default stdout is one JSON object. Logs and structured errors go to stderr, so stdout can be piped directly into another program.
|
|
@@ -295,7 +410,7 @@ An error is emitted as JSON on stderr:
|
|
|
295
410
|
|
|
296
411
|
The `jev` command is a thin client for focused System One judgments. It does not generate prose, perform arithmetic, compare dates, or replace application-level validation. Keep deterministic work in code and use Jev for semantic judgments.
|
|
297
412
|
|
|
298
|
-
The CLI sends the supplied state and questions to the
|
|
413
|
+
The CLI sends the supplied state and questions to the selected provider. Do not submit data that your organization is not permitted to send to that service.
|
|
299
414
|
|
|
300
415
|
## License
|
|
301
416
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# jev-cli
|
|
2
2
|
|
|
3
|
-
A small
|
|
3
|
+
A small CLI and stdio MCP server for [TypeSafe Jev](https://docs.typesafe.ai/introduction). Send text or JSON state, ask typed questions, and receive machine-readable `noul`, `choice`, or `score` answers.
|
|
4
4
|
|
|
5
|
-
The `jev` command is useful when application code needs a fast classification or judgment instead of generated prose.
|
|
5
|
+
The `jev` command is useful when application code needs a fast classification or judgment instead of generated prose. The `jev-mcp` command exposes the same judgments to MCP hosts over stdio.
|
|
6
6
|
|
|
7
7
|
> **Unofficial:** This is an independent community project. It is not affiliated with, maintained by, or endorsed by TypeSafe AI.
|
|
8
8
|
|
|
@@ -14,23 +14,21 @@ The `jev` command is useful when application code needs a fast classification or
|
|
|
14
14
|
- Emits compact JSON by default
|
|
15
15
|
- Can print only the primary value for shell scripts
|
|
16
16
|
- Uses structured stderr errors and meaningful exit codes
|
|
17
|
-
-
|
|
17
|
+
- Ships a stdio MCP server, `jev-mcp`, in the same installation
|
|
18
18
|
|
|
19
19
|
## Requirements
|
|
20
20
|
|
|
21
|
-
- Python 3.13 or later
|
|
22
21
|
- [uv](https://docs.astral.sh/uv/)
|
|
23
|
-
-
|
|
24
|
-
|
|
22
|
+
- An API key for the provider you use. The official TypeSafe API is the default.
|
|
23
|
+
|
|
24
|
+
`uv` installs a compatible Python 3.13 or later interpreter when needed.
|
|
25
25
|
|
|
26
26
|
## Install
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Install `jev-cli` from PyPI with `uv tool`. This keeps the commands in an isolated environment and makes both `jev` and `jev-mcp` available on your `PATH`. There is no optional extra to select; the MCP server is part of the normal installation.
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
|
|
32
|
-
cd jev-cli
|
|
33
|
-
make install
|
|
31
|
+
uv tool install jev-cli
|
|
34
32
|
```
|
|
35
33
|
|
|
36
34
|
Verify that the command is available:
|
|
@@ -42,12 +40,12 @@ jev --version
|
|
|
42
40
|
Expected output:
|
|
43
41
|
|
|
44
42
|
```text
|
|
45
|
-
jev 0.
|
|
43
|
+
jev 0.6.0
|
|
46
44
|
```
|
|
47
45
|
|
|
48
46
|
## Authentication
|
|
49
47
|
|
|
50
|
-
The recommended approach for automation is the `TYPESAFE_API_KEY` environment variable. It takes precedence over the credential file.
|
|
48
|
+
The official TypeSafe API is the default provider. The recommended approach for automation is the `TYPESAFE_API_KEY` environment variable. It takes precedence over the credential file.
|
|
51
49
|
|
|
52
50
|
```bash
|
|
53
51
|
export TYPESAFE_API_KEY='your-api-key'
|
|
@@ -62,6 +60,50 @@ jev auth status
|
|
|
62
60
|
jev auth test
|
|
63
61
|
```
|
|
64
62
|
|
|
63
|
+
Jev is also available through Vercel AI Gateway and OpenRouter. Select a provider per command with `--provider`, or set `JEV_PROVIDER` for the process. Each provider uses its own API key and default model.
|
|
64
|
+
|
|
65
|
+
| Provider | Option | API key environment variable | Default model |
|
|
66
|
+
|---|---|---|---|
|
|
67
|
+
| TypeSafe official | `official` | `TYPESAFE_API_KEY` | `jev-latest` |
|
|
68
|
+
| Vercel AI Gateway | `vercel` | `AI_GATEWAY_API_KEY` | `typesafe-ai/jev` |
|
|
69
|
+
| OpenRouter | `openrouter` | `OPENROUTER_API_KEY` | `typesafe/jev-1.13` |
|
|
70
|
+
| Jev-compatible proxy | `custom` | `JEV_API_KEY` | `JEV_MODEL` or `jev-latest` |
|
|
71
|
+
|
|
72
|
+
Store and test a provider-specific key without exposing it in shell history:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
jev auth set --provider vercel
|
|
76
|
+
jev auth test --provider vercel
|
|
77
|
+
|
|
78
|
+
jev auth set --provider openrouter
|
|
79
|
+
jev auth test --provider openrouter
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Run the same judgment through another provider:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
jev noul \
|
|
86
|
+
--provider openrouter \
|
|
87
|
+
--question 'Does this message express urgency?' \
|
|
88
|
+
--state 'Please restore service today.' \
|
|
89
|
+
--value
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Omitting `--provider` continues to use the official TypeSafe API. `--model` can override the provider's default model.
|
|
93
|
+
|
|
94
|
+
For a proxy that implements the native Jev request and response contract, select `custom` and configure its endpoint separately. This keeps proxy credentials isolated from the built-in providers.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
export JEV_PROVIDER=custom
|
|
98
|
+
export JEV_ENDPOINT='https://proxy.example.com/v1/systemone'
|
|
99
|
+
export JEV_API_KEY='your-proxy-api-key'
|
|
100
|
+
export JEV_MODEL='jev-latest' # optional
|
|
101
|
+
|
|
102
|
+
jev noul -q 'Is this urgent?' -s 'Restore service today.' --value
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`--endpoint` can replace `JEV_ENDPOINT` for one command. The CLI sends `JEV_API_KEY` to that endpoint as a bearer token, so use only a trusted HTTPS endpoint.
|
|
106
|
+
|
|
65
107
|
For non-interactive automation, piping the key to `jev auth set` remains supported.
|
|
66
108
|
|
|
67
109
|
`auth status` reports only whether a key is available. `auth test` sends a minimal request to Jev and verifies that the key is accepted. Neither command prints the key.
|
|
@@ -236,6 +278,78 @@ A request can also be piped through stdin:
|
|
|
236
278
|
cat request.json | jev run - --pretty
|
|
237
279
|
```
|
|
238
280
|
|
|
281
|
+
## MCP server
|
|
282
|
+
|
|
283
|
+
`jev-mcp` is a stdio [MCP](https://modelcontextprotocol.io) server installed alongside `jev`. It exposes four tools that map to the CLI commands:
|
|
284
|
+
|
|
285
|
+
| Tool | Purpose | Required inputs |
|
|
286
|
+
|---|---|---|
|
|
287
|
+
| `noul` | One yes/no judgment with a probability | `state`, `question` |
|
|
288
|
+
| `choice` | One selection from a typed option map | `state`, `question`, `options` |
|
|
289
|
+
| `score` | One evaluation against ordered levels | `state`, `question`, `levels` |
|
|
290
|
+
| `run` | A complete multi-question System One request | `request` |
|
|
291
|
+
|
|
292
|
+
`choice` requires at least two options and `score` requires at least two levels; a smaller request is rejected as a tool error before any provider call.
|
|
293
|
+
|
|
294
|
+
Every argument is described in the published tool schemas, so a host can construct a call without reading this page. `run` takes one complete System One request; its `questions` keys become the answer keys in the response:
|
|
295
|
+
|
|
296
|
+
```json
|
|
297
|
+
{
|
|
298
|
+
"request": {
|
|
299
|
+
"state": {"message": "The invoice is wrong again and I want a refund."},
|
|
300
|
+
"questions": {
|
|
301
|
+
"urgent": {"type": "noul", "instructions": "Does this need a reply today?"},
|
|
302
|
+
"team": {
|
|
303
|
+
"type": "choice",
|
|
304
|
+
"instructions": "Which team should own this?",
|
|
305
|
+
"criteria": {"billing": "Invoice or payment problem", "support": "Product or account problem"}
|
|
306
|
+
},
|
|
307
|
+
"anger": {
|
|
308
|
+
"type": "score",
|
|
309
|
+
"instructions": "How frustrated is the sender?",
|
|
310
|
+
"criteria": ["Calm", "Annoyed", "Angry"]
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Request members this client does not know are forwarded to the provider unchanged.
|
|
318
|
+
|
|
319
|
+
Every tool also accepts the optional `provider`, `model`, and `endpoint` arguments. Authentication, provider selection, model defaults, endpoint resolution, and response normalization are the same as for `jev`, including `JEV_PROVIDER` and the credential store, so no separate setup is required.
|
|
320
|
+
|
|
321
|
+
Add the server to an MCP host with a minimal stdio entry:
|
|
322
|
+
|
|
323
|
+
```json
|
|
324
|
+
{
|
|
325
|
+
"mcpServers": {
|
|
326
|
+
"jev": {
|
|
327
|
+
"command": "jev-mcp"
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Pass provider configuration through the host's environment block when the default is not wanted:
|
|
334
|
+
|
|
335
|
+
```json
|
|
336
|
+
{
|
|
337
|
+
"mcpServers": {
|
|
338
|
+
"jev": {
|
|
339
|
+
"command": "jev-mcp",
|
|
340
|
+
"env": {
|
|
341
|
+
"JEV_PROVIDER": "openrouter",
|
|
342
|
+
"OPENROUTER_API_KEY": "your-api-key"
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
`state` is sent verbatim over MCP. Unlike the CLI, `-` does not read stdin and a leading `@` does not read a file, because stdin carries the MCP protocol frames. Read a file in the host and pass its content as `state`.
|
|
350
|
+
|
|
351
|
+
Invalid input and provider failures are returned as MCP tool errors and never include the API key. stdout carries MCP protocol frames only; diagnostics go to stderr.
|
|
352
|
+
|
|
239
353
|
## Output and automation
|
|
240
354
|
|
|
241
355
|
The default stdout is one JSON object. Logs and structured errors go to stderr, so stdout can be piped directly into another program.
|
|
@@ -277,7 +391,7 @@ An error is emitted as JSON on stderr:
|
|
|
277
391
|
|
|
278
392
|
The `jev` command is a thin client for focused System One judgments. It does not generate prose, perform arithmetic, compare dates, or replace application-level validation. Keep deterministic work in code and use Jev for semantic judgments.
|
|
279
393
|
|
|
280
|
-
The CLI sends the supplied state and questions to the
|
|
394
|
+
The CLI sends the supplied state and questions to the selected provider. Do not submit data that your organization is not permitted to send to that service.
|
|
281
395
|
|
|
282
396
|
## License
|
|
283
397
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "jev-cli"
|
|
3
|
-
version = "0.
|
|
4
|
-
description = "Small
|
|
3
|
+
version = "0.6.0"
|
|
4
|
+
description = "Small CLI and stdio MCP server for TypeSafe Jev"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
7
7
|
license-files = ["LICENSE"]
|
|
8
8
|
requires-python = ">=3.13"
|
|
9
|
-
dependencies = []
|
|
10
|
-
keywords = ["typesafe", "jev", "cli", "ai"]
|
|
9
|
+
dependencies = ["mcp>=2.2.0,<3"]
|
|
10
|
+
keywords = ["typesafe", "jev", "cli", "mcp", "ai"]
|
|
11
11
|
classifiers = [
|
|
12
12
|
"Development Status :: 3 - Alpha",
|
|
13
13
|
"License :: OSI Approved :: MIT License",
|
|
@@ -23,6 +23,7 @@ Issues = "https://github.com/tumf/jev-cli/issues"
|
|
|
23
23
|
|
|
24
24
|
[project.scripts]
|
|
25
25
|
jev = "jev_cli:main"
|
|
26
|
+
jev-mcp = "jev_cli.mcp_server:main"
|
|
26
27
|
|
|
27
28
|
[build-system]
|
|
28
29
|
requires = ["uv_build>=0.8.15,<0.9.0"]
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jev-cli
|
|
3
|
-
description: Use when classifying or scoring state with the `jev` CLI.
|
|
3
|
+
description: Use when classifying or scoring state with the `jev` CLI or the `jev-mcp` stdio MCP server.
|
|
4
4
|
version: 0.1.0
|
|
5
5
|
author: tumf
|
|
6
6
|
license: MIT
|
|
7
7
|
metadata:
|
|
8
8
|
hermes:
|
|
9
|
-
tags: [jev, cli, classification, scoring]
|
|
9
|
+
tags: [jev, cli, mcp, classification, scoring]
|
|
10
10
|
related_skills: []
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -16,40 +16,44 @@ metadata:
|
|
|
16
16
|
|
|
17
17
|
Use the `jev` command to ask TypeSafe Jev typed questions about text or JSON state. Prefer this skill when a task needs a compact machine-readable probability, one choice from explicit criteria, an ordered score, or several typed answers in one request.
|
|
18
18
|
|
|
19
|
-
The package and repository are named `jev-cli
|
|
19
|
+
The package and repository are named `jev-cli`. `uv tool install jev-cli` installs two commands: `jev` for the shell and `jev-mcp` for MCP hosts. No optional extra is required.
|
|
20
|
+
|
|
21
|
+
When the host already has the `jev` MCP server connected, call its `noul`, `choice`, `score`, or `run` tool instead of shelling out. Use the `jev` command otherwise.
|
|
20
22
|
|
|
21
23
|
Install this bundled skill with `jev install-skills`. Add `--global` for the user-wide target and `--claude` for Claude skill directories.
|
|
22
24
|
|
|
23
25
|
## Workflow
|
|
24
26
|
|
|
25
27
|
1. Confirm the command is installed with `jev --version`. If it is missing, install from the repository root with `make install`. Completion: `jev --version` exits successfully.
|
|
26
|
-
2. Confirm key availability with `jev auth status`, then use `jev auth test` when API validity must be verified. If absent or invalid, ask the user to configure
|
|
28
|
+
2. Confirm key availability with `jev auth status`, then use `jev auth test` when API validity must be verified. If absent or invalid, ask the user to configure the selected provider's API key; never print, infer, or commit it. Completion: the selected command returns `ok: true`.
|
|
27
29
|
3. Choose the narrowest question type:
|
|
28
30
|
- `noul` for a yes/no probability.
|
|
29
31
|
- `choice` for one key from explicit options.
|
|
30
32
|
- `score` for an ordered numeric level.
|
|
31
33
|
- `run` for a complete request object or multiple questions.
|
|
32
|
-
4. Send only the state needed for the judgment.
|
|
34
|
+
4. Send only the state needed for the judgment. The selected provider receives the submitted state and questions, so do not send secrets or private data without explicit authorization.
|
|
33
35
|
5. Use default JSON output for automation. Use `--value` only when a scalar is sufficient. Completion: parse the result and account for the exit code before acting on it.
|
|
34
36
|
|
|
35
|
-
Read [references/cli.md](references/cli.md) for copy-paste command forms, inputs, output controls, and
|
|
37
|
+
Read [references/cli.md](references/cli.md) for copy-paste command forms, inputs, output controls, exit codes, and the `jev-mcp` stdio server configuration.
|
|
36
38
|
|
|
37
39
|
## Decision rules
|
|
38
40
|
|
|
39
41
|
- Give `choice` options stable keys and descriptions that make the categories mutually understandable.
|
|
40
42
|
- Give `score` levels in ascending order; the returned number may be fractional.
|
|
41
43
|
- Use `--json-state` only when the state must retain JSON structure.
|
|
42
|
-
- Use `@file` or stdin for long input instead of embedding it in shell arguments.
|
|
43
|
-
-
|
|
44
|
+
- Use `@file` or stdin for long input instead of embedding it in shell arguments. These forms are CLI-only: the MCP tools send `state` verbatim, so read the file in the host and pass its content.
|
|
45
|
+
- The official TypeSafe API is the default. Use `--provider vercel`, `--provider openrouter`, or `--provider custom` only when the caller selects another provider.
|
|
46
|
+
- Use the provider-specific environment variable only for process-level overrides: `TYPESAFE_API_KEY`, `AI_GATEWAY_API_KEY`, `OPENROUTER_API_KEY`, or `JEV_API_KEY`. A custom provider also requires `JEV_ENDPOINT`; `JEV_MODEL` is optional. The normal credential store remains under the user's config directory.
|
|
44
47
|
- Treat model output as a structured judgment, not verified fact. Keep consequential actions behind the caller's own validation and authorization rules.
|
|
45
48
|
|
|
46
49
|
## Common pitfalls
|
|
47
50
|
|
|
48
|
-
1. **Calling the executable `jev-cli`.** The package is `jev-cli`, but the
|
|
51
|
+
1. **Calling the executable `jev-cli`.** The package is `jev-cli`, but the executables are `jev` and `jev-mcp`.
|
|
49
52
|
2. **Using `--value` with `run`.** Batched requests require the JSON response.
|
|
50
53
|
3. **Treating transport failures as negative answers.** Exit code `4` means retryable API or network failure, not a model judgment.
|
|
51
54
|
4. **Leaking state through convenience.** Inspect file and stdin content before submission when it may contain credentials or private records.
|
|
52
55
|
5. **Embedding an API key in examples.** Use `jev auth set` through stdin or the environment variable without writing its value into scripts or documentation.
|
|
56
|
+
6. **Running `jev-mcp` by hand.** Its stdin and stdout carry MCP protocol frames; start it only from an MCP host configuration.
|
|
53
57
|
|
|
54
58
|
## Verification checklist
|
|
55
59
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# CLI reference
|
|
1
|
+
# CLI and MCP reference
|
|
2
2
|
|
|
3
3
|
## Authentication
|
|
4
4
|
|
|
@@ -28,10 +28,35 @@ printf '%s' "$TYPESAFE_API_KEY" | jev auth set
|
|
|
28
28
|
|
|
29
29
|
Resolution order:
|
|
30
30
|
|
|
31
|
-
1. `TYPESAFE_API_KEY`
|
|
31
|
+
1. The selected provider's environment variable: `TYPESAFE_API_KEY`, `AI_GATEWAY_API_KEY`, `OPENROUTER_API_KEY`, or `JEV_API_KEY`
|
|
32
32
|
2. `$XDG_CONFIG_HOME/jev-cli/credentials.json`
|
|
33
33
|
3. `~/.config/jev-cli/credentials.json`
|
|
34
34
|
|
|
35
|
+
The official TypeSafe API is selected by default. Vercel AI Gateway and OpenRouter can be selected per command:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
jev auth set --provider vercel
|
|
39
|
+
jev auth test --provider vercel
|
|
40
|
+
jev noul --provider vercel -q 'Is this urgent?' -s 'Restore service today.' --value
|
|
41
|
+
|
|
42
|
+
jev auth set --provider openrouter
|
|
43
|
+
jev auth test --provider openrouter
|
|
44
|
+
jev noul --provider openrouter -q 'Is this urgent?' -s 'Restore service today.' --value
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`JEV_PROVIDER` changes the default for evaluation commands. Authentication commands require an explicit `--provider` so credentials are not accidentally stored or tested against the wrong service.
|
|
48
|
+
|
|
49
|
+
For a proxy implementing the native Jev contract:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
JEV_PROVIDER=custom \
|
|
53
|
+
JEV_ENDPOINT='https://proxy.example.com/v1/systemone' \
|
|
54
|
+
JEV_API_KEY='your-proxy-api-key' \
|
|
55
|
+
jev noul -q 'Is this urgent?' -s 'Restore service today.' --value
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Set `JEV_MODEL` or pass `--model` when the proxy requires a different model name. Use only a trusted HTTPS endpoint because the custom bearer key is sent to it.
|
|
59
|
+
|
|
35
60
|
## Typed questions
|
|
36
61
|
|
|
37
62
|
Use `-q` for `--question` and `-s` for `--state` when a shorter command is useful. `--value` has no short form.
|
|
@@ -121,6 +146,49 @@ jev noul --question 'Does this require action?' --state 'Please investigate.' --
|
|
|
121
146
|
|
|
122
147
|
Read stderr as JSON on failure. Do not interpret a nonzero exit as a model answer.
|
|
123
148
|
|
|
149
|
+
## MCP server
|
|
150
|
+
|
|
151
|
+
`jev-mcp` is a stdio MCP server installed by the same package; no optional extra is required. It exposes four tools that mirror the CLI commands:
|
|
152
|
+
|
|
153
|
+
| Tool | Purpose | Required inputs |
|
|
154
|
+
|---|---|---|
|
|
155
|
+
| `noul` | One yes/no judgment with a probability | `state`, `question` |
|
|
156
|
+
| `choice` | One selection from a typed option map | `state`, `question`, `options` |
|
|
157
|
+
| `score` | One evaluation against ordered levels | `state`, `question`, `levels` |
|
|
158
|
+
| `run` | A complete multi-question System One request | `request` |
|
|
159
|
+
|
|
160
|
+
Each tool also accepts optional `provider`, `model`, and `endpoint` arguments. Provider selection, model defaults, endpoint resolution, credential lookup, and response normalization are identical to the CLI, so `JEV_PROVIDER`, the provider environment variables, and the credential store all apply unchanged.
|
|
161
|
+
|
|
162
|
+
Minimal stdio host configuration:
|
|
163
|
+
|
|
164
|
+
```json
|
|
165
|
+
{
|
|
166
|
+
"mcpServers": {
|
|
167
|
+
"jev": {
|
|
168
|
+
"command": "jev-mcp"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Select a non-default provider through the host's environment block:
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"mcpServers": {
|
|
179
|
+
"jev": {
|
|
180
|
+
"command": "jev-mcp",
|
|
181
|
+
"env": {
|
|
182
|
+
"JEV_PROVIDER": "openrouter",
|
|
183
|
+
"OPENROUTER_API_KEY": "your-api-key"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
`state` is sent verbatim. `-` does not read stdin and a leading `@` does not read a file, because stdin carries the MCP protocol frames. Invalid input and provider failures return MCP tool errors without the API key, and stdout carries protocol frames only.
|
|
191
|
+
|
|
124
192
|
## Installation
|
|
125
193
|
|
|
126
194
|
From the repository root:
|