2026-02-21 05:18:57 +00:00
|
|
|
import { describe, it, expect } from 'vitest';
|
|
|
|
|
import { createProgram } from '../../src/index.js';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* End-to-end tests that verify CLI command registration and help output
|
|
|
|
|
* without requiring a running daemon.
|
|
|
|
|
*/
|
|
|
|
|
describe('CLI command registration (e2e)', () => {
|
|
|
|
|
it('program has all expected commands', () => {
|
|
|
|
|
const program = createProgram();
|
|
|
|
|
const commandNames = program.commands.map((c) => c.name());
|
|
|
|
|
|
|
|
|
|
expect(commandNames).toContain('config');
|
|
|
|
|
expect(commandNames).toContain('status');
|
feat: implement v2 3-tier architecture (mcpctl → mcplocal → mcpd)
- Rename local-proxy to mcplocal with HTTP server, LLM pipeline, mcpd discovery
- Add LLM pre-processing: token estimation, filter cache, metrics, Gemini CLI + DeepSeek providers
- Add mcpd auth (login/logout) and MCP proxy endpoints
- Update CLI: dual URLs (mcplocalUrl/mcpdUrl), auth commands, --direct flag
- Add tiered health monitoring, shell completions, e2e integration tests
- 57 test files, 597 tests passing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 11:42:06 +00:00
|
|
|
expect(commandNames).toContain('login');
|
|
|
|
|
expect(commandNames).toContain('logout');
|
2026-02-21 05:18:57 +00:00
|
|
|
expect(commandNames).toContain('get');
|
|
|
|
|
expect(commandNames).toContain('describe');
|
2026-02-22 13:30:46 +00:00
|
|
|
expect(commandNames).toContain('delete');
|
|
|
|
|
expect(commandNames).toContain('logs');
|
2026-02-21 05:18:57 +00:00
|
|
|
expect(commandNames).toContain('apply');
|
2026-02-22 14:33:25 +00:00
|
|
|
expect(commandNames).toContain('create');
|
|
|
|
|
expect(commandNames).toContain('edit');
|
2026-02-21 05:18:57 +00:00
|
|
|
expect(commandNames).toContain('claude');
|
|
|
|
|
expect(commandNames).toContain('project');
|
2026-02-22 14:33:25 +00:00
|
|
|
expect(commandNames).toContain('backup');
|
|
|
|
|
expect(commandNames).toContain('restore');
|
2026-02-21 05:18:57 +00:00
|
|
|
});
|
|
|
|
|
|
2026-02-22 13:30:46 +00:00
|
|
|
it('instance command is removed (use get/delete/logs instead)', () => {
|
2026-02-21 05:18:57 +00:00
|
|
|
const program = createProgram();
|
2026-02-22 13:30:46 +00:00
|
|
|
const commandNames = program.commands.map((c) => c.name());
|
|
|
|
|
expect(commandNames).not.toContain('instance');
|
2026-02-21 05:18:57 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('claude command has config management subcommands', () => {
|
|
|
|
|
const program = createProgram();
|
|
|
|
|
const claude = program.commands.find((c) => c.name() === 'claude');
|
|
|
|
|
expect(claude).toBeDefined();
|
|
|
|
|
|
|
|
|
|
const subcommands = claude!.commands.map((c) => c.name());
|
|
|
|
|
expect(subcommands).toContain('generate');
|
|
|
|
|
expect(subcommands).toContain('show');
|
|
|
|
|
expect(subcommands).toContain('add');
|
|
|
|
|
expect(subcommands).toContain('remove');
|
|
|
|
|
});
|
|
|
|
|
|
feat: replace profiles with kubernetes-style secrets
Replace the confused Profile abstraction with a dedicated Secret resource
following Kubernetes conventions. Servers now have env entries with inline
values or secretRef references. Env vars are resolved and passed to
containers at startup (fixes existing gap).
- Add Secret CRUD (model, repo, service, routes, CLI commands)
- Server env: {name, value} or {name, valueFrom: {secretRef: {name, key}}}
- Add env-resolver utility shared by instance startup and config generation
- Remove all profile-related code (models, services, routes, CLI, tests)
- Update backup/restore for secrets instead of profiles
- describe secret masks values by default, --show-values to reveal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 18:40:58 +00:00
|
|
|
it('project command exists with alias', () => {
|
2026-02-21 05:18:57 +00:00
|
|
|
const program = createProgram();
|
|
|
|
|
const project = program.commands.find((c) => c.name() === 'project');
|
|
|
|
|
expect(project).toBeDefined();
|
feat: replace profiles with kubernetes-style secrets
Replace the confused Profile abstraction with a dedicated Secret resource
following Kubernetes conventions. Servers now have env entries with inline
values or secretRef references. Env vars are resolved and passed to
containers at startup (fixes existing gap).
- Add Secret CRUD (model, repo, service, routes, CLI commands)
- Server env: {name, value} or {name, valueFrom: {secretRef: {name, key}}}
- Add env-resolver utility shared by instance startup and config generation
- Remove all profile-related code (models, services, routes, CLI, tests)
- Update backup/restore for secrets instead of profiles
- describe secret masks values by default, --show-values to reveal
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 18:40:58 +00:00
|
|
|
expect(project!.alias()).toBe('proj');
|
2026-02-21 05:18:57 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('displays version', () => {
|
|
|
|
|
const program = createProgram();
|
|
|
|
|
expect(program.version()).toBeDefined();
|
|
|
|
|
expect(program.version()).toMatch(/^\d+\.\d+\.\d+$/);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('displays help without error', () => {
|
|
|
|
|
const program = createProgram();
|
|
|
|
|
const helpText = program.helpInformation();
|
|
|
|
|
expect(helpText).toContain('mcpctl');
|
|
|
|
|
expect(helpText).toContain('Manage MCP servers');
|
|
|
|
|
});
|
|
|
|
|
});
|