honcho/scripts
Anthony Yuan f75b336a3c
feat: add generate_jwt.py script for creating scoped JWTs (#757)
* feat: add generate_jwt.py script for creating scoped JWTs

Adds a CLI utility script for generating Honcho JWTs without needing
to call the /v1/keys API endpoint. Useful for local development and
bootstrapping admin tokens.

Features:
- --admin flag for full-access tokens
- --workspace / --peer / --session flags for scoped tokens
- --expires flag with human-friendly duration syntax (e.g. 5h, 30d, 1y)
- --print-only flag for scripting (outputs bare token)

Examples:
  uv run python scripts/generate_jwt.py --admin
  uv run python scripts/generate_jwt.py --admin --expires 24h
  uv run python scripts/generate_jwt.py --workspace my-ws --expires 30d
  uv run python scripts/generate_jwt.py --workspace my-ws --peer my-peer --expires 1y

* docs: document generate_jwt.py in README auth setup section

* fix: remove t='' override to preserve utc_now_iso default in JWTParams

Per CodeRabbit review: explicitly setting t="" bypasses JWTParams's
default utc_now_iso timestamp, causing tokens for the same scope to
become byte-identical. Omitting t lets the default apply, ensuring
each generated token is unique.

* fix: address JWT script review feedback

* fix: type, lint

---------

Co-authored-by: Rajat Ahuja <rahuja445@gmail.com>
2026-06-09 13:49:55 -04:00
..
__init__.py v1.0.0 Release Candidate (#95) 2025-04-10 13:59:40 -04:00
configure_embeddings.py Make embeddings configurable (#678) 2026-05-14 15:03:35 -04:00
dialectic_cost_calculator.py feat: honcho 3.0, sdks 2.0, excise stainless, update v3 docs, changelogs (#331) 2026-01-22 15:16:28 -05:00
ensure_alembic_tests.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
generate_jwt.py feat: add generate_jwt.py script for creating scoped JWTs (#757) 2026-06-09 13:49:55 -04:00
generate_jwt_secret.py feat: introduce alembic migration verification (#238) 2025-10-23 16:24:35 -04:00
generate_message_embeddings.py fix: use model-aware tokenizer and skip empty messages - DEV-1238 (#647) 2026-05-11 17:22:50 -04:00
jsonl_to_json.py feat: agentic dreamer and agentic dialectic (#309) 2026-01-12 15:12:17 -05:00
migrate_db.py Alembic genesis (#106) 2025-05-13 12:26:58 -04:00
provision_db.py fix: use engine args on both engines in db.py (#147) 2025-06-27 15:26:29 -04:00
run_alembic_tests.py Oolong Benchmark (#323) 2026-02-23 16:55:59 -05:00
test_reasoning_levels.py adding test reasoning levels script (#337) 2026-02-19 15:51:15 -05:00
update_version.py feat: Add get summaries endpoints & Custom Timestamps (#185) 2025-08-12 17:19:53 -04:00