Skip to content

feat: add /tui and /config slash commands#16912

Open
Oerum wants to merge 1 commit intoanomalyco:devfrom
Oerum:tui-config-quick-access
Open

feat: add /tui and /config slash commands#16912
Oerum wants to merge 1 commit intoanomalyco:devfrom
Oerum:tui-config-quick-access

Conversation

@Oerum
Copy link

@Oerum Oerum commented Mar 10, 2026

Issue for this PR

Closes #16911

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

This PR introduces two new slash commands to the OpenCode TUI:

  • /tui (aliases: tuisettings) -> opens tui.json
  • /config (aliases: settings) -> opens opencode.json

Implementation details:

  1. It uses the Global.Path.config utility to resolve the correct, OS-specific path for both configuration files.
  2. It uses Node's fs.existsSync() to verify if the file exists. If it does not exist, it creates a blank file referencing the correct $schema so that code intelligence works immediately in the user's editor.
  3. It uses the open package to launch the system's default JSON editor cross-platform.

How did you verify your code works?

  • Manually verified the slash commands populate in the TUI autocomplete menu.
  • Tested execution; the tui.json file correctly opens in the system's default editor.
  • Tested fallback behavior where the file does not exist (the schema file is properly created and opened).
  • Ran bun turbo typecheck locally to ensure no typing regressions.
  • Ran bun run test across the suite to verify no breakages.

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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]: Add /tui and /config slash commands

1 participant