Skip to main content

Shared core for Paradigx product CLIs — OAuth device-flow, token cache, HTTP client

Project description

paradigx-cli-core

Shared core for Paradigx product CLIs (botu, tokenroute, ...).

This is a library, not a CLI — it has no command entry point. Product CLIs depend on it and keep only their command layer.

What it provides

  • OAuth device-flow login against Logto (auth, device_flow)
  • Shared token cache at ~/.paradigx/auth.json, keyed by API URL, so one login is reused across every Paradigx CLI (config)
  • Automatic JWT refresh — cached tokens are transparently renewed via the stored refresh token (auth.valid_access_token)
  • HTTP client with per-product trailing-slash / redirect handling (client)
  • --json output helpers — rich tables for humans, JSON for agents (output)

Usage (by a product CLI)

from paradigx_cli_core import do_login, valid_access_token, request

# login
do_login("https://botu.io/api/auth/discovery/", "https://botu.io",
         on_code=lambda c: print("visit", c.verification_uri_complete))

# authenticated call (auto-refreshes the token)
token = valid_access_token("https://botu.io")
sites = request("GET", "https://botu.io", "/api/sites",
                token=token, trailing_slash=True)

See docs/specs/cli-phase-b.md in the workspace repo for the design.


© 2026 Paradigx. All Rights Reserved.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paradigx_cli_core-0.1.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paradigx_cli_core-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file paradigx_cli_core-0.1.0.tar.gz.

File metadata

  • Download URL: paradigx_cli_core-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for paradigx_cli_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 47e6761e3cda79fe3bbf915e939e577203ae5fd5b77259f8a79eeae00795f595
MD5 c82f400b0377e0aedcd36fdb2ca76d0c
BLAKE2b-256 e0be05c00d9e550bd6217af3449714d95003478b5edd3eeb498acf922eb4c778

See more details on using hashes here.

File details

Details for the file paradigx_cli_core-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for paradigx_cli_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d90598c9dcb7e296b4fd7bfafce9ee9564226dee61197baa346ef143fa73251a
MD5 5e10280dc47623ce84f3bd2c189438fa
BLAKE2b-256 cbc4f4f1b0f7d4e1ccd36a79a5843e6caf2c4d4d105fc35937cd73584f2e805b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page