Skip to main content

jev-cli

Follow jev-cli on Product Hunt

A small CLI and stdio MCP server for TypeSafe Jev. Send text or JSON state, ask typed questions, and receive machine-readable noul, choice, or score answers.

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.

Watch the jev-cli terminal demo

Click the thumbnail to watch the 19-second terminal demo.

Screenshots

jev-cli overview

jev-cli terminal judgment result

jev-cli terminal introduction

Unofficial: This is an independent community project. It is not affiliated with, maintained by, or endorsed by TypeSafe AI.

Features

  • Supports all three Jev primitives: noul, choice, and score
  • Sends multiple questions in one request with run
  • Accepts text, JSON, files, and stdin
  • Emits compact JSON by default
  • Can print only the primary value for shell scripts
  • Uses structured stderr errors and meaningful exit codes
  • Ships a stdio MCP server, jev-mcp, in the same installation

Requirements

  • uv
  • An API key for the provider you use. The official TypeSafe API is the default.

uv installs a compatible Python 3.13 or later interpreter when needed.

Install

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.

uv tool install jev-cli

Verify that the command is available:

jev --version

Expected output:

jev 0.8.0

Authentication

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.

export TYPESAFE_API_KEY='your-api-key'
jev auth status

For local use, enter the key at the hidden prompt. auth set does not accept the key as a command-line argument, which keeps it out of process arguments and shell history.

jev auth set
jev auth status
jev auth test

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.

Provider Option API key environment variable Default model
TypeSafe official official TYPESAFE_API_KEY jev-latest
Vercel AI Gateway vercel AI_GATEWAY_API_KEY typesafe-ai/jev
OpenRouter openrouter OPENROUTER_API_KEY typesafe/jev-1.14
Jev-compatible proxy custom JEV_API_KEY JEV_MODEL or jev-latest
Cloudflare Workers AI (Clef) cloudflare CLOUDFLARE_API_TOKEN clef-flash

Store and test a provider-specific key without exposing it in shell history:

jev auth set --provider vercel
jev auth test --provider vercel

jev auth set --provider openrouter
jev auth test --provider openrouter

Run the same judgment through another provider:

jev noul \
  --provider openrouter \
  --question 'Does this message express urgency?' \
  --state 'Please restore service today.' \
  --value

Omitting --provider continues to use the official TypeSafe API. --model can override the provider's default model.

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.

export JEV_PROVIDER=custom
export JEV_ENDPOINT='https://proxy.example.com/v1/systemone'
export JEV_API_KEY='your-proxy-api-key'
export JEV_MODEL='jev-latest' # optional

jev noul -q 'Is this urgent?' -s 'Restore service today.' --value

--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.

Cloudflare Workers AI (Clef)

The cloudflare provider runs Cloudflare's Clef decision models through the Workers AI REST API. clef-flash is the default; select clef with --model clef. No other model is accepted for this provider.

Create a Cloudflare API token with the Workers AI permission (Read and Edit), and set the 32-character account ID. The account ID is not secret and is read from the environment; the token can come from CLOUDFLARE_API_TOKEN or the credential store.

export CLOUDFLARE_ACCOUNT_ID='your-32-character-account-id'
jev auth set --provider cloudflare   # or: export CLOUDFLARE_API_TOKEN='your-api-token'
jev auth test --provider cloudflare

jev noul --provider cloudflare -q 'Is this urgent?' -s 'Restore service today.' --value
jev noul --provider cloudflare --model clef -q 'Is this urgent?' -s 'Restore service today.' --value

The request goes to https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run/@cf/cloudflare/<model>, where <model> is the request's model. A missing or malformed account ID, or an unsupported model, fails before any network access. The CLI unwraps the Workers AI response envelope and prints the same answer keys as the other providers (noul, choice, score, plus probabilities, confidence, and legend when Clef returns them). A response with success other than true, or without a result object with answers, is an error and prints no decisions. run forwards additional request members such as Clef's images unchanged.

For non-interactive automation, piping the key to jev auth set remains supported.

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.

The fallback credential path follows XDG conventions:

  • $XDG_CONFIG_HOME/jev-cli/credentials.json when XDG_CONFIG_HOME is set
  • ~/.config/jev-cli/credentials.json otherwise

The credential directory is created with mode 0700; the file is written atomically with mode 0600.

Quick start

--question and --state also accept the short forms -q and -s. --value has no short form.

Install the bundled Agent Skill

jev-cli currently bundles the jev-cli skill. Install it for the current project or globally:

jev install-skills
jev install-skills --global

Use --claude to target Claude's skill directory instead:

jev install-skills --claude
jev install-skills --global --claude

The command prints JSON. It refreshes only copies it previously installed and refuses to overwrite an unmanaged skill directory.

Ask whether a message expresses urgency. --value prints only the resulting probability from 0 to 1.

jev noul \
  --question 'Does this message express urgency?' \
  --state 'Please restore service today.' \
  --value

Example output:

0.98

Without --value, the command returns the complete API response as JSON, including model and token usage.

jev noul \
  --question 'Does this message express urgency?' \
  --state 'Please restore service today.' \
  --pretty

Question types

Noul: yes/no probability

Use noul for one focused yes/no judgment. The value is the probability that the answer is yes.

jev noul \
  --question 'Does this message request a refund?' \
  --state 'The integration is broken, but I do not want a refund.' \
  --value

Choice: select one option

Use choice when the answer must be one of a known set. Each option uses KEY=DESCRIPTION syntax.

jev choice \
  --question 'Which team should handle this?' \
  --state 'The payment integration keeps failing.' \
  -o 'billing=Payment, charge, or refund issues' \
  -o 'technical=Bugs or integration failures' \
  -o 'other=None of these' \
  --pretty

Score: evaluate ordered levels

Use score for an ordered scale. Levels are numbered from zero in the order supplied.

jev score \
  --question 'How frustrated is the customer?' \
  --state 'This has failed for three days. Please help.' \
  -l 'Calm' \
  -l 'Concerned but civil' \
  -l 'Very angry' \
  --value

Input formats

Standard input

Omit the state or pass - to read it from stdin. This is useful for pipelines and avoids putting sensitive input in shell history.

printf '%s' 'Please resolve this today.' | \
  jev noul --question 'Does this message express urgency?' --value

File input

Prefix a path with @ to read its contents.

jev noul \
  --question 'Does this document mention security risks?' \
  --state @document.txt \
  --value

JSON state

Use --json-state to parse the state as JSON. Instructions can refer to named fields.

printf '%s' '{"message":"Please respond today"}' | \
  jev noul \
  --question 'Does `message` express urgency?' \
  --json-state \
  --value

Images

noul, choice, and score accept --image PATH (-i), repeatable, for PNG or JPEG files. With --image, the state is optional and stdin is not read unless --state is given.

jev noul \
  --question 'Is `image` a receipt?' \
  --image receipt.png \
  --value

Each file is base64-encoded into the request's assets map and referenced from the state as image, image_2, image_3, and so on, in the order given. Text state is kept under text. The request also carries the TypeSafe-Danger-Zone-Images: true header.

The following are rejected before any network access:

  • A JSON state that already contains one of the generated keys (image, image_2, ...). The CLI never replaces your keys; rename them in the state.
  • A file larger than 16 MiB. At most 16 MiB plus one byte of any path is read.
  • A request whose serialized size, base64 image data included, exceeds 32 MiB. Base64 adds about one third, so several large images can exceed this even when each file is under 16 MiB. The same file given more than once is sent once.
  • Anything other than a still PNG or JPEG, including animated PNG.
  • A side outside 280-1568 px, or a pixel count outside 78,400-2,458,624. Images are never resized.
  • A header-only or obviously truncated file: a PNG must have a leading IHDR, non-empty IDAT, and a closing IEND chunk; a JPEG must have a frame header, a scan with data, and an end-of-image marker.

This validation is structural only. The CLI does not decode images: it does not verify PNG checksums, decompress pixel data, or decode JPEG scans, so a corrupt file with intact structure is still sent and the API decides whether it is usable.

Provider support for --image:

Provider --image
official Supported.
custom Sent as above; the proxy must implement the native assets contract.
vercel Sent as above; not verified by this project.
openrouter Rejected. OpenRouter does not accept this encoding. Use --provider official, or build a request that uses OpenRouter Decisions' own image_url state parts and send it with jev run --provider openrouter.
cloudflare Rejected. Use jev run with Clef's images field.

run sends your request JSON as written and performs none of the image checks above.

For requests containing assets, HTTP errors report the status but omit the response body, because it may quote private image data or state.

Batch questions

Jev evaluates questions independently against the same state. Use run to send a complete System One request and avoid one API call per question.

Create request.json:

{
  "state": {
    "message": "The payment integration has failed for three days. Please fix it today."
  },
  "model": "jev-latest",
  "questions": {
    "department": {
      "type": "choice",
      "instructions": "Which team should handle `message`?",
      "criteria": {
        "billing": "Payment, charge, or refund issues",
        "technical": "Bugs or integration failures",
        "other": "None of these"
      }
    },
    "urgent": {
      "type": "noul",
      "instructions": "Does `message` express urgency?"
    }
  }
}

Send it in one request:

jev run request.json --pretty

A request can also be piped through stdin:

cat request.json | jev run - --pretty

MCP server

jev-mcp is a stdio MCP server installed alongside jev. It exposes four tools that map to the CLI commands:

Tool Purpose Required inputs
noul One yes/no judgment with a probability state, question
choice One selection from a typed option map state, question, options
score One evaluation against ordered levels state, question, levels
run A complete multi-question System One request request

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.

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:

{
  "request": {
    "state": {"message": "The invoice is wrong again and I want a refund."},
    "questions": {
      "urgent": {"type": "noul", "instructions": "Does this need a reply today?"},
      "team": {
        "type": "choice",
        "instructions": "Which team should own this?",
        "criteria": {"billing": "Invoice or payment problem", "support": "Product or account problem"}
      },
      "anger": {
        "type": "score",
        "instructions": "How frustrated is the sender?",
        "criteria": ["Calm", "Annoyed", "Angry"]
      }
    }
  }
}

Request members this client does not know are forwarded to the provider unchanged.

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.

Add the server to an MCP host with a minimal stdio entry:

{
  "mcpServers": {
    "jev": {
      "command": "jev-mcp"
    }
  }
}

Pass provider configuration through the host's environment block when the default is not wanted:

{
  "mcpServers": {
    "jev": {
      "command": "jev-mcp",
      "env": {
        "JEV_PROVIDER": "openrouter",
        "OPENROUTER_API_KEY": "your-api-key"
      }
    }
  }
}

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.

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.

Output and automation

The default stdout is one JSON object. Logs and structured errors go to stderr, so stdout can be piped directly into another program.

Use --value with noul, choice, or score when a script needs only the primary answer:

if awk 'BEGIN { exit !(ARGV[1] >= 0.9) }' \
  "$(jev noul --question 'Is this urgent?' --state 'Restore service today.' --value)"; then
  echo urgent
fi

Use --model to select another model available to the account:

jev noul --question 'Is this urgent?' --state 'Restore service today.' \
  --model jev-latest \
  --pretty

Exit codes

Code Meaning
0 Success
1 Unexpected API response or other error
2 Invalid arguments or input
3 Missing or rejected authentication
4 Connection, rate-limit, or transient server error

An error is emitted as JSON on stderr:

{"ok": false, "error": "TypeSafe API key is not stored; run: jev auth set"}

Scope and limitations

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.

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.

License

MIT

Metadata

Release files for jev-cli 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jev-cli 0.8.0
File Size Uploaded Provenance Actions
jev_cli-0.8.0.tar.gz 42.3 kB Without provenance Details for jev_cli-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jev-cli 0.8.0
File Interpreter ABI Platform Actions
jev_cli-0.8.0-py3-none-any.whl Python 3 none any Details for jev_cli-0.8.0-py3-none-any.whl

Total release size: 68.7 kB

Release files / jev_cli-0.8.0.tar.gz

Download URL jev_cli-0.8.0.tar.gz
Size 42.3 kB
Tags Source
SHA-256 checksum
How to use checksums
21b8e1ce5809211621755cc25baf7382ca0f64ea79f5e9b8df136fb68a6402a6
BLAKE2b-256 checksum
How to use checksums
1149049579c92dfd2c2cc2cebb104fbdddeb885ee906c1ba5e41f26c48bb2e96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / jev_cli-0.8.0-py3-none-any.whl

Download URL jev_cli-0.8.0-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88d5b823d46418b80a5b0c49ebbfa8729dc3bfa3cb66099e5181ec7cbc31591b
BLAKE2b-256 checksum
How to use checksums
09b1b15e871bf2fa18f4b578ad0a101268ef99cd80f6192743d3d8ccd684b81a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for jev-cli 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page