VS Code Codeberg Pull Request and Issues Extension

A Visual Studio Code extension that integrates Codeberg Pull Requests and Issues directly into your IDE. Compatible with VS Code and other VS Code-based editors like VSCodium, Theia, and Code-OSS.
Table of Contents
Installation
You can install the extension from the Visual Studio Code Marketplace or from open-vsx.org.
Features
- Authentication:
- Securely authenticate with your Codeberg instance using OAuth 2.0
- Authentication tokens are persisted across VS Code sessions using VS Code's SecretStorage API
- Automatic session restoration on extension activation - no need to re-authenticate after restarting VS Code
- Automatic token validation on startup with user notification if re-authentication is needed
- Sign out command to manually clear authentication when needed
- Pull Request:
- Pull Request View: Browse open pull requests for your repository in the Explorer sidebar.
- Pull Request Details View: View pull request description, comments, and file changes in an in-editor webview with full Markdown rendering support.
- Easy Checkout: Quickly check out the branch associated with a pull request from its details view.
- Markdown Rendering: PR descriptions and comments are rendered with GitHub-Flavored Markdown, including syntax highlighting for code blocks, tables, task lists, and more.
- Issues:
- Issue View: Browse open issues for your repository in the Explorer sidebar.
- Issue Details View: View issue description and comments in an in-editor webview with full Markdown rendering support.
- Create Issue from TODO: Create a Codeberg issue directly from a
// TODO: comment in your code.
- Start Working on Issue: Create a new branch from an issue, with a suggested branch name based on the issue title.
- Markdown Rendering: Issue descriptions and comments are rendered with GitHub-Flavored Markdown, including syntax highlighting for code blocks, tables, task lists, and more.
- Add Comments: Add comments to pull requests and issues directly from their respective webviews.
- View Refresh: Manually refresh the pull requests or issues view using a dedicated button.
- Terminal Integration: Optionally view git operations in an integrated terminal for transparency and debugging. All git commands can be displayed in a dedicated terminal instance, making it easy to understand what the extension is doing behind the scenes.
Configuration
The extension can be customized through VS Code settings. Access these via File > Preferences > Settings (or Code > Settings on macOS), then search for "Codeberg".
Terminal Integration Settings
codeberg.showGitCommandsInTerminal (default: false)
- When enabled, all git operations are displayed in an integrated terminal, providing full transparency into what the extension is doing.
- Useful for debugging, learning git commands, or verifying operations before they execute.
codeberg.terminalName (default: "Codeberg")
- Customize the name of the terminal instance used for git operations.
- Helpful if you want to distinguish the extension's terminal from your other terminals.
codeberg.reuseTerminal (default: true)
- When enabled, the extension reuses the same terminal instance for all git operations.
- When disabled, a new terminal is created for each operation.
Example: Enabling Terminal Mode
To see all git commands the extension runs:
- Open VS Code Settings (Ctrl+, or Cmd+,)
- Search for "codeberg"
- Enable "Show Git Commands In Terminal"
Now when you check out a pull request branch or start working on an issue, you'll see commands like:
git fetch origin pull/123/head:pr-123
git checkout pr-123
This is particularly useful for understanding the extension's behavior or troubleshooting git-related issues.
Requirements
For Users
- Visual Studio Code ^1.80.0 or compatible IDE (VSCodium, Theia, Code-OSS, etc.)
- Codeberg Account: Required for authentication and accessing repositories
- Git: Must be installed and configured on your system
- Git Repository: Your project must be a Git repository with a Codeberg remote
For Development
- Node.js and npm: Required for building and running the extension
- Visual Studio Code: For development and testing
- Codeberg OAuth Application: For testing authentication features
Troubleshooting
Common Issues
Extension not showing Codeberg views
- Ensure you're in a Git repository with a Codeberg remote
- Check that the remote URL follows the format:
https://codeberg.org/username/repo.git
- Try refreshing the views using the refresh button in the sidebar
Authentication fails
- Verify your Codeberg account credentials
- Check that your OAuth application is properly configured with the correct redirect URI
- Try signing out and signing back in via the Command Palette
Session expired after VS Code restart
- The extension automatically persists authentication tokens across VS Code sessions
- If you see "Sign in to Codeberg" in the tree views after restart, it means your token has expired
- Click "Sign in to Codeberg" or run the "Codeberg: Authenticate" command to re-authenticate
- Authentication tokens are stored securely using VS Code's SecretStorage API
- If you receive a "session expired" notification, simply re-authenticate to continue
Want to sign out or switch accounts
- Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
- Type "Codeberg: Sign Out" and select the command
- This will clear your stored credentials immediately
- The tree views will refresh to show the "Sign in to Codeberg" prompt
- You can then authenticate with a different account if needed
Git operations fail
- Ensure Git is properly installed and configured
- Check that you have the necessary permissions for the repository
- Enable terminal mode in settings to see detailed git command output
Pull requests/issues not loading
- Verify your internet connection
- Check the Codeberg instance status
- Try refreshing the views manually
Extension commands not appearing
- Reload VS Code window (Ctrl+Shift+P → "Developer: Reload Window")
- Check that the extension is properly installed and enabled
- Verify VS Code version compatibility (^1.80.0 required)
Getting Help
If you encounter issues not covered here:
- Check the Codeberg issues for similar problems
- Enable terminal mode and note any error messages
- Create a new issue with detailed information about your setup and the problem
How to Run (Development)
Clone the repository:
git clone https://codeberg.org/medenor/vscode-pull-request-codeberg.git
cd vscode-pull-request-codeberg
Install dependencies:
npm install
Compile the extension:
npm run compile
Open the project in VS Code.
Start the Extension Development Host:
- Go to the "Run and Debug" view (Ctrl+Shift+D or Cmd+Shift+D).
- Select "Run Extension" from the dropdown menu at the top.
- Click the green play button.
Open a folder: In the new Extension Development Host window, open a folder that is a Git repository with a remote pointing to a Codeberg repository.
Create an OAuth Application on Codeberg:
- Go to your Codeberg instance settings -> Applications.
- Create a new OAuth2 application with the following details:
- Application Name:
VS Code Codeberg Pull Request
- Redirect URI:
http://localhost:50000/callback
- Note down the Client ID and Client Secret.
Update src/auth.ts with your Client ID and Client Secret. (This step will be automated in the future).
Sign in to Codeberg:
- In the Extension Development Host window, open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
- Type "Codeberg: Authenticate" and select the command.
- Follow the browser prompts to authorize the application.
- Your session will be automatically saved and restored across VS Code restarts.
View Pull Requests and Issues:
- In the Extension Development Host window, open the Command Palette.
- Type "Focus on Codeberg Pull Requests View" and select the command to make the PRs view visible.
- Type "Focus on Codeberg Issues View" and select the command to make the Issues view visible.
Sign out (optional):
- To manually clear your authentication, open the Command Palette.
- Type "Codeberg: Sign Out" and select the command.
- This will clear your stored credentials and refresh the views.
Support
Reach out to the maintainer at one of the following places:
Project assistance
If you want to say thank you and/or support active development of vscode-pull-request-codeberg:
- Add a Star to the project.
- Write interesting articles about the project on Dev.to, Medium or your personal blog.
Together, we can make vscode-pull-request-codeberg better!
Contributing
First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
Please read our contribution guidelines, and thank you for being involved!
Authors & contributors
The original setup of this repository is by Medenor.
For a full list of all authors and contributors, see the contributors page.
Security
The vscode-pull-request-codeberg extension follows good practices of security, but 100% security cannot be assured.
The vscode-pull-request-codeberg extension is provided "as is" without any warranty. Use at your own risk.
License
This project is licensed under the GNU AGPLv3 license.
See LICENSE for more information.
Acknowledgements
This project is not affiliated to Codeberg e.V.