feat(cli): add a lightweight hikctl db init instead of pointing operators at full host provisioning #41
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#41
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Follow-up from the code review of #39 (comment #issuecomment-884). Non-blocking; #39 merged with this known.
#39 originally called
init_db()at the top of everyhikctl usercommand. That was removed becauseinit_db()carries side effects well beyond schema creation — it seeds default-credential accounts and resetsexclude_from_rankingson verified-sensor doors. The replacement catchessqlite3.OperationalErrorand prints:app/cli/commands/cmd_user.py:212-214Problem
That guidance works but is disproportionate.
init_db()is reachable only fromapp/main.py:35(the FastAPI lifespan), so the shortest supported route to "create my schema" ishikctl setup, which also runs host diagnostics, creates a virtualenv, writes.env, sets directory ACLs, configures the firewall, registers a system service and starts it (app/cli/commands/cmd_setup.py:45-215).An operator who only wants to provision the first admin account on a fresh box has to run full host provisioning to get there.
Proposed solution
Add a narrow
hikctl db init(or similar) that creates the schema and nothing else, and point the error message at it. Keep the seeding and flag-cleanup side effects out of that path, or make them explicit opt-ins (--seed-defaults), so the two problems fixed in #39 cannot return through a different door.Acceptance criteria
door_records.cmd_user.py's uninitialized-database message names that command.hikctl user addsucceeds.test_user_command_does_not_resurrect_deleted_user,test_user_command_does_not_wipe_door_exclusions) still pass.gabogg referenced this issue2026-09-21 18:35:05 +00:00
Ready to implement — delivered in PR #45 (
Closes #41). Re-taggedready-for-agent; auto-closes on merge.