--- name: dj-cli description: Reads DocJacket transactions, deadlines, tasks, documents and contacts through the `dj` command-line tool when the agent has a shell, answering from dj's JSON output and carrying transaction ids between commands. Use when the agent can run shell commands and the user asks about their DocJacket data. Chat clients without a shell use the DocJacket MCP tools instead. license: MIT --- # DocJacket via the `dj` CLI `dj` reads DocJacket through its public API. It is **read-only**: it cannot send, change, or delete anything. **Use it only when you can run shell commands and `dj --version` works; otherwise use the DocJacket MCP tools** (for example `find_transaction_by_property`, `get_next_required_actions`). Never install `dj` yourself. Installing it is the user's choice: the installer script is published at `https://cdn.docjacket.com/dj/install.sh` for them to review and run, and the API key comes from Settings › API & AI Access (set as `DJ_API_KEY`). Once it is set up, `dj auth status` confirms the key works. ## The core loop ```bash dj transactions resolve "412 Oak" # a property the user mentioned → one transaction id dj transactions get # status, parties, price, key dates dj next-actions --transaction # what needs attention, ranked by DocJacket ``` - **Ambiguous resolve (exit 7):** show the user the `candidates` and ask which one. Never pick one yourself. - **No match (exit 6):** resolve only knows addresses. For a person's name, use `dj transactions list --query "Johnson"`. - **Ranking:** trust `next-actions`' ranking and urgency tiers; do not re-rank. ## Other reads ```bash dj transactions list --status active --limit 10 # --status is case-insensitive; `dj transactions statuses` lists names dj transactions missing-docs # required documents not yet on file dj transactions contingencies dj transactions communications --channel email --limit 5 dj key-dates list --transaction dj key-dates upcoming --days 7 dj tasks list --transaction # every open task plus checklist counts dj documents list --transaction dj documents url # signed link, ~1 hour; never paste it anywhere public dj contacts search "Jerry Mitchell" dj contacts by-email jerry@example.com dj contacts get ``` Every command has `--help`. `--full` (where offered) prints the raw API response; prefer the compact default. ## Reading results - **stdout:** one JSON document per command. - **stderr, on failure:** `{"error":{"code","message","hint"}}`. Follow the `hint`. - **Exit codes:** | Code | Meaning | |---|---| | 0 | ok | | 2 | bad arguments or config | | 3 | invalid input | | 4 | DJ_API_KEY missing or rejected | | 5 | key lacks the scope | | 6 | not found | | 7 | ambiguous; ask the user | | 8 | rate limited; wait `retryAfterSeconds` | | 9 | server error | | 10 | network error | - **An unknown transaction id is exit 6**, never an empty "nothing to do". - **Paging:** lists say `hasMore` / `truncated`. Page or raise `--limit` only if the user needs more.