mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
- Allow --api-key and ROO_API_KEY env var for the roo provider instead of requiring cloud auth token - Switch dev/start scripts to use tsx for running directly from source without building first - Fix path resolution (version.ts, extension.ts, extension-host.ts) to work from both source and bundled locations - Disable debug log file (~/.roo/cli-debug.log) unless --debug is passed - Update README with complete env var table and dev workflow docs Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
24 lines
635 B
TypeScript
24 lines
635 B
TypeScript
import fs from "fs"
|
|
import path from "path"
|
|
import { fileURLToPath } from "url"
|
|
|
|
// Walk up from the current file to find the nearest package.json.
|
|
// This works whether running from source (tsx src/lib/utils/) or bundle (dist/).
|
|
function findVersion(): string {
|
|
let dir = path.dirname(fileURLToPath(import.meta.url))
|
|
|
|
while (dir !== path.dirname(dir)) {
|
|
const candidate = path.join(dir, "package.json")
|
|
|
|
if (fs.existsSync(candidate)) {
|
|
const packageJson = JSON.parse(fs.readFileSync(candidate, "utf-8"))
|
|
return packageJson.version
|
|
}
|
|
|
|
dir = path.dirname(dir)
|
|
}
|
|
|
|
return "0.0.0"
|
|
}
|
|
|
|
export const VERSION = findVersion()
|