From 05a0068498022babb2e1c7ef4e7dab39e1092636 Mon Sep 17 00:00:00 2001 From: v1xingyue Date: Sun, 2 Mar 2025 20:14:49 +0800 Subject: [PATCH] cli use axios replace fetch --- packages/cli/index.js | 5 +++-- packages/cli/package.json | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/cli/index.js b/packages/cli/index.js index 9b001064b18..0ed8a66c224 100755 --- a/packages/cli/index.js +++ b/packages/cli/index.js @@ -6,6 +6,7 @@ const fs = require('fs') const { Command } = require('commander') const program = new Command() const { version } = require('./package.json') +const axios = require('axios') const pluginPkgPath = (pluginRepo) => { @@ -31,8 +32,8 @@ const pluginsCmd = new Command() .description('manage elizaOS plugins') async function getPlugins() { - const resp = await fetch('https://raw.githubusercontent.com/elizaos-plugins/registry/refs/heads/main/index.json') - return await resp.json(); + const resp = await axios.get('https://raw.githubusercontent.com/elizaos-plugins/registry/refs/heads/main/index.json') + return resp.data; } diff --git a/packages/cli/package.json b/packages/cli/package.json index 0d4e6daeaff..c92290f30ac 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -12,6 +12,7 @@ "license": "ISC", "description": "", "dependencies": { + "axios": "^1.8.1", "commander": "^13.1.0" } }