create-eliza
Version:
Initialize an Eliza project
44 lines (41 loc) • 1.53 kB
JavaScript
import { createRequire } from 'module';
const require = createRequire(import.meta.url);
import {
loadProject
} from "../chunk-D5ZCOX4P.js";
import "../chunk-34HYEHJA.js";
import {
logger
} from "../chunk-2ORHBMCI.js";
import {
Command
} from "../chunk-S757QXWN.js";
import "../chunk-4EWPPQT6.js";
import "../chunk-WCMDOJQK.js";
// src/commands/agent-plugin.ts
var agentPlugin = new Command("plugin").description("Manage plugins for an agent").argument("<agentId>", "The ID of the agent to manage plugins for").option("-a, --add <plugin>", "Add a plugin to the agent").option("-r, --remove <plugin>", "Remove a plugin from the agent").option("-l, --list", "List all plugins for the agent").option("-p, --project <path>", "Path to the project directory", ".").action(async (agentId, options) => {
try {
const project = await loadProject(options.project);
if (!project) {
throw new Error("Failed to load project");
}
if (options.list) {
const plugins = project.runtime.plugins;
logger.info("Installed plugins:");
plugins.forEach((plugin) => {
logger.info(`- ${plugin.name}`);
});
} else if (options.add) {
logger.info(`Adding plugin ${options.add} to agent ${agentId}`);
} else if (options.remove) {
logger.info(`Removing plugin ${options.remove} from agent ${agentId}`);
}
} catch (error) {
logger.error("Error managing plugins:", error);
process.exit(1);
}
});
export {
agentPlugin
};
//# sourceMappingURL=agent-plugin.js.map