Implementation
final FigSpec claudeSpec = FigSpec(
name: 'claude',
description: 'Claude Code CLI',
args: [
FigArg(
name: 'prompt',
isOptional: true,
),
],
options: _claudePersistentOptions,
subcommands: [
FigSubcommand(
name: 'agents',
description: 'Manage background agents',
),
FigSubcommand(
name: 'auth',
description: 'Manage authentication',
subcommands: [
FigSubcommand(
name: 'login',
description: 'Sign in to your Anthropic account',
),
FigSubcommand(
name: 'logout',
description: 'Log out from your Anthropic account',
),
FigSubcommand(
name: 'status',
description: 'Show authentication status',
),
],
),
FigSubcommand(
name: 'auto-mode',
description: 'Inspect auto mode classifier configuration',
),
FigSubcommand(
name: 'doctor',
description: 'Check the health of your Claude Code auto-updater',
),
FigSubcommand(
name: 'install',
description: 'Install Claude Code native build',
args: [
FigArg(
name: 'target',
isOptional: true,
suggestions: const [
FigSuggestion(name: 'stable'),
FigSuggestion(name: 'latest'),
],
),
],
),
FigSubcommand(
name: 'mcp',
description: 'Configure and manage MCP servers',
subcommands: [
FigSubcommand(
name: 'add',
description: 'Add an MCP server to Claude Code',
args: [
FigArg(name: 'name'),
FigArg(name: 'commandOrUrl'),
FigArg(name: 'args', isOptional: true, isVariadic: true),
],
options: [
_claudeValueOption(
'--callback-port',
'Fixed port for OAuth callback',
'port',
),
_claudeValueOption(
'--client-id',
'OAuth client ID for HTTP or SSE servers',
'clientId',
),
FigOption(
name: '--client-secret',
description: 'Prompt for OAuth client secret',
),
FigOption(
name: ['-e', '--env'],
description: 'Set environment variables',
args: [
FigArg(
name: 'env',
isVariadic: true,
),
],
),
FigOption(
name: ['-H', '--header'],
description: 'Set WebSocket headers',
args: [
FigArg(
name: 'header',
isVariadic: true,
),
],
),
FigOption(
name: ['-s', '--scope'],
description: 'Configuration scope',
args: [
FigArg(
name: 'scope',
suggestions: _claudeScopes,
),
],
),
FigOption(
name: ['-t', '--transport'],
description: 'Transport type',
args: [
FigArg(
name: 'transport',
suggestions: _claudeMcpTransports,
),
],
),
],
),
FigSubcommand(
name: 'add-from-claude-desktop',
description: 'Import MCP servers from Claude Desktop',
),
FigSubcommand(
name: 'add-json',
description: 'Add an MCP server with a JSON string',
args: [
FigArg(name: 'name'),
FigArg(name: 'json'),
],
),
FigSubcommand(
name: 'get',
description: 'Get details about an MCP server',
args: [FigArg(name: 'name')],
),
FigSubcommand(
name: 'list',
description: 'List configured MCP servers',
),
FigSubcommand(
name: 'remove',
description: 'Remove an MCP server',
args: [FigArg(name: 'name')],
options: [
FigOption(
name: ['-s', '--scope'],
description: 'Configuration scope',
args: [
FigArg(
name: 'scope',
suggestions: _claudeScopes,
),
],
),
],
),
FigSubcommand(
name: 'reset-project-choices',
description: 'Reset all approved and rejected project-scoped servers',
),
FigSubcommand(
name: 'serve',
description: 'Start the Claude Code MCP server',
),
],
),
FigSubcommand(
name: ['plugin', 'plugins'],
description: 'Manage Claude Code plugins',
subcommands: [
FigSubcommand(
name: 'details',
description:
'Show plugin component inventory and projected token cost',
args: [FigArg(name: 'name')],
),
FigSubcommand(
name: 'disable',
description: 'Disable an enabled plugin',
args: [FigArg(name: 'plugin', isOptional: true)],
),
FigSubcommand(
name: 'enable',
description: 'Enable a disabled plugin',
args: [FigArg(name: 'plugin')],
),
FigSubcommand(
name: ['install', 'i'],
description: 'Install a plugin from available marketplaces',
args: [FigArg(name: 'plugin')],
options: [
FigOption(
name: ['-s', '--scope'],
description: 'Installation scope',
args: [
FigArg(
name: 'scope',
suggestions: const [
FigSuggestion(name: 'user'),
FigSuggestion(name: 'project'),
FigSuggestion(name: 'local'),
],
),
],
),
],
),
FigSubcommand(
name: 'list',
description: 'List installed plugins',
),
FigSubcommand(
name: 'marketplace',
description: 'Manage Claude Code marketplaces',
),
FigSubcommand(
name: ['prune', 'autoremove'],
description:
'Remove auto-installed dependencies that are no longer needed',
),
FigSubcommand(
name: 'tag',
description: 'Create a release tag for a plugin',
args: [FigArg(name: 'path', isOptional: true, template: 'filepaths')],
),
FigSubcommand(
name: ['uninstall', 'remove'],
description: 'Uninstall an installed plugin',
args: [FigArg(name: 'plugin')],
),
FigSubcommand(
name: 'update',
description: 'Update a plugin to the latest version',
args: [FigArg(name: 'plugin')],
),
FigSubcommand(
name: 'validate',
description: 'Validate a plugin or marketplace manifest',
args: [FigArg(name: 'path', template: 'filepaths')],
),
],
),
FigSubcommand(
name: 'project',
description: 'Manage Claude Code project state',
),
FigSubcommand(
name: 'setup-token',
description: 'Set up a long-lived authentication token',
),
FigSubcommand(
name: 'ultrareview',
description: 'Run a cloud-hosted multi-agent code review',
args: [
FigArg(
name: 'target',
isOptional: true,
),
],
),
FigSubcommand(
name: ['update', 'upgrade'],
description: 'Check for updates and install if available',
),
],
);