summaryrefslogtreecommitdiff
path: root/packages/cli/src/config/config.ts
diff options
context:
space:
mode:
authorTommaso Sciortino <[email protected]>2025-06-06 16:21:20 -0700
committerGitHub <[email protected]>2025-06-06 16:21:20 -0700
commit76ec9122c0dd36f0535a74c65811c0f7bd138f4d (patch)
tree0c13eb04f40fd084dd76453598d95ea785231243 /packages/cli/src/config/config.ts
parente94a10023dcb7a3a3a88262e069815de3a985f7c (diff)
clean up version lookup code (#804)
Diffstat (limited to 'packages/cli/src/config/config.ts')
-rw-r--r--packages/cli/src/config/config.ts15
1 files changed, 3 insertions, 12 deletions
diff --git a/packages/cli/src/config/config.ts b/packages/cli/src/config/config.ts
index e363587f..f18ddcdf 100644
--- a/packages/cli/src/config/config.ts
+++ b/packages/cli/src/config/config.ts
@@ -18,11 +18,11 @@ import {
ApprovalMode,
} from '@gemini-code/core';
import { Settings } from './settings.js';
-import { readPackageUp } from 'read-package-up';
import {
getEffectiveModel,
type EffectiveModelCheckResult,
} from '../utils/modelCheck.js';
+import { getCliVersion } from '../utils/version.js';
// Simple console logger for now - replace with actual logger if available
const logger = {
@@ -239,15 +239,6 @@ export async function loadCliConfig(
}
async function createUserAgent(): Promise<string> {
- try {
- const packageJsonInfo = await readPackageUp({ cwd: import.meta.url });
- const cliVersion = packageJsonInfo?.packageJson.version || 'unknown';
- return `GeminiCLI/${cliVersion} Node.js/${process.version} (${process.platform}; ${process.arch})`;
- } catch (error: unknown) {
- const message = error instanceof Error ? error.message : String(error);
- logger.warn(
- `Could not determine package version for User-Agent: ${message}`,
- );
- return `GeminiCLI/unknown Node.js/${process.version} (${process.platform}; ${process.arch})`;
- }
+ const cliVersion = await getCliVersion();
+ return `GeminiCLI/${cliVersion} Node.js/${process.version} (${process.platform}; ${process.arch})`;
}