[PR #9345] feat: gitea support #13083

Closed
opened 2026-02-16 18:17:57 -05:00 by yindo · 0 comments
Owner

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

State: closed
Merged: No


Description

This PR adds full support for Gitea and Forgejo platforms in OpenCode, enabling users to utilize OpenCode on self-hosted Git instances.

Closes Issues

Closes #1883
Closes #9192

Type of Changes

  • New feature
  • Test cases
  • Documentation
  • Breaking change

Major Changes

Platform Abstraction

  • Implemented IGitPlatform interface and BasePlatformAdapter base class
  • Unified platform adapter architecture for GitHub, Gitea, and Forgejo

Gitea Support

  • GiteaAdapter - Full Gitea platform adapter
  • GiteaClient - Gitea API client (431 lines)
  • opencode gitea install - Automated installation command
  • Special optimizations for public instances like Codeberg.org

GitHub Adapter

  • GitHubAdapter - GitHub API integration (500 lines)

Forgejo Support

  • ForgejoAdapter - Forgejo-compatible adapter based on Gitea

Factory Pattern

  • PlatformFactory - Automatic detection and creation of adapters

Testing

  • 250+ new unit tests
  • Full coverage for factory pattern, adapters, clients, etc.

Feature List

Feature GitHub Gitea Forgejo
Fetch Repository
Fetch Issues
Create Comments
PR Operations
Permission Check
Comment Reactions

Usage Examples

# Install Gitea Actions
opencode gitea install

# Use in Issues
/opencode fix this bug
/oc explain the issue

# Use in PRs
Update the documentation /opencode

Verification

  • All tests passed
  • Backward compatibility ensured
  • No TypeScript errors
  • Code style compliance
  • Documentation updated
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9345 **State:** closed **Merged:** No --- ## Description This PR adds full support for Gitea and Forgejo platforms in OpenCode, enabling users to utilize OpenCode on self-hosted Git instances. ## Closes Issues Closes #1883 Closes #9192 ## Type of Changes - [x] New feature - [x] Test cases - [x] Documentation - [ ] Breaking change ## Major Changes ### Platform Abstraction - ✅ Implemented `IGitPlatform` interface and `BasePlatformAdapter` base class - ✅ Unified platform adapter architecture for GitHub, Gitea, and Forgejo ### Gitea Support - ✅ `GiteaAdapter` - Full Gitea platform adapter - ✅ `GiteaClient` - Gitea API client (431 lines) - ✅ `opencode gitea install` - Automated installation command - ✅ Special optimizations for public instances like Codeberg.org ### GitHub Adapter - ✅ `GitHubAdapter` - GitHub API integration (500 lines) ### Forgejo Support - ✅ `ForgejoAdapter` - Forgejo-compatible adapter based on Gitea ### Factory Pattern - ✅ `PlatformFactory` - Automatic detection and creation of adapters ### Testing - ✅ 250+ new unit tests - ✅ Full coverage for factory pattern, adapters, clients, etc. ## Feature List | Feature | GitHub | Gitea | Forgejo | |-------------------|--------|-------|---------| | Fetch Repository | ✅ | ✅ | ✅ | | Fetch Issues | ✅ | ✅ | ✅ | | Create Comments | ✅ | ✅ | ✅ | | PR Operations | ✅ | ✅ | ✅ | | Permission Check | ✅ | ✅ | ✅ | | Comment Reactions | ✅ | ✅ | ✅ | ## Usage Examples ```bash # Install Gitea Actions opencode gitea install # Use in Issues /opencode fix this bug /oc explain the issue # Use in PRs Update the documentation /opencode ``` ## Verification - [x] All tests passed - [x] Backward compatibility ensured - [x] No TypeScript errors - [x] Code style compliance - [x] Documentation updated
yindo added the pull-request label 2026-02-16 18:17:57 -05:00
yindo closed this issue 2026-02-16 18:17:57 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13083