Skip to main content

CLI Reference

LSJI includes a comprehensive CLI for RL agents, LLM agents, runtime server, and plugins.

Installation​

# Global install
npm install -g @game_ryo/lsji

# Or use npx
npx @game_ryo/lsji --help

RL Agent Commands (Legacy)​

lsji train​

Train the RL agent.

lsji train [options]
OptionDescriptionDefault
--episodes <n>Number of training episodes200
--pattern <0-3>Training pattern0
--batch-size <n>Database batch size200
--opponent <type>Opponent strategyrandom
--storage <type>Storage backendsqlite
--db-path <path>Database file path./lsji.db
--alpha <n>Learning rate0.1
--gamma <n>Discount factor0.9
--epsilon <n>Exploration rate0.1
--jsonOutput as JSONfalse

Training Patterns: 0=Random, 1=Always Rock, 2=Counter, 3=Sequential

lsji play​

Play a single game against the RL agent.

lsji play --hand <0|1|2> [options]
OptionDescription
--hand <0|1|2>Your hand: 0=Rock, 1=Scissors, 2=Paper
--opponent <type>Opponent strategy
--storage <type>Storage backend
--db-path <path>Database file path
--jsonOutput as JSON

lsji status​

Show RL system status.

lsji status [options]

lsji start / lsji stop​

Enable/disable RL training loop.

lsji start
lsji stop

LLM Agent Commands (v0.3+)​

lsji agent run​

Run an LLM agent on a task.

lsji agent run --task "Your task description" [options]
OptionDescriptionDefault
--task <string>Task description(required)
--provider <name>LLM provider: gemini, openai, anthropic, localopenai
--model <name>Model namegpt-4o-mini
--api-key <key>API key (or use env var)-
--max-cost <n>Max cost per run (USD)10
--max-tokens <n>Max tokens per run100000
--hitl <true|false>Enable HITL approvalstrue
--hitl-timeout <ms>Approval timeout300000
--conversation <tf>Enable conversation memorytrue
--semantic <tf>Enable semantic memoryfalse
--episodic <tf>Enable episodic memorytrue
--hitl-required <list>Comma-separated tools needing approvalfile_write,api_call,send_email,code_exec
--max-steps <n>Max agent steps50
--jsonOutput as JSONfalse

Examples:

# Simple task with Gemini
lsji agent run --task "Summarize TypeScript best practices" --provider gemini --model gemini-1.5-flash

# With budget limits
lsji agent run --task "Research AI trends" --max-cost 5 --max-tokens 50000

# Disable HITL for automation
lsji agent run --task "Read config file" --hitl false

lsji agent run-durable​

Run with checkpointing (resumable after crash).

lsji agent run-durable --task "Your task" [options]
OptionDescriptionDefault
--workflow-id <id>Workflow identifierauto-generated
--checkpoint-every <n>Checkpoint every N steps3
--resume-from <id>Resume from checkpoint ID-

Example:

# Durable run
lsji agent run-durable --task "Analyze codebase" --workflow-id my-analysis

# Resume after crash
lsji agent run-durable --task "Analyze codebase" --resume-from checkpoint_abc123

lsji agent status​

Show agent configuration status.

lsji agent status [--json]

Budget Commands​

lsji budget status​

lsji budget status [--budgetId <id>] [--json]

lsji budget check​

Check if operation is within budget.

lsji budget check --cost <n> --tokens <n> [--budgetId <id>] [--json]

lsji budget reset​

Reset run budget.

lsji budget reset [--budgetId <id>]

HITL Commands​

lsji hitl list​

List pending approvals.

lsji hitl list [--limit <n>] [--json]

lsji hitl approve​

Approve a pending request.

lsji hitl approve --id <approval-id> [--reason <string>] [--decider <name>] [--json]

lsji hitl reject​

Reject a pending request.

lsji hitl reject --id <approval-id> --reason <string> [--decider <name>] [--json]

lsji hitl status​

Show approval status.

lsji hitl status --id <approval-id> [--json]

Checkpoint Commands​

lsji checkpoint list​

List workflows with checkpoints.

lsji checkpoint list [--json]

lsji checkpoint show​

Show checkpoints for a workflow.

lsji checkpoint show --workflowId <id> [--json]

lsji checkpoint recover​

Recover from latest checkpoint.

lsji checkpoint recover --workflowId <id> [--json]

Idempotency Commands​

lsji idempotency cleanup​

Clean expired keys.

lsji idempotency cleanup

lsji idempotency list​

List keys for an operation.

lsji idempotency list --operation <name> [--limit <n>] [--json]

Server Commands​

lsji serve​

Start the runtime server with web control panel.

lsji serve [options]
OptionDescriptionDefault
--port <n>Server port3456
--no-uiDisable web UI, API onlyfalse
--storage <type>Storage backendsqlite
--db-path <path>Database file path./lsji.db

Examples:

lsji serve # Start with UI on :3456
lsji serve --port 8080 # Custom port
lsji serve --no-ui # Headless API only

Plugin Commands​

lsji plugin list​

List loaded plugins.

lsji plugin list [--json]

lsji plugin create​

Generate plugin template.

lsji plugin create --name <plugin-name>

lsji plugin load​

Load plugins from directory.

lsji plugin load --path <directory>

Common Options​

OptionDescriptionDefault
--storage <type>Storage: sqlite, better-sqlite, memorysqlite
--db-path <path>Database file path./lsji.db
--jsonOutput as JSONfalse
--help / -hShow help-

Environment Variables​

VariableDescriptionDefault
GEMINI_API_KEYGoogle Gemini API key-
OPENAI_API_KEYOpenAI API key-
ANTHROPIC_API_KEYAnthropic API key-
OLLAMA_HOSTOllama host URLhttp://localhost:11434
LSJI_STORAGEDefault storage backendsqlite
LSJI_DB_PATHDefault database path./lsji.db
LSJI_SERVER_PORTServer port3456

Quick Reference Card​

# RL (Legacy)
lsji train --episodes 500
lsji play --hand 0
lsji status --json

# LLM Agent
lsji agent run --task "Research topic" --provider gemini
lsji agent run-durable --task "Analyze" --workflow-id my-job

# Budget
lsji budget status
lsji budget check --cost 1 --tokens 5000

# HITL
lsji hitl list
lsji hitl approve --id abc --reason "OK"

# Server + UI
lsji serve
lsji serve --port 8080 --no-ui

# Plugins
lsji plugin list
lsji plugin create --name my-tools