Skip to content

Conversation

@atripathy86
Copy link

@atripathy86 atripathy86 commented Jan 6, 2026

Summary

Need to install oh-my-opencode in a local folder with Github Copilot subscription option. While its possible to manually edit the oh-my-opecode.json file after the fact, it will be easier to have this as a CLI option to configure (--githubcopilot similar to --claude, --chatgpt, --gemini). Also explicitly added a --local option to CLI to allow creating everything in project specific .opencode instead of ~/.config/opencode

feat(cli): add --githubcopilot and --local install options
Add two new CLI options for the install command:

  • --githubcopilot: Enable GitHub Copilot as a model provider with full
    agent configuration (claude-opus-4.5 for Sisyphus, gpt-5.2 for Oracle,
    claude-haiku-4.5 for Librarian/Explore, gemini-3-pro-preview for
    Frontend/Document-Writer, gemini-3-flash-preview for Multimodal-Looker)
  • --local: Write configuration to project-local .opencode/ directory
    instead of global ~/.config/opencode/, enabling per-project customization
  • Update README.md with new options and usage examples.

Changes

--githubcopilot Option

Files Modified:

  • src/cli/types.ts: Add githubcopilot to InstallArgs, hasGitHubCopilot to InstallConfig/DetectedConfig
  • src/cli/install.ts: Add validation, TUI prompt, config summary display with GitHub Copilot models
  • src/cli/config-manager.ts: Add generateOmoConfig priority for GitHub Copilot models, detection logic
  • src/cli/index.ts: Add --githubcopilot option and help text
  • README.md: Add GitHub Copilot examples and agent model documentation

GitHub Copilot Model Mapping:

Agent Model
Sisyphus github-copilot/claude-opus-4.5
Oracle github-copilot/gpt-5.2
Librarian github-copilot/claude-haiku-4.5
Explore github-copilot/claude-haiku-4.5
Frontend UI/UX Engineer github-copilot/gemini-3-pro-preview
Document Writer github-copilot/gemini-3-pro-preview
Multimodal Looker github-copilot/gemini-3-flash-preview

Usage:

bunx oh-my-opencode install --no-tui --claude=no --chatgpt=no --gemini=no --githubcopilot=yes

--local Option

Files Modified:

  • src/cli/types.ts: Add local?: boolean to InstallArgs
  • src/cli/index.ts: Add --local option to install command
  • src/cli/config-manager.ts: Add isLocal to ConfigContext, add initLocalConfigContext()
  • src/cli/install.ts: Add local context initialization in both TUI and non-TUI modes

Key Design Decision:

The isLocal flag in ConfigContext prevents findOpenCodeBinaryWithVersion() from
overwriting the local context when it calls initConfigContext() during OpenCode
version detection.

Output Paths:

Mode OpenCode Config oh-my-opencode Config
Global ~/.config/opencode/opencode.json ~/.config/opencode/oh-my-opencode.json
Local .opencode/opencode.json .opencode/oh-my-opencode.json

Usage:

bunx oh-my-opencode install --local --no-tui --claude=no --chatgpt=no --gemini=no --githubcopilot=yes

Testing

bun run build
bun ./oh-my-opencode/dist/cli/index.js install --no-tui --claude=no --chatgpt=no --gemini=no --githubcopilot=yes

OR

bun run build
bun ./oh-my-opencode/dist/cli/index.js install --no-tui --local --claude=no --chatgpt=no --gemini=no --githubcopilot=yes

Related Issues

Not created


Summary by cubic

Adds two new CLI options: --githubcopilot to configure agents to GitHub Copilot models, and --local to install per-project in .opencode. This makes setup easier for Copilot users and enables project-specific configs.

  • New Features

    • --githubcopilot=<yes|no>: Maps agents to GitHub Copilot models (e.g., Sisyphus → github-copilot/claude-opus-4.5, Oracle → github-copilot/gpt-5.2). Adds Copilot auth hints and detection in existing configs.
    • --local: Writes opencode.json and oh-my-opencode.json to .opencode/ in the project. Keeps the local context stable during version detection.
    • TUI and --no-tui support: New Copilot prompt; in non-interactive mode, --githubcopilot is required.
    • README updated with examples and provider docs.
  • Migration

    • Global: bunx oh-my-opencode install --no-tui --claude=no --chatgpt=no --gemini=no --githubcopilot=yes
    • Project-local: bunx oh-my-opencode install --local --no-tui --claude=no --chatgpt=no --gemini=no --githubcopilot=yes

Written for commit b302dac. Summary will update on new commits.

Add two new CLI options for the install command:
- --githubcopilot: Enable GitHub Copilot as a model provider with full
  agent configuration (claude-opus-4.5 for Sisyphus, gpt-5.2 for Oracle,
  claude-haiku-4.5 for Librarian/Explore, gemini-3-pro-preview for
  Frontend/Document-Writer, gemini-3-flash-preview for Multimodal-Looker)
- --local: Write configuration to project-local .opencode/ directory
  instead of global ~/.config/opencode/, enabling per-project customization
Update README.md with new options and usage examples.
---
- src/cli/types.ts: Add githubcopilot to InstallArgs, hasGitHubCopilot to InstallConfig/DetectedConfig
- src/cli/install.ts: Add validation, TUI prompt, config summary display with GitHub Copilot models
- src/cli/config-manager.ts: Add generateOmoConfig priority for GitHub Copilot models, detection logic
- src/cli/index.ts: Add --githubcopilot option and help text
- README.md: Add GitHub Copilot examples and agent model documentation
| Agent                    | Model                              |
|--------------------------|------------------------------------|
| Sisyphus                 | github-copilot/claude-opus-4.5    |
| Oracle                   | github-copilot/gpt-5.2            |
| Librarian                | github-copilot/claude-haiku-4.5   |
| Explore                  | github-copilot/claude-haiku-4.5   |
| Frontend UI/UX Engineer  | github-copilot/gemini-3-pro-preview |
| Document Writer          | github-copilot/gemini-3-pro-preview |
| Multimodal Looker        | github-copilot/gemini-3-flash-preview |
```bash
bunx oh-my-opencode install --no-tui --claude=no --chatgpt=no --gemini=no --githubcopilot=yes
---
- src/cli/types.ts: Add local?: boolean to InstallArgs
- src/cli/index.ts: Add --local option to install command
- src/cli/config-manager.ts: Add isLocal to ConfigContext, add initLocalConfigContext()
- src/cli/install.ts: Add local context initialization in both TUI and non-TUI modes
The isLocal flag in ConfigContext prevents findOpenCodeBinaryWithVersion() from
overwriting the local context when it calls initConfigContext() during OpenCode
version detection.
| Mode    | OpenCode Config              | oh-my-opencode Config              |
|---------|------------------------------|------------------------------------|
| Global  | ~/.config/opencode/opencode.json | ~/.config/opencode/oh-my-opencode.json |
| Local   | .opencode/opencode.json      | .opencode/oh-my-opencode.json      |
bunx oh-my-opencode install --local --no-tui --claude=no --chatgpt=no --gemini=no --githubcopilot=yes
Copilot AI review requested due to automatic review settings January 6, 2026 17:30
@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

@atripathy86
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Jan 6, 2026
@greptile-apps
Copy link

greptile-apps bot commented Jan 6, 2026

Greptile Summary

  • Adds --githubcopilot CLI option to configure agents with GitHub Copilot models instead of direct provider subscriptions, mapping agents to specific Copilot-backed models (Sisyphus → github-copilot/claude-opus-4.5, Oracle → github-copilot/gpt-5.2, etc.)
  • Implements --local installation option to write configuration files to project-local .opencode/ directory instead of global ~/.config/opencode/, enabling per-project customization
  • Updates TUI and non-TUI flows with proper validation, prompts, and help text while maintaining backward compatibility with existing provider options

Important Files Changed

Filename Overview
src/cli/config-manager.ts Added local context guard, GitHub Copilot model configuration logic, and detection for existing Copilot setups
src/cli/install.ts Integrated GitHub Copilot validation, TUI prompts, agent model mapping prioritization, and local config initialization
src/cli/types.ts Extended type interfaces to support githubcopilot and local options following existing provider patterns

Confidence score: 4/5

  • This PR is safe to merge with careful attention to the config management logic and model mapping consistency
  • Score reflects well-structured implementation following existing patterns, but complexity in config context management and agent model prioritization needs verification
  • Pay close attention to src/cli/config-manager.ts for the local context guard logic and GitHub Copilot model mapping in src/cli/install.ts

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as "CLI Install"
    participant ConfigManager as "Config Manager"
    participant FileSystem as "File System"
    participant NPM as "NPM Registry"
    participant OpenCode as "OpenCode Binary"

    User->>CLI: "bunx oh-my-opencode install --githubcopilot=yes --local"
    CLI->>CLI: "validateNonTuiArgs(args)"
    CLI->>ConfigManager: "initLocalConfigContext()"
    ConfigManager->>FileSystem: "create .opencode/ directory context"
    CLI->>OpenCode: "check installation and version"
    OpenCode-->>CLI: "version info"
    CLI->>ConfigManager: "addPluginToOpenCodeConfig()"
    ConfigManager->>FileSystem: "write .opencode/opencode.json"
    CLI->>ConfigManager: "addAuthPlugins(config)"
    ConfigManager->>NPM: "fetchLatestVersion(opencode-antigravity-auth)"
    NPM-->>ConfigManager: "latest version"
    ConfigManager->>FileSystem: "update plugin array"
    CLI->>ConfigManager: "generateOmoConfig(installConfig)"
    ConfigManager->>ConfigManager: "map GitHub Copilot models to agents"
    CLI->>ConfigManager: "writeOmoConfig(config)"
    ConfigManager->>FileSystem: "write .opencode/oh-my-opencode.json"
    CLI->>User: "display configuration summary with GitHub Copilot models"
Loading

@greptile-apps
Copy link

greptile-apps bot commented Jan 6, 2026

Greptile found no issues!

From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds two new CLI options to enhance installation flexibility: --githubcopilot for configuring GitHub Copilot as a model provider, and --local for installing to a project-specific .opencode/ directory instead of the global config.

  • Adds GitHub Copilot as a first-class model provider option with dedicated agent configurations
  • Enables local (project-specific) installations via the --local flag
  • Updates documentation and help text to reflect the new installation options

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/cli/types.ts Adds githubcopilot and local fields to InstallArgs and hasGitHubCopilot to config interfaces
src/cli/install.ts Implements validation, TUI prompts, model selection logic, and config summaries for GitHub Copilot; adds local context initialization
src/cli/index.ts Adds CLI options --githubcopilot and --local with updated help text and examples
src/cli/config-manager.ts Implements local config context with initLocalConfigContext(), adds GitHub Copilot model mappings in config generation, and detection logic
README.md Updates documentation with GitHub Copilot examples, installation steps, and agent model mappings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +42 to +43
Gemini Powers frontend, documentation, and multimodal agents
GitHub Copilot Built-in OpenCode provider for Claude, GPT, and Gemini models
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacing inconsistency in help text alignment. The "Gemini" line has extra spaces before "Powers" that don't match the alignment of "Claude" and "ChatGPT" lines. Additionally, "GitHub Copilot" description lacks proper alignment with the others.

Suggested change
Gemini Powers frontend, documentation, and multimodal agents
GitHub Copilot Built-in OpenCode provider for Claude, GPT, and Gemini models
Gemini Powers frontend, documentation, and multimodal agents
GitHub Copilot Built-in OpenCode provider for Claude, GPT, and Gemini models

Copilot uses AI. Check for mistakes.
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files

Confidence score: 5/5

  • Only issue is cosmetic: extra space in Gemini’s CLI help text misaligns columns but doesn’t affect functionality, so overall risk stays low.
  • Pay close attention to src/cli/index.ts - ensures help text spacing stays consistent across models.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/cli/index.ts">

<violation number="1" location="src/cli/index.ts:42">
P3: Inconsistent spacing in help text - Gemini has an extra space compared to Claude and ChatGPT, causing misaligned columns in the CLI help output.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Gemini Powers frontend, documentation, and multimodal agents
Claude Required for Sisyphus (main orchestrator) and Librarian agents
ChatGPT Powers the Oracle agent for debugging and architecture
Gemini Powers frontend, documentation, and multimodal agents
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Inconsistent spacing in help text - Gemini has an extra space compared to Claude and ChatGPT, causing misaligned columns in the CLI help output.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/cli/index.ts, line 42:

<comment>Inconsistent spacing in help text - Gemini has an extra space compared to Claude and ChatGPT, causing misaligned columns in the CLI help output.</comment>

<file context>
@@ -23,28 +23,34 @@ program
-  Gemini      Powers frontend, documentation, and multimodal agents
+  Claude        Required for Sisyphus (main orchestrator) and Librarian agents
+  ChatGPT       Powers the Oracle agent for debugging and architecture
+  Gemini         Powers frontend, documentation, and multimodal agents
+  GitHub Copilot Built-in OpenCode provider for Claude, GPT, and Gemini models
 `)
</file context>
Suggested change
Gemini Powers frontend, documentation, and multimodal agents
Gemini Powers frontend, documentation, and multimodal agents
Fix with Cubic

@yonydev
Copy link

yonydev commented Jan 6, 2026

Please merge this 🙏. Very valuable contribution. Thanks a lot!

@hjnnjh
Copy link

hjnnjh commented Jan 8, 2026

Please merge this 🙏. Very valuable contribution. Thanks a lot!

Really agree. copilot pro+ sub will be useful.

@LegendEvent
Copy link

Maybe also add it to utilize the "unlimited" requests with github-copilot subscription?

So e.g.
as explore model use github-copilot/grok-code-fast-1

it doesnt consume usage and also do not send your code to X

@kdcokenny
Copy link
Collaborator

stale, if still relevant feel free to reopen with conflicts resolved.

@kdcokenny kdcokenny closed this Jan 16, 2026
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.

5 participants