@elevenlabs/convai-cli
Version:
CLI tool to manage ElevenLabs conversational AI agents
155 lines • 6.75 kB
JavaScript
// @ts-nocheck
import React, { useEffect } from "react";
import { Box, Text, useApp } from "ink";
import Gradient from "ink-gradient";
import BigText from "ink-big-text";
import App from "../App.js";
import theme from "../themes/elevenlabs.js";
import { readFileSync } from "fs";
import { fileURLToPath } from "url";
import { dirname, join } from "path";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const packageJson = JSON.parse(readFileSync(join(__dirname, "../../../package.json"), "utf-8"));
const { version } = packageJson;
const commands = [
{
name: "init [path]",
description: "Initialize a new agent management project",
},
{
name: "login",
description: "Login with your ElevenLabs API key",
},
{
name: "logout",
description: "Logout and remove stored API key",
},
{
name: "whoami",
description: "Show current login status",
},
{
name: "residency [location]",
description: "Set the API residency location",
},
{
name: "add",
description: "Add agents and tools",
subcommands: [
{
name: "agent <name>",
description: "Add a new agent",
},
{
name: "webhook-tool <name>",
description: "Add a new webhook tool",
},
{
name: "client-tool <name>",
description: "Add a new client tool",
},
],
},
{
name: "templates",
description: "Manage agent templates",
subcommands: [
{
name: "list",
description: "List available agent templates",
},
{
name: "show <template>",
description: "Show template configuration",
},
],
},
{
name: "sync",
description: "Synchronize agents with ElevenLabs API",
},
{
name: "status",
description: "Show the status of agents",
},
{
name: "watch",
description: "Watch for config changes and auto-sync",
},
{
name: "list-agents",
description: "List all configured agents",
},
{
name: "fetch",
description: "Fetch agents from ElevenLabs workspace",
},
{
name: "widget <name>",
description: "Generate HTML widget snippet for an agent",
},
];
export const HelpView = () => {
const { exit } = useApp();
useEffect(() => {
// Auto-exit after a short delay to allow the UI to render
const timer = setTimeout(() => {
exit();
}, 100);
return () => clearTimeout(timer);
}, [exit]);
return (React.createElement(App, { showOverlay: true },
React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
React.createElement(Box, { marginBottom: 1 },
React.createElement(Gradient, { name: "passion" },
React.createElement(BigText, { text: "convai", font: "chrome" }))),
React.createElement(Box, { marginBottom: 1 },
React.createElement(Text, { color: theme.colors.text.secondary },
"ElevenLabs Conversational AI Agent Manager CLI v",
version))),
React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
React.createElement(Box, { marginBottom: 1 },
React.createElement(Text, { color: theme.colors.accent.primary, bold: true }, "Usage:")),
React.createElement(Box, { marginLeft: 2 },
React.createElement(Text, { color: theme.colors.text.primary }, "convai [command] [options]"))),
React.createElement(Box, { flexDirection: "column", marginBottom: 1 },
React.createElement(Box, { marginBottom: 1 },
React.createElement(Text, { color: theme.colors.accent.primary, bold: true }, "Commands:")),
commands.map((cmd, index) => (React.createElement(Box, { key: index, flexDirection: "column", marginBottom: 0.5 },
React.createElement(Box, { marginLeft: 2 },
React.createElement(Box, { width: 24 },
React.createElement(Text, { color: theme.colors.text.primary }, cmd.name)),
React.createElement(Text, { color: theme.colors.text.secondary }, cmd.description)),
cmd.subcommands &&
cmd.subcommands.map((subcmd, subIndex) => (React.createElement(Box, { key: subIndex, marginLeft: 4 },
React.createElement(Box, { width: 22 },
React.createElement(Text, { color: theme.colors.text.muted }, subcmd.name)),
React.createElement(Text, { color: theme.colors.text.muted }, subcmd.description)))))))),
React.createElement(Box, { flexDirection: "column", marginTop: 1 },
React.createElement(Box, { marginBottom: 1 },
React.createElement(Text, { color: theme.colors.accent.primary, bold: true }, "Quick Start:")),
React.createElement(Box, { flexDirection: "column", marginLeft: 2 },
React.createElement(Text, { color: theme.colors.text.secondary },
"1. Initialize a project:",
" ",
React.createElement(Text, { color: theme.colors.success }, "convai init")),
React.createElement(Text, { color: theme.colors.text.secondary },
"2. Login with API key:",
" ",
React.createElement(Text, { color: theme.colors.success }, "convai login")),
React.createElement(Text, { color: theme.colors.text.secondary },
"3. Create an agent:",
" ",
React.createElement(Text, { color: theme.colors.success }, "convai add agent \"My Agent\"")),
React.createElement(Text, { color: theme.colors.text.secondary },
"4. Sync to ElevenLabs:",
" ",
React.createElement(Text, { color: theme.colors.success }, "convai sync")))),
React.createElement(Box, { marginTop: 1 },
React.createElement(Text, { color: theme.colors.text.muted }, "For more information on a command, use: convai [command] --help")),
React.createElement(Box, { marginTop: 1 },
React.createElement(Text, { color: theme.colors.text.muted }, "Disable UI mode with --no-ui flag for any command"))));
};
export default HelpView;
//# sourceMappingURL=HelpView.js.map