MCPcopy Create free account
hub / github.com/Stevenic/codepilot / setKeys

Method setKeys

src/CodeIndex.ts:360–368  ·  view source on GitHub ↗

* Updates the OpenAI keys for the index. * @param keys Keys to use.

(keys: OpenAIKeys)

Source from the content-addressed store, hash-verified

358 * @param keys Keys to use.
359 */
360 public async setKeys(keys: OpenAIKeys): Promise<void> {
361 if (!await this.isCreated()) {
362 throw new Error('Index has not been created yet. Please run `codepilot create` first.');
363 }
364
365 // Overwrite keys file
366 await fs.writeFile(path.join(this.folderPath, 'vectra.keys'), JSON.stringify(keys));
367 this._keys = keys;
368 }
369
370 /**
371 * Updates the code index configuration.

Callers 1

runFunction · 0.95

Calls 1

isCreatedMethod · 0.95

Tested by

no test coverage detected