Sharing Team Configurations
Introduction: From Solo to Team Workflows
In previous lessons, we learned how to customize OpenCode for your personal workflow, control its permissions, and recover from errors. You now have a robust environment that works perfectly for you. However, most software development happens in teams, and this introduces a new challenge: consistency.
If every developer on your team uses a different AI model or has different permission settings, the code generated by OpenCode might vary wildly from person to person. To solve this, we need to share our configuration so that everyone is on the same page.
But there is a catch — we must share the rules (like which model to use) without sharing our secrets (like API keys). In this final lesson, we will learn the industry-standard pattern for separating public project configuration from private credentials. By the end, you will be able to set up a repository that any new team member can clone and use immediately, keeping your project secure and consistent.
What Belongs in opencode.json
The opencode.json file is designed to be the single source of truth for how OpenCode behaves in a specific project. Because it defines the standard operating procedure for the project, it should be committed to your version control system (like Git). This ensures that when a teammate clones your repository, they automatically get the correct settings without having to ask you for them.
However, not everything belongs in this file. You should only include fields that are valid OpenCode configuration options that apply to everyone — specifically, the model and permission fields. These define "what tool we use" and "how cautious we should be."
Here is an example of a safe, shareable opencode.json file:
In this example, the team has agreed to use anthropic/claude-haiku-4-5 to keep costs low and responses fast. They have also agreed that the agent needs permission to write code or run commands (ask) but can read files freely (allow). Because this file contains no sensitive data, it is perfectly safe to share with the entire team.
Where API Keys Actually Go
