Skip to content

feat(init): ask to link org during hm init (CLI-39)#110

Merged
markovejnovic merged 5 commits into
mainfrom
marko/cli-39-hm-init-should-ask-the-user-if-they-want-to-link-orgs
Jun 10, 2026
Merged

feat(init): ask to link org during hm init (CLI-39)#110
markovejnovic merged 5 commits into
mainfrom
marko/cli-39-hm-init-should-ask-the-user-if-they-want-to-link-orgs

Conversation

@markovejnovic

Copy link
Copy Markdown
Contributor

Summary

  • Adds a cloud organization linking flow to hm init — after template selection (TTY-only), users can register their repo with Harmont Cloud
  • If not logged in, offers to trigger the browser-loopback login flow first
  • On org selection, writes a sparse .hm/config.toml with backend = "cloud" and the org slug
  • hm run automatically prefers cloud when the project config is present (existing figment layering, no hm run code changes needed)
  • Exposes login_interactive() from hm-plugin-cloud for embedding in host commands

UX Flow

Logged in:

Link this repo to Harmont Cloud?:
> No, skip
  Foo Org (foo-org)
  Harmont-Dev (harmont-dev)

Not logged in:

You are not logged in to Harmont Cloud. Log in now? [y/N]

→ If yes, opens browser login, then shows org selector above.

Test plan

  • Non-interactive init (--template rust, no TTY) skips cloud registration — no config.toml created
  • Sparse cloud project config round-trips through figment correctly
  • Existing config layering test confirms backend = "cloud" in project file wins over user-level backend = "docker"
  • All 24 existing init tests still pass
  • Clippy clean

Closes CLI-39
Closes #108

@markovejnovic markovejnovic merged commit 6ec49ef into main Jun 10, 2026
17 checks passed
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.

hm init should ask the user if they want to link orgs

1 participant