Repository navigation
Add halvorai-ingest init: register a source without Node.js - #6
Merged
Merged
Conversation
`halvorai-ingest init` (and `python -m halvorai_ingest init`) generates an Ed25519 source key, registers its public half with POST /v1/sources, writes HALVOR_API_KEY and HALVOR_SOURCE_KEY to .env.local, sends one test event and prints the dashboard link, matching `npx @halvorai/ingest init`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CpycUbSFBBfQHu8wK6MHGC
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CpycUbSFBBfQHu8wK6MHGC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Waleed · project thread
Why
Before a Python user can send events, they need a registered source key. Until now the only way to make one was
npx @halvorai/ingest init, which requires Node.js. The dashboard can't register one either, and the README wrongly said it could.What changed
halvorai-ingest init(a console script, orpython -m halvorai_ingest init) andrun_init()work the same way as the Node.jsinit:POST /v1/sourcesHALVOR_API_KEYandHALVOR_SOURCE_KEY(withkidset to the source id) to.env.local, leaving other lines aloneHALVOR_ENDPOINTtoo, but only when an endpoint was chosen--api-key, which falls back toHALVOR_API_KEYand then a hidden prompt. Also--endpoint,--name,--cwdand--dashboard. The command exits with 1 and a one-line message on failure.Tests
tests/test_init.pyhas 8 new tests. They cover:.env.localcontentsuv run mypy: clean.uv run pytest -q: 143 passed on 3.12 and on 3.10.Generated by Claude Code