GeezerVison is showing github.com — Fix issue: Option to update username shown in conversations. (#975) · steipete/opencode@d8bcf4f
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: opencode.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | { |
2 | 2 | "$schema": "https://opencode.ai/config.json", |
| 3 | + "username": "testuser", |
3 | 4 | "mcp": { |
4 | 5 | "weather": { |
5 | 6 | "type": "local", |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/app/app.ts +5-1Lines changed: 5 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -69,8 +69,12 @@ export namespace App { |
69 | 69 |
|
70 | 70 | const root = git ?? input.cwd |
71 | 71 |
|
| 72 | + // Load config to get custom username if set |
| 73 | + const { Config } = await import("../config/config") |
| 74 | + const config = await Config.global() |
| 75 | + |
72 | 76 | const info: Info = { |
73 | | - user: os.userInfo().username, |
| 77 | + user: config.username || os.userInfo().username, |
74 | 78 | hostname: os.hostname(), |
75 | 79 | time: { |
76 | 80 | initialized: state.initialized, |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/config/config.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -122,6 +122,7 @@ export namespace Config { |
122 | 122 | autoupdate: z.boolean().optional().describe("Automatically update to the latest version"), |
123 | 123 | disabled_providers: z.array(z.string()).optional().describe("Disable providers that are loaded automatically"), |
124 | 124 | model: z.string().describe("Model to use in the format of provider/model, eg anthropic/claude-2").optional(), |
| 125 | + username: z.string().optional().describe("Custom username to display in conversations instead of system username"), |
125 | 126 | mode: z |
126 | 127 | .object({ |
127 | 128 | build: Mode.optional(), |
|