Skip to content

hjs-spec/cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

JEP CLI

Command-line interface for JEP: A Judgment Event Protocol.

Status License Issues npm version


Overview

JEP CLI is a command-line tool for interacting with the JEP protocol. It allows you to:

  • Create and manage judgment records
  • Delegate authority to other entities
  • Terminate responsibility chains
  • Verify records and receipts
  • Configure API access

Installation

Via npm (recommended)

npm install -g @jep/cli

From source

git clone https://github.com/jep-protocol/cli.git
cd cli
npm install
npm link

Quick Start

1. Configure your API key

hjs config set api-key YOUR_API_KEY

If you're using a self-hosted HJS API instance, you can also set the API URL:

jep config set api-url https://your-jep-instance.com

2. Create a judgment record

jep judgment create \
  --entity user@example.com \
  --action approve \
  --scope '{"amount": 1000, "currency": "USD"}'

3. Query a record

jep judgment get jgd_1234567890abcd

4. Verify a record

jep verify jgd_1234567890abcd

Commands

jep judgment

Manage judgment records.

Command Description
create Create a new judgment record
get <id> Retrieve a judgment by ID
list List judgment records (with filters)
export Export judgment records

Options:

  • --entity, -e - Entity identifier (required for create)
  • --action, -a - Action name (required for create)
  • --scope, -s - JSON scope/context
  • --timestamp, -t - Custom timestamp (ISO 8601)
  • --immutability, -i - Anchor type (ots, none)
  • --format, -f - Output format (json, text)

jep delegation

Manage delegations.

Command Description
create Create a new delegation
get <id> Retrieve a delegation by ID
list List delegations
revoke <id> Revoke a delegation

jep termination

Manage terminations.

Command Description
create Create a termination record
get <id> Retrieve a termination by ID
list List terminations

jep verify

Verify records and receipts.

Command Description
<id> Verify a record by ID
receipt <file> Verify a receipt file

jep config

Manage CLI configuration.

Command Description
set <key> <value> Set a configuration value
get <key> Get a configuration value
list List all configuration
clear Clear configuration

Configuration is stored in ~/.jep/config.json.

Examples

Create a judgment with scope

jep judgment create \
  --entity loan-officer-123 \
  --action approve_loan \
  --scope '{"amount": 50000, "risk_score": 0.12, "customer_id": "cust_789"}'

Delegate authority

# Create a judgment first
JUDGMENT_ID=$(jep judgment create --entity manager@company.com --action "delegate_access" --quiet)

# Delegate to an employee
jep delegation create \
  --delegator manager@company.com \
  --delegatee employee@company.com \
  --judgment-id $JUDGMENT_ID \
  --scope '{"permissions": ["read", "write"]}' \
  --expiry "2026-12-31T23:59:59Z"

Verify a record with receipt

# Download receipt
jep judgment get jgd_1234567890abcd --format receipt > record.ots

# Verify offline
jep verify receipt record.ots

Configuration

The CLI can be configured via:

  1. Command-line arguments (highest priority)
  2. Environment variables
  3. Config file (~/.jep/config.json)

Environment variables

Variable Description
JEP_API_URL API endpoint (default: https://api.jep.sh)
JEP_API_KEY API key for authentication
JEP_OUTPUT Default output format (json, text)

Config file example

{
  "apiUrl": "https://api.jep.sh",
  "apiKey": "your-api-key-here",
  "output": "text",
  "defaults": {
    "immutability": "none"
  }
}

Development

Setup

git clone https://github.com/jep-protocol/cli.git
cd cli
npm install

Testing

npm test

Building

npm run build

Contributing

Please see our Contributing Guide and Code of Conduct.

Related Repositories

License

MIT © HJS Ltd.


© 2026 HJS Foundation Ltd.
This document is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors