Command-line client

The Jurisdictional API, from your terminal.

jurisdictional is the command-line client for the Jurisdictional HTTP API. Give it an address and it lists the governments that cover it.

The release carries its own Erlang runtime, so there is nothing else to install. The CLI is open source under the Apache License 2.0.

Install

$ curl -fsSL https://github.com/jurisdictional/jurisdictional-cli/releases/latest/download/install.sh | sh
$ jurisdictional juricode "Vacaville, CA"

The script checks the checksum, puts the release in ~/.local/share/jurisdictional, links jurisdictional into ~/.local/bin, and confirms it runs.

To install by hand, download jurisdictional-<platform>.tar.gz from the releases page, unpack it, and run jurisdictional/bin/jurisdictional.

Platforms

  • Linux, x86_64 and arm64.
  • Apple silicon Macs.

Linux needs glibc 2.35 or newer and OpenSSL 3, as on Ubuntu 22.04, Debian 12, and Fedora 36 and later. On other systems, build from source.

Sign in

juricode works with no account. Routes that need a token ask you to sign in.

jurisdictional login opens the browser, prints a short code, and waits for you to approve it at jurisdictional.org/device. The CLI never asks for your password.

For a terminal that cannot wait, --paste redeems the refresh token the approval page shows once.

$ jurisdictional login
$ jurisdictional login --paste

Examples

The verbs cover the JSON API. tool calls whatever /api/mcp/tools lists, and api sends any other path.

jurisdictional juricode "Vacaville, CA"

Every jurisdiction that covers the address, from the United States down to the school district.

jurisdictional agencies list --jurisdiction 70118

The departments and offices of one jurisdiction. 70118 is the City of Vacaville. agencies takes a jurisdiction id, not a place name, so run juricode first to find it.

jurisdictional tool search_jurisdictions --query Vacaville

Call an MCP tool by name, with its arguments as flags.

jurisdictional --save out juricode "Vacaville, CA"

Write the response body into out and add an entry to out/index.json naming the method, path, query, status, and file. Another app can read the index and open the file.

In GitHub Actions

examples/juricode-workflow.yml installs the CLI and runs juricode for an address. The job fails when the command exits with anything other than 0.

Copy it to .github/workflows/ in your repository. Each release also attaches it as juricode-workflow.yml.

jobs:
  juricode:
    runs-on: ubuntu-latest
    steps:
      - name: Install jurisdictional
        run: curl -fsSL https://github.com/jurisdictional/jurisdictional-cli/releases/latest/download/install.sh | sh

      - name: Look up the address
        env:
          ADDRESS: ${{ inputs.address }}
        run: |
          status=0
          "$HOME/.local/bin/jurisdictional" --json juricode "$ADDRESS" > juricode.json || status=$?

An excerpt. The full file also checks the exit status and uploads the response.

More