Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 38 additions & 36 deletions branding/apply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,38 @@ function buildReplacements(config: Branding): Replacement[] {
const r = config.replacements
const replacements: Replacement[] = []

// URL replacements MUST come before generic name replacements.
// Otherwise "anomalyco/opencode" becomes "anomalyco/codeq" before
// the GitHub URL regex can match the full original URL.
if (r.urls?.github) {
replacements.push({
search: /https:\/\/github\.com\/anomalyco\/opencode/g,
replace: r.urls.github,
description: `github repo -> ${r.urls.github}`,
})
}

if (r.urls?.website) {
replacements.push({
search: /https:\/\/opencode\.ai/g,
replace: r.urls.website,
description: `opencode.ai -> ${r.urls.website}`,
})
}

if (r.urls?.api) {
replacements.push({
search: /https:\/\/api\.opencode\.ai/g,
replace: r.urls.api,
description: `api.opencode.ai -> ${r.urls.api}`,
})
replacements.push({
search: /https:\/\/api\.dev\.opencode\.ai/g,
replace: r.urls.api,
description: `api.dev.opencode.ai -> ${r.urls.api}`,
})
}

// Product name replacements (case-sensitive)
// Use negative lookbehind/lookahead to avoid matching:
// - @opencode-ai package names
Expand Down Expand Up @@ -158,36 +190,6 @@ function buildReplacements(config: Branding): Replacement[] {
})
}

// URL replacements
if (r.urls?.website) {
replacements.push({
search: /https:\/\/opencode\.ai/g,
replace: r.urls.website,
description: `opencode.ai -> ${r.urls.website}`,
})
}

if (r.urls?.api) {
replacements.push({
search: /https:\/\/api\.opencode\.ai/g,
replace: r.urls.api,
description: `api.opencode.ai -> ${r.urls.api}`,
})
replacements.push({
search: /https:\/\/api\.dev\.opencode\.ai/g,
replace: r.urls.api,
description: `api.dev.opencode.ai -> ${r.urls.api}`,
})
}

if (r.urls?.github) {
replacements.push({
search: /https:\/\/github\.com\/anomalyco\/opencode/g,
replace: r.urls.github,
description: `github repo -> ${r.urls.github}`,
})
}

return replacements
}

Expand Down Expand Up @@ -482,7 +484,7 @@ const PURPLE = RGBA.fromHex("#9370DB")`,
transform: (content, config) => {
return content.replace(
/You are OpenCode, the best coding agent on the planet\./,
`You are CodeQ, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
`You are ${config.replacements.displayName}, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
)
},
},
Expand All @@ -491,7 +493,7 @@ const PURPLE = RGBA.fromHex("#9370DB")`,
transform: (content, config) => {
return content.replace(
/You are OpenCode, the best coding agent on the planet\./,
`You are CodeQ, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
`You are ${config.replacements.displayName}, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
)
},
},
Expand All @@ -500,7 +502,7 @@ const PURPLE = RGBA.fromHex("#9370DB")`,
transform: (content, config) => {
return content.replace(
/You are OpenCode, the best coding agent on the planet\./,
`You are CodeQ, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
`You are ${config.replacements.displayName}, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
)
},
},
Expand All @@ -509,7 +511,7 @@ const PURPLE = RGBA.fromHex("#9370DB")`,
transform: (content, config) => {
return content.replace(
/You are OpenCode, the best coding agent on the planet\./,
`You are CodeQ, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
`You are ${config.replacements.displayName}, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
)
},
},
Expand All @@ -518,7 +520,7 @@ const PURPLE = RGBA.fromHex("#9370DB")`,
transform: (content, config) => {
return content.replace(
/You are OpenCode, the best coding agent on the planet\./,
`You are CodeQ, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
`You are ${config.replacements.displayName}, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
)
},
},
Expand All @@ -527,7 +529,7 @@ const PURPLE = RGBA.fromHex("#9370DB")`,
transform: (content, config) => {
return content.replace(
/You are OpenCode, the best coding agent on the planet\./,
`You are CodeQ, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
`You are ${config.replacements.displayName}, built by qBraid - the leading quantum software company. You are the universe's most powerful coding agent.`,
)
},
},
Expand Down
29 changes: 15 additions & 14 deletions branding/qbraid/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# CodeQ by qBraid
# Codeq by qBraid

CodeQ is qBraid's branded version of opencode - the universe's most powerful coding agent for quantum software development.
Codeq is qBraid's branded version of opencode - the universe's most powerful coding agent for quantum software development.

## Configuration

CodeQ is configured by qBraid's platform. The configuration file is placed at:
Codeq is configured by qBraid's platform. The configuration file is placed at:

- **Project-level**: `.codeq/opencode.json` in your project directory
- **Global**: `~/.config/codeq/config.json`
Expand All @@ -18,7 +18,7 @@ CodeQ is configured by qBraid's platform. The configuration file is placed at:
"qbraid": {
"options": {
"apiKey": "qbr_...",
"baseURL": "https://account-v2.qbraid.com/api/ai/v1"
"baseURL": "https://account.qbraid.com/api/ai/v1"
}
}
}
Expand All @@ -27,7 +27,7 @@ CodeQ is configured by qBraid's platform. The configuration file is placed at:

## Available Models

CodeQ provides access to the following models through qBraid:
Codeq provides access to the following models through qBraid:

| Model ID | Name | Features |
| -------------------------- | ----------------- | ----------------------------------- |
Expand All @@ -45,7 +45,7 @@ codeq models
## Usage

```bash
# Start CodeQ TUI
# Start Codeq TUI
codeq

# Run with a message
Expand All @@ -57,22 +57,23 @@ codeq /path/to/project

## Environment Variables

CodeQ uses the `CODEQ_` prefix for environment variables:
Codeq uses the `CODEQ_` prefix for environment variables:

| Variable | Description |
| ------------------------- | ------------------------------------ |
| `CODEQ_MODEL` | Default model to use |
| `CODEQ_DISABLE_TELEMETRY` | Disable usage telemetry |
| `CODEQ_LOG_LEVEL` | Log level (DEBUG, INFO, WARN, ERROR) |
| Variable | Description |
| ------------------------- | ------------------------------------------------ |
| `CODEQ_MODEL` | Default model to use |
| `CODEQ_DISABLE_TELEMETRY` | Disable usage telemetry |
| `CODEQ_LOG_LEVEL` | Log level (DEBUG, INFO, WARN, ERROR) |
| `QBRAID_API_URL` | Override qBraid API endpoint (e.g. staging) |

## Data Storage

CodeQ stores data in:
Codeq stores data in:

- **Config**: `~/.config/codeq/`
- **Cache**: `~/.cache/codeq/`
- **Data**: `~/.local/share/codeq/`

## Support

For issues with CodeQ, contact qBraid support at https://qbraid.com/support
For issues with Codeq, contact qBraid support at https://qbraid.com/support
4 changes: 2 additions & 2 deletions branding/qbraid/brand.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "../schema.json",
"version": 1,
"id": "qbraid",
"name": "qBraid CodeQ",
"name": "qBraid Codeq",
"logo": {
"cli": [
[" ", " "],
Expand All @@ -17,7 +17,7 @@
},
"replacements": {
"productName": "codeq",
"displayName": "CodeQ",
"displayName": "Codeq",
"npmPackage": "codeq",
"binaryName": "codeq",
"envPrefix": "CODEQ",
Expand Down
5 changes: 3 additions & 2 deletions branding/qbraid/generate-models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import { parseArgs } from "util"
import path from "path"
import { QBRAID_DEFAULT_API_URL } from "../../packages/opencode/src/provider/sdk/qbraid/index"

const { values } = parseArgs({
args: Bun.argv.slice(2),
Expand All @@ -28,7 +29,7 @@ Options:
--output, -o Output file path (default: models.json)
--help, -h Show this help message

This script generates the models.json configuration for qBraid CodeQ.
This script generates the models.json configuration for qBraid Codeq.
It defines the AI models available through qBraid's platform.
`)
process.exit(0)
Expand All @@ -42,7 +43,7 @@ const models = {
name: "qBraid",
env: ["QBRAID_API_KEY"],
npm: "@ai-sdk/openai-compatible",
api: "https://api.qbraid.com/ai/v1",
api: QBRAID_DEFAULT_API_URL,
models: {
"claude-sonnet-4": {
id: "claude-sonnet-4",
Expand Down
2 changes: 1 addition & 1 deletion branding/qbraid/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "qBraid",
"env": ["QBRAID_API_KEY"],
"npm": "@ai-sdk/qbraid",
"api": "https://account-v2.qbraid.com/api/ai/v1",
"api": "https://account.qbraid.com/api/ai/v1",
"models": {
"claude-opus-4-6": {
"id": "claude-opus-4-6",
Expand Down
2 changes: 1 addition & 1 deletion branding/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const ModelsSchema = z.object({
export const ReplacementsSchema = z.object({
/** Product name (e.g., "codeq" instead of "opencode") */
productName: z.string(),
/** Display name with proper casing (e.g., "CodeQ" instead of "OpenCode") */
/** Display name with proper casing (e.g., "Codeq" instead of "OpenCode") */
displayName: z.string(),
/** Package name for npm (e.g., "codeq" instead of "opencode-ai") */
npmPackage: z.string().optional(),
Expand Down
Loading