[PR #12488] feat: add support for custom commands in .agents/commands/ #14235

Open
opened 2026-02-16 18:19:02 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12488

State: open
Merged: No


Summary

Add support for hosting custom commands in .agents/commands/ alongside skills, following the emerging agent standards. This allows teams to co-host all agentic coding instructions in a single location.

Features:

  • Discover commands from .agents/commands/ (project) and ~/.agents/commands/ (global)
  • Precedence order: .opencode/commands/ > .agents/commands/ > ~/.agents/commands/
  • Add OPENCODE_DISABLE_EXTERNAL_COMMANDS flag to disable loading
  • Align loading behavior with skills (global first, then project overwrites)

Changes:

  • packages/opencode/src/flag/flag.ts: Add OPENCODE_DISABLE_EXTERNAL_COMMANDS flag
  • packages/opencode/src/config/config.ts: Add loadExternalCommands() function
  • packages/opencode/test/config/config.test.ts: Add comprehensive test suite
  • packages/web/src/content/docs/commands.mdx: Document new feature
  • packages/web/src/content/docs/skills.mdx: Add cross-reference tip
  • packages/web/src/content/docs/cli.mdx: Document new environment variable

Verification

The implementation has been tested with unit test and through local build verification

Fixes #12486

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12488 **State:** open **Merged:** No --- # Summary Add support for hosting custom commands in .agents/commands/ alongside skills, following the emerging agent standards. This allows teams to co-host all agentic coding instructions in a single location. # Features: - Discover commands from .agents/commands/ (project) and ~/.agents/commands/ (global) - Precedence order: .opencode/commands/ > .agents/commands/ > ~/.agents/commands/ - Add OPENCODE_DISABLE_EXTERNAL_COMMANDS flag to disable loading - Align loading behavior with skills (global first, then project overwrites) # Changes: - packages/opencode/src/flag/flag.ts: Add OPENCODE_DISABLE_EXTERNAL_COMMANDS flag - packages/opencode/src/config/config.ts: Add loadExternalCommands() function - packages/opencode/test/config/config.test.ts: Add comprehensive test suite - packages/web/src/content/docs/commands.mdx: Document new feature - packages/web/src/content/docs/skills.mdx: Add cross-reference tip - packages/web/src/content/docs/cli.mdx: Document new environment variable # Verification The implementation has been tested with unit test and through local build verification Fixes #12486
yindo added the pull-request label 2026-02-16 18:19:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14235