-
Notifications
You must be signed in to change notification settings - Fork 7.8k
feature: interactive setup wizard #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
adamdotdevin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is really great, thank you so much! left some feedback/questions!
|
sorry for the delay @l0gicgate, just wanted to pull this down and run through it myself before merging; should have it merged first thing tomorrow! |
|
No worries @adamdottv, happy to address any other feedback you have before we merge! |
adamdotdevin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pulled this down this morning and ran through it, a few changes needed:
- if you hit
ctrl+cyou're able to exit the setup dialog and get into a weird state where there's nothing to do but close the app and restart - the list of providers/models should use the new
simple-listcomponent (it has vim navigation with j/k as well) - it's not clear to me what "API key" would be for some of the providers like Bedrock and Azure where you have to have AWS/Azure credentials configured in your environment for these to be setup correctly; not sure what we should do here, but we could just display a message when you choose one of those providers (instead of the API key form) that basically tells the user they need to ensure they have AWS/Azure creds setup and then restart the app
- had an inline note about repurposing the provider friendly names
|
can we just remove bedrock and azure from that dialog in the interim? |
|
@adamdottv disabled Bedrock and Vertex from setup wizard via 5a2c093 |
|
@l0gicgate hey man, i pulled down the latest this morning and did some testing, and there were some regression issues (opening previous sessions had a status/spinner message going even when the session was idle). i'm leaving for vacation early tomorrow morning and will be out until next Monday, so I'm hesitant to rush this PR in, it's rather large (as you know), without more baking. i do think this is something we need so that people don't see an immediate error when trying to run opencode without setting it up first. that said, @thdxr is reworking the entire codebase (aside from the TUI) and initial user experience is his focus, so we may need to coordinate with him either way. really appreciate you putting in the effort on this, and i've gone ahead and cherry picked a couple of code quality things you pushed that were unrelated to the feature. will leave this open until i'm back, dax, feel free to weigh in or do whatever you think is best. |
|
@adamdottv all good! Can you tell me what the steps to repro are? I’d like to fix whatever is not working so we can eventually get this in! I've tried to repro but I can't. Here's what I did:
Maybe it's a specific model provider that's problematic? I was testing with OpenRouter. |
|
i actually forgot to delete the existing folder/file, so didn't hit the setup wizard, just went straight into a previously saved session and saw the "thinking..." indicator |
|
@adamdottv okay I was able to repro and find the bug! Fixed via 9e274d0 |
|
@adamdottv is it safe to assume that this PR will be superseded by #38? I will close if so |
|
@l0gicgate that PR is overhauling the core of opencode to be powered by bun. the TUI is still going to be in go - simple server client model. this PR will probably have to change but we'll keep the TUI parts |
|
Okay cool @thdxr, thanks for the update! Let me know what changes need to be done and I’ll address right away. |
|
closing as we rewrote the codebase - appreciate it though! |
## Description ### New setters: - `backgroundColor` - Sets the background color with automatic color parsing - `textColor` - Sets the text color with automatic color parsing - `focusedBackgroundColor` - Sets the focused background color - `focusedTextColor` - Sets the focused text color - `placeholderColor` - Sets the placeholder text color - `cursorColor` - Sets the cursor color - `maxLength` - Sets the max length - `placeholder` - Sets the placeholder text ### Converted to get/set: - `value` - getValue()/setValue() → get/set value - `cursorPosition` - getCursorPosition()/setCursorPosition() → get/set cursorPosition ### Removed unused **getters** (_for now_): - `placeholder` - getPlaceholder() - `maxLength` - getMaxLength() ### Implementation Details: - All private fields were renamed with underscore prefix (e.g., `_backgroundColor`) - All setters call `this.needsUpdate()` to trigger re-rendering when properties change - Color setters use `parseColor()` to handle different color input formats - All references throughout the class were updated to use the new private field names
- Issue anomalyco#14: SDK cache now limited to 50 entries with LRU eviction - Issue anomalyco#15: Languages cache now limited to 100 entries with LRU eviction - Issue anomalyco#16: Instance cache now limited to 20 entries with LRU eviction Creates new createLruCache utility in src/util/cache.ts with: - maxEntries limit for bounded cache size - LRU eviction policy when limit is reached - Optional onEvict callback for cleanup
- Issue anomalyco#14: SDK cache now limited to 50 entries with LRU eviction - Issue anomalyco#15: Languages cache now limited to 100 entries with LRU eviction - Issue anomalyco#16: Instance cache now limited to 20 entries with LRU eviction Creates new createLruCache utility in src/util/cache.ts with: - maxEntries limit for bounded cache size - LRU eviction policy when limit is reached - Optional onEvict callback for cleanup
- Issue anomalyco#14: SDK cache now limited to 50 entries with LRU eviction - Issue anomalyco#15: Languages cache now limited to 100 entries with LRU eviction - Issue anomalyco#16: Instance cache now limited to 20 entries with LRU eviction Creates new createLruCache utility in src/util/cache.ts with: - maxEntries limit for bounded cache size - LRU eviction policy when limit is reached - Optional onEvict callback for cleanup
Description
On first start, when

.opencode.jsondoes not exist, we prompt the user with the setup wizard:Step 1: Select Provider

Step 2: Select Model

Step 3: Enter API Key

Demo
.opencodeand.opencode.jsonfrom your home directoryCloses #7