diff options
| author | Dax Raad <[email protected]> | 2025-06-09 17:07:38 -0400 |
|---|---|---|
| committer | Dax Raad <[email protected]> | 2025-06-09 17:07:52 -0400 |
| commit | 4478195ea8a5e6a6e10b150687fe4ebc8483821f (patch) | |
| tree | 4b8681e0639d9c5a106c28c86c056de03a328085 | |
| parent | 54c4a783b3058e33003a3401f3c11b7e9bf2cd9f (diff) | |
| download | opencode-4478195ea8a5e6a6e10b150687fe4ebc8483821f.tar.gz opencode-4478195ea8a5e6a6e10b150687fe4ebc8483821f.zip | |
file permissions for anthropic credentials
| -rw-r--r-- | packages/opencode/src/auth/anthropic.ts | 6 | ||||
| -rw-r--r-- | packages/opencode/src/cli/cmd/run.ts | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/packages/opencode/src/auth/anthropic.ts b/packages/opencode/src/auth/anthropic.ts index f35d39ad4..cd1c23319 100644 --- a/packages/opencode/src/auth/anthropic.ts +++ b/packages/opencode/src/auth/anthropic.ts @@ -1,6 +1,8 @@ import { generatePKCE } from "@openauthjs/openauth/pkce" import { Global } from "../global" import path from "path" +import fs from "fs/promises" +import type { BunFile } from "bun" export namespace AuthAnthropic { const CLIENT_ID = "9d1c250a-e61b-44d9-88ed-5944d1962f5e" @@ -45,7 +47,9 @@ export namespace AuthAnthropic { }), }) if (!result.ok) throw new ExchangeFailed() - await Bun.write(path.join(Global.Path.data, "anthropic.json"), result) + const file = Bun.file(path.join(Global.Path.data, "anthropic.json")) + await Bun.write(file, result) + await fs.chmod(file.name!, 0o600) } export async function access() { diff --git a/packages/opencode/src/cli/cmd/run.ts b/packages/opencode/src/cli/cmd/run.ts index 190796ba6..837d4b66d 100644 --- a/packages/opencode/src/cli/cmd/run.ts +++ b/packages/opencode/src/cli/cmd/run.ts @@ -82,6 +82,8 @@ export const RunCommand = { printEvent(UI.Style.TEXT_INFO_BOLD, "Read", args.filePath) if (tool === "opencode_write") printEvent(UI.Style.TEXT_SUCCESS_BOLD, "Create", args.filePath) + if (tool === "opencode_list") + printEvent(UI.Style.TEXT_INFO_BOLD, "List", args.path) if (tool === "opencode_glob") printEvent( UI.Style.TEXT_INFO_BOLD, |
