Skip to content

Comments

feat(opencode): add /experimental slash command to enable experimental flags#14515

Open
aravhawk wants to merge 1 commit intoanomalyco:devfrom
aravhawk:feat/experimental-command
Open

feat(opencode): add /experimental slash command to enable experimental flags#14515
aravhawk wants to merge 1 commit intoanomalyco:devfrom
aravhawk:feat/experimental-command

Conversation

@aravhawk
Copy link

@aravhawk aravhawk commented Feb 21, 2026

Issue for this PR

Closes #7717

Type of change

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

What does this PR do?

Adds a built-in /experimental slash command in the TUI so users can quickly enable experimental flags without manually editing env files.

Changes:

  • Registers /experimental in built-in TUI commands.
  • Adds an Experimental flags dialog that:
    • Lists available experimental env flags.
    • Supports boolean flags by setting KEY=true.
    • Supports numeric flags with a prompt and positive-integer validation.
    • Writes/updates values in project .env.
    • Shows success/error toasts and a restart reminder.
  • Uses dynamic flag discovery from flag metadata so newly added experimental flags show up automatically (instead of a hardcoded list).
  • Adds docs for /experimental in TUI docs.

Why this works:

  • The command is integrated into the existing slash command and command palette system.
  • The dialog reads flag definitions from the same flag layer used by runtime env handling, so UI options stay in sync with available experimental flags.
  • .env update logic replaces existing lines (including export KEY=...) or appends when missing.

How did you verify your code works?

  • Ran bun run --cwd packages/opencode typecheck (pass).
  • Ran bun run --cwd packages/web build (pass).

Screenshots / recordings

  1. Slash command discoverability (/experimental appears in autocomplete):

Slash autocomplete showing /experimental

  1. Experimental flags dialog:

Experimental flags dialog

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 "/experimental" command to toggle experimental features

1 participant