Skip to content

Configure a device one question at a time - #22

Merged
gustmrg merged 1 commit into
mainfrom
feat/setup
Oct 21, 2026
Merged

gustmrg merged 1 commit into
mainfrom
feat/setup

Conversation

@gustmrg

@gustmrg gustmrg commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Summary

Adds devlog setup, an interactive command that configures DevLog on a device one question at a time, instead of a list of devlog config set commands.

Changes

  • Ask what the device is for (work machine, always-on machine, or both) and then only what that role needs:
    • every role: device name, time zone (detected from the system), and ticket key pattern
    • work machine: repository folders (reporting how many repositories it found), commit emails (suggested from the repositories' Git config), the opencode executable as a full path so scheduled runs find it, and the Claude Code transcripts folder when it is not the default
    • always-on machine: the GitHub account, after checking for a token; a token that only lives in the shell's environment can be saved to ~/.devlog/collect.env for scheduled runs
  • Show the current or detected value in brackets, ask again on invalid answers, and accept none to leave out optional values
  • Save the answers, then offer, one confirmation at a time, to connect the data repository, schedule collection on weekdays (12:15/18:15 or 12:20/18:20 by role), install the MCP service on Linux, and run a test collection that saves nothing
  • Refuse to run outside a terminal and point to devlog init and devlog config set
  • Extract initRemote and installMCPService so setup reuses remote init and mcp install
  • devlog init and both installers now point to devlog setup; README, command reference, and device guide describe it

Fixes

  • store.Initialize loaded its defaults over an existing configuration in memory. devlog init never saved afterwards, but any later save, such as setup's, would have overwritten settings like the remote and LLM configuration. It now leaves an existing configuration alone.

Verification

  • go test -race ./... (scripted setups for both roles, existing settings kept, interrupted setup saves nothing, env file updates)
  • Ran devlog setup in a pseudo-terminal against real repositories, Claude Code transcripts, and opencode, with a test collection
  • GOOS=windows go vet ./...

devlog setup asks what the device is for and then only what that role
needs: repository folders, commit emails, and the opencode executable on
a work machine; the GitHub account, after checking for a token, on an
always-on machine. Each question shows the current or detected value and
asks again when an answer is invalid, and none leaves out an optional
value. The answers are saved before setup offers to connect the data
repository, schedule collection, install the MCP service, and run a test
collection, each after a confirmation.

Initialize no longer loads its defaults over an existing configuration,
which would have let any later save, such as setup's, overwrite settings
it did not ask about. init and the installers now point to setup.
@gustmrg
gustmrg merged commit 7a79072 into main Oct 21, 2026
2 checks passed
@gustmrg
gustmrg deleted the feat/setup branch October 21, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant