Update CLI scripts to enhance functionality and error handling. Change shebang in cli-ink.js for improved compatibility with TypeScript. Modify websearch.js to utilize EXA_API_KEY from environment variables, adding error handling for missing keys. Refactor wget.js to use ES module syntax and improve filename generation for downloaded content.
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import 'dotenv/config';
|
||||
import Exa from "exa-js";
|
||||
const exa = new Exa("1513ba88-5280-402b-9da3-e060d38f96d8");
|
||||
|
||||
const exaApiKey = process.env.EXA_API_KEY;
|
||||
if (!exaApiKey) {
|
||||
throw new Error("Missing EXA_API_KEY environment variable for websearch");
|
||||
}
|
||||
const exa = new Exa(exaApiKey);
|
||||
|
||||
export default {
|
||||
type: 'function',
|
||||
|
||||
Reference in New Issue
Block a user