Product SDKs and the lj command
Use Fix, Shield, Ops, Models, Agents and Comply from your terminal, scripts and CI. The same official SDK you already use for monitoring and Prophecy ships an API client for every product and, for Python and Node.js, the lj command. The SDKs are free; you pay only for the products you use.
| SDK product | lj command | Covers |
|---|---|---|
| Fix SDK | lj fix | FixOps, Vibe Rescue, Test Writer, Migration |
| Shield SDK | lj shield | Pentest, Secret Watch, WAF, Code Review, Dependency Updater, Phishing |
| Ops SDK | lj ops | On-Call Agent, Backups and restore drills, Cost Cutter, Managed Databases |
| Models SDK | lj models | AI Endpoints, Private Endpoints, Fine-Tuning |
| Agents SDK | lj agents | Agent Cloud |
| Comply SDK | lj comply | Compliance Autopilot |
1. Get a key
- Add the SDK product (free) from the Marketplace, next to the products it drives.
- Open Dashboard > API keys, create a key and tick the scopes it needs (
fix,shield, ...). The key starts with
ljk_ and is shown once. A key only works for its own workspace and its own scopes, and you can revoke it any time.
- Store it as a secret in your CI (
LJ_API_KEY). Never commit it.
2. Install
pip install -U linearjeph # Python 3.8+: library + the lj commandnpm install -g https://linearjeph.cc/sdk/linearjeph-sdk-1.3.0.tgz # Node.js 18+: library + the lj commandGo (go get github.com/kingtechies/linearjeph-sdk/[email protected], package products, plus a small cmd/lj for CI), PHP (LinearJeph\Products\Client) and Ruby (Linearjeph::Client) get the same client; see the language pages. Every file is also at https://linearjeph.cc/sdk/ with checksums in SHA256SUMS.
3. Use the command
lj login # saves the key to ~/.config/linearjeph/credentials (mode 0600); or set LJ_API_KEY
lj whoami # workspace and scopes of the key
lj fix run --project 12 --issue "Checkout returns 500 when the cart is empty" --wait
lj fix status 381 | lj fix accept 381 | lj fix rollback 381
lj fix review 12 | lj fix deps 12 | lj fix tests 12
lj shield gate --project 12 --fail-on high # scan, wait, exit 1 on any high or critical finding
lj shield findings --severity medium | lj shield secrets | lj shield pentest 4 --wait | lj shield waf
lj ops status | lj ops incidents | lj ops resolve 77 | lj ops cost
lj ops backup 3 --wait | lj ops drill 3 --wait
lj models list | lj models usage 5 | lj models finetune
lj agents list | lj agents run 7 --wait | lj agents runs 7
lj comply status | lj comply tasks | lj comply recheck | lj comply export --out evidence.zip
lj api GET fixops/jobs --json # any customer route under /api/v1/lj --help and lj <product> --help list every command. Add --json for raw JSON. The key comes from --key, then LJ_API_KEY, then the saved credentials, and is never printed. Exit codes: 0 ok, 1 gate failed or job/scan failed, 2 usage, auth, API or network error.
4. In CI
GitHub Actions, failing the build on high or critical findings and opening a fix when tests fail:
jobs:
security:
runs-on: ubuntu-latest
steps:
- run: pip install -U linearjeph
- run: lj shield gate --project ${{ vars.LJ_PROJECT }} --fail-on high
env:
LJ_API_KEY: ${{ secrets.LJ_API_KEY }}
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm test
- if: failure()
run: pip install -U linearjeph && lj fix run --project ${{ vars.LJ_PROJECT }} --issue "CI failed on ${{ github.sha }}"
env:
LJ_API_KEY: ${{ secrets.LJ_API_KEY }}GitLab CI: script: [pip install -U linearjeph, lj shield gate --project $LJ_PROJECT --fail-on high] with LJ_API_KEY as a masked variable.
5. In code
from linearjeph import Client
lj = Client() # LJ_API_KEY, LJ_BASE_URL
job = lj.fix.create_job(source_id="gh:acme/app", issue="Login fails on Safari")
job = lj.fix.wait(job["id"], timeout=1800) # done, accepted, pr_open, failed, rejected or cancelled
scan = lj.shield.wait_scan(lj.shield.vibe_scan(12)["id"])
blocking = lj.shield.gate(scan, fail_on="high")const { Client } = require("@linearjeph/sdk"); // or import { Client } from "@linearjeph/sdk/products"
const lj = new Client();
const job = await lj.fix.run(12, { issue: "Login fails on Safari" });
await lj.fix.wait(job.id, { timeout: 1800 });Errors are ApiError with status, code and message in every language. GET requests retry on 429 and 5xx (three tries, honouring Retry-After); writes are never retried. See Python, Node.js and Go for the full method lists.