Context
When a user runs kontext start for the first time in a project, there's no .env.kontext file. The CLI needs to figure out which providers to resolve credentials for. Today this file is manually created — the user should never have to do that.
Possible flows
Option A: Auto-populate from backend, no prompt
- CLI fetches the org's configured providers from the backend
- Writes
.env.kontext with all of them (or a sensible default subset)
- Resolves credentials — skips any that aren't connected yet
- User commits the file, team shares it
Pro: Zero friction, instant start.
Con: May include providers the project doesn't need. File becomes org-level, not project-level.
Option B: Auto-populate from backend, ask the user to confirm
- CLI fetches available providers
- Shows them: "These providers are available: GitHub, Linear, Slack. Which ones does this project need?"
- User selects, CLI writes
.env.kontext
Pro: Project-specific. Clean .env.kontext.
Con: Extra step on first run. Interactive prompt may not work in all environments (CI, etc.).
Option C: Fetch connected providers only
- CLI fetches only providers the current user has already connected in the dashboard
- Writes
.env.kontext with those
- No prompt needed — if you connected it, you probably want it
Pro: Simple, no prompt. Only includes things the user actively set up.
Con: Different users may get different .env.kontext files. Doesn't capture project requirements.
Option D: Start with a hardcoded default set
- CLI writes
.env.kontext with a default set (e.g. GitHub, Linear) without calling the backend
- User edits if they need more or fewer
Pro: Simplest to implement. Works offline.
Con: Doesn't scale, not personalized.
Option E: Hybrid — auto-populate, then let the user edit via kontext providers
- First run: auto-populate from backend (option A or C) silently
- Provide a
kontext providers command to add/remove/list providers interactively later
kontext start always reads the file as-is
Pro: Fast first run + escape hatch for customization.
Con: Two commands to learn.
Open questions
- Should
.env.kontext be project-scoped (committed) or user-scoped (gitignored)?
- If committed, how do we handle different users having different providers connected?
- Should the CLI auto-create the file or require explicit
kontext init?
- What about CI environments where there's no interactive prompt?
- How does the env var naming work? The backend knows the provider handle (
github) but the env var name (GITHUB_TOKEN) is a project concern — who decides that mapping?
Context
When a user runs
kontext startfor the first time in a project, there's no.env.kontextfile. The CLI needs to figure out which providers to resolve credentials for. Today this file is manually created — the user should never have to do that.Possible flows
Option A: Auto-populate from backend, no prompt
.env.kontextwith all of them (or a sensible default subset)Pro: Zero friction, instant start.
Con: May include providers the project doesn't need. File becomes org-level, not project-level.
Option B: Auto-populate from backend, ask the user to confirm
.env.kontextPro: Project-specific. Clean
.env.kontext.Con: Extra step on first run. Interactive prompt may not work in all environments (CI, etc.).
Option C: Fetch connected providers only
.env.kontextwith thosePro: Simple, no prompt. Only includes things the user actively set up.
Con: Different users may get different
.env.kontextfiles. Doesn't capture project requirements.Option D: Start with a hardcoded default set
.env.kontextwith a default set (e.g. GitHub, Linear) without calling the backendPro: Simplest to implement. Works offline.
Con: Doesn't scale, not personalized.
Option E: Hybrid — auto-populate, then let the user edit via
kontext providerskontext providerscommand to add/remove/list providers interactively laterkontext startalways reads the file as-isPro: Fast first run + escape hatch for customization.
Con: Two commands to learn.
Open questions
.env.kontextbe project-scoped (committed) or user-scoped (gitignored)?kontext init?github) but the env var name (GITHUB_TOKEN) is a project concern — who decides that mapping?