MCPcopy Create free account
hub / github.com/Tencent/teamai-cli / getGitCodeToken

Function getGitCodeToken

src/providers/gitcode/gitcode-api.ts:39–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37
38/** Resolve the GitCode PAT from env, then ~/.netrc. Returns null when absent. */
39export function getGitCodeToken(): string | null {
40 for (const raw of [process.env.GITCODE_TOKEN, process.env.GC_TOKEN]) {
41 const token = raw?.trim();
42 if (token) return token;
43 }
44 return readNetrcToken();
45}
46
47function requireToken(): string {
48 const token = getGitCodeToken();

Callers 9

shallowCloneFunction · 0.85
fetchAuthHeaderFunction · 0.85
fetchGitCodeMRFunction · 0.85
gitcodeListOrgReposFunction · 0.85
requireTokenFunction · 0.85
gitcodeIsAuthenticatedFunction · 0.85
gitcodeWhoamiFunction · 0.85
gitcodeRepoCloneFunction · 0.85

Calls 1

readNetrcTokenFunction · 0.85

Tested by

no test coverage detected