Download desktop/src/api/cliAuth.ts from chenbhao/codev: direct link, hf CLI and curl.
- Browser
- Download file 809 Bytes
-
https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/cliAuth.ts
- Command line
-
hf download hf://chenbhao/codev@e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/cliAuth.ts
-
curl -L -o cliAuth.ts https://huggingface.co/chenbhao/codev/resolve/e40073cc959cd4729bf4009662bca374c5c4e266/desktop/src/api/cliAuth.ts
809 Bytes
| import { api } from './client' | |
| type AuthProvider = 'anthropic' | 'openai' | 'openrouter' | 'local' | 'opencode' | 'nvidia' | |
| type CliAuthConfig = { | |
| authProvider: AuthProvider | null | |
| nvidiaApiKey?: string | |
| openRouterApiKey?: string | |
| openAiApiKey?: string | |
| openAiAccessToken?: string | |
| openCodeApiKey?: string | |
| openCodeModelName?: string | |
| localBaseUrl?: string | |
| localModelName?: string | |
| } | |
| export type { AuthProvider, CliAuthConfig } | |
| export const cliAuthApi = { | |
| get(): Promise<CliAuthConfig> { | |
| return api.get<CliAuthConfig>('/api/cli-auth') | |
| }, | |
| update(config: Partial<CliAuthConfig>): Promise<{ ok: true }> { | |
| return api.put<{ ok: true }>('/api/cli-auth', config) | |
| }, | |
| invalidateCache(): Promise<{ ok: true }> { | |
| return api.post<{ ok: true }>('/api/cli-auth/invalidate', {}) | |
| }, | |
| } | |