feat: build CLI core framework with Commander.js
Add CLI entry point with Commander.js, config management (~/.mcpctl/config.json with Zod validation), output formatters (table/json/yaml), config and status commands with dependency injection for testing. Fix sanitizeString regex ordering. 67 tests passing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
22
src/cli/src/config/schema.ts
Normal file
22
src/cli/src/config/schema.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
export const McpctlConfigSchema = z.object({
|
||||
/** mcpd daemon endpoint */
|
||||
daemonUrl: z.string().default('http://localhost:3000'),
|
||||
/** Active registries for search */
|
||||
registries: z.array(z.enum(['official', 'glama', 'smithery'])).default(['official', 'glama', 'smithery']),
|
||||
/** Cache TTL in milliseconds */
|
||||
cacheTTLMs: z.number().int().positive().default(3_600_000),
|
||||
/** HTTP proxy URL */
|
||||
httpProxy: z.string().optional(),
|
||||
/** HTTPS proxy URL */
|
||||
httpsProxy: z.string().optional(),
|
||||
/** Default output format */
|
||||
outputFormat: z.enum(['table', 'json', 'yaml']).default('table'),
|
||||
/** Smithery API key */
|
||||
smitheryApiKey: z.string().optional(),
|
||||
});
|
||||
|
||||
export type McpctlConfig = z.infer<typeof McpctlConfigSchema>;
|
||||
|
||||
export const DEFAULT_CONFIG: McpctlConfig = McpctlConfigSchema.parse({});
|
||||
Reference in New Issue
Block a user