Skip to content

Conversation

@l0gicgate
Copy link
Contributor

@l0gicgate l0gicgate commented May 15, 2025

Description

On first start, when .opencode.json does not exist, we prompt the user with the setup wizard:
CleanShot 2025-05-15 at 17 27 37@2x

Step 1: Select Provider
CleanShot 2025-05-15 at 17 28 00@2x

Step 2: Select Model
CleanShot 2025-05-15 at 17 28 15@2x

Step 3: Enter API Key
CleanShot 2025-05-15 at 17 28 27@2x

Demo

  1. Remove .opencode and .opencode.json from your home directory
  2. Run the app

Closes #7

Copy link
Contributor

@adamdotdevin adamdotdevin left a 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!

@l0gicgate l0gicgate requested a review from adamdotdevin May 15, 2025 17:32
@adamdotdevin
Copy link
Contributor

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!

@l0gicgate
Copy link
Contributor Author

No worries @adamdottv, happy to address any other feedback you have before we merge!

@l0gicgate l0gicgate changed the title feature: Setup Wizard feature: interactive setup wizard May 16, 2025
Copy link
Contributor

@adamdotdevin adamdotdevin left a 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+c you'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-list component (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

@l0gicgate
Copy link
Contributor Author

@adamdottv I've applied all of your suggestions via 455e5c1, 71b017c, 4e47ad6

Can I follow up in a different PR to add support for providers that use credentials? The scope of this PR is already massive.

@l0gicgate l0gicgate requested a review from adamdotdevin May 16, 2025 20:32
@adamdotdevin
Copy link
Contributor

can we just remove bedrock and azure from that dialog in the interim?

@l0gicgate
Copy link
Contributor Author

l0gicgate commented May 16, 2025

@adamdottv disabled Bedrock and Vertex from setup wizard via 5a2c093

@adamdotdevin
Copy link
Contributor

@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.

@l0gicgate
Copy link
Contributor Author

l0gicgate commented May 17, 2025

@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:

  1. Delete .opencode and .opencode.json
  2. Run through the setup
  3. Prompt the LLM a couple times
  4. Exit the app
  5. Delete just .opencode.json
  6. Re-run the setup wizard
  7. Switch sessions
  8. Prompt again and it all works

Maybe it's a specific model provider that's problematic? I was testing with OpenRouter.

@adamdotdevin
Copy link
Contributor

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

@l0gicgate
Copy link
Contributor Author

@adamdottv okay I was able to repro and find the bug!

Fixed via 9e274d0

@l0gicgate
Copy link
Contributor Author

@adamdottv is it safe to assume that this PR will be superseded by #38? I will close if so

@thdxr
Copy link
Contributor

thdxr commented May 21, 2025

@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

@l0gicgate
Copy link
Contributor Author

Okay cool @thdxr, thanks for the update! Let me know what changes need to be done and I’ll address right away.

@thdxr
Copy link
Contributor

thdxr commented Jun 14, 2025

closing as we rewrote the codebase - appreciate it though!

@thdxr thdxr closed this Jun 14, 2025
@github-actions github-actions bot mentioned this pull request Nov 4, 2025
1 task
m-pa pushed a commit to m-pa/opencode that referenced this pull request Dec 4, 2025
## 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
sauerdaniel added a commit to sauerdaniel/opencode that referenced this pull request Jan 15, 2026
- 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
sauerdaniel added a commit to sauerdaniel/opencode that referenced this pull request Jan 15, 2026
- 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
sauerdaniel added a commit to sauerdaniel/opencode that referenced this pull request Jan 17, 2026
- 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
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.

feature: Interactive Configuration

3 participants