diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fc6c67..9f03fe5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,12 +22,10 @@ jobs: uses: actions/setup-node@v3 with: node-version: 20 - - - name: Install PNPM - run: npm i pnpm -g + cache: 'npm' - name: Install dependencies - run: pnpm i + run: npm ci - name: Run build - run: pnpm run build + run: npm run build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 87c0119..5686f42 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,15 +22,13 @@ jobs: uses: actions/setup-node@v3 with: node-version: 20 - - - name: Install PNPM - run: npm i pnpm -g + cache: 'npm' - name: Install dependencies - run: pnpm i + run: npm ci - name: Build - run: pnpm run build + run: npm run build - name: Run linters - run: pnpm run lint + run: npm run lint diff --git a/.github/workflows/test-cli.yml b/.github/workflows/test-cli.yml index b060c43..271b148 100644 --- a/.github/workflows/test-cli.yml +++ b/.github/workflows/test-cli.yml @@ -15,26 +15,21 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Install pnpm - uses: pnpm/action-setup@v2 - with: - version: 8 - + - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' - cache: 'pnpm' - + cache: 'npm' + - name: Install dependencies - run: pnpm install - + run: npm ci + - name: Build - run: pnpm build + run: npm run build - name: Run E2E tests - run: pnpm test:e2e + run: npm run test:e2e env: ELEVENLABS_API_KEY: ${{ secrets.ELEVENLABS_TEST_API_KEY }} ELEVENLABS_TEST_API_KEY: ${{ secrets.ELEVENLABS_TEST_API_KEY_SECONDARY }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 484380e..e00f9bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,15 +21,13 @@ jobs: uses: actions/setup-node@v3 with: node-version: 20 - - - name: Install PNPM - run: npm i pnpm -g + cache: 'npm' - name: Install dependencies - run: pnpm i + run: npm ci - name: Run build - run: pnpm run build + run: npm run build - name: Run tests - run: pnpm run test + run: npm run test diff --git a/README.md b/README.md index 4d4a2dc..62ce6fc 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ elevenlabs agents init --override # Override existing files and recreate **Override mode** (`--override`): When you need to reset your project: - Overwrites all configuration files - Recreates directory structure from scratch -- ⚠️ **Warning**: This will delete all existing configurations in `agent_configs/`, `tool_configs/`, and `test_configs/` +- **Warning**: This will delete all existing configurations in `agent_configs/`, `tool_configs/`, and `test_configs/` Use `--override` when: - You want to start fresh with a clean configuration diff --git a/src/agents/commands/index.ts b/src/agents/commands/index.ts index 7e20f7f..c9dfc89 100644 --- a/src/agents/commands/index.ts +++ b/src/agents/commands/index.ts @@ -1,4 +1,6 @@ import { Command } from 'commander'; +import { render } from 'ink'; +import React from 'react'; import { createInitCommand } from './init.js'; import { createAddCommand } from './add.js'; import { createListCommand } from './list.js'; @@ -9,11 +11,28 @@ import { createPullCommand } from './pull.js'; import { createTemplatesCommand } from './templates.js'; import { createWidgetCommand } from './widget.js'; import { createTestCommand } from './test.js'; +import AgentsHelpView from '../ui/AgentsHelpView.js'; export function createAgentsCommand(): Command { const agents = new Command('agents'); agents.description('Manage ElevenLabs agents'); + // Disable default help + agents.helpOption(false); + agents.addHelpCommand(false); + + // Add custom help option + agents.option('-h, --help', 'Display help information'); + + // Custom action when agents command is run without subcommands + agents.action(async (options) => { + const { waitUntilExit } = render( + React.createElement(AgentsHelpView) + ); + await waitUntilExit(); + process.exit(0); + }); + agents.addCommand(createInitCommand()); agents.addCommand(createAddCommand()); agents.addCommand(createListCommand()); diff --git a/src/agents/ui/AgentsHelpView.tsx b/src/agents/ui/AgentsHelpView.tsx new file mode 100644 index 0000000..8fec2eb --- /dev/null +++ b/src/agents/ui/AgentsHelpView.tsx @@ -0,0 +1,152 @@ +// @ts-nocheck +import React, { useEffect } from "react"; +import { Box, Text, useApp } from "ink"; +import App from "../../ui/App.js"; +import theme from "../../ui/themes/elevenlabs.js"; + +interface Command { + name: string; + description: string; + options?: Array<{ flag: string; description: string }>; +} + +const commands: Command[] = [ + { + name: "init [path]", + description: "Initialize project", + options: [ + { flag: "--override", description: "Recreate existing project" }, + ], + }, + { + name: "add ", + description: "Create a new agent and push to remote", + options: [ + { flag: "--config-path ", description: "Custom config path" }, + { flag: "--template