aico-cli 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -0
  3. package/bin/aico.mjs +2 -0
  4. package/dist/cli.d.mts +1 -0
  5. package/dist/cli.d.ts +1 -0
  6. package/dist/cli.mjs +1475 -0
  7. package/dist/index.d.mts +154 -0
  8. package/dist/index.d.ts +154 -0
  9. package/dist/index.mjs +10 -0
  10. package/dist/shared/aico-cli.D4gky7Vp.mjs +2322 -0
  11. package/package.json +57 -0
  12. package/templates/CLAUDE.md +5 -0
  13. package/templates/en/memory/mcp.md +6 -0
  14. package/templates/en/memory/personality.md +1 -0
  15. package/templates/en/memory/rules.md +45 -0
  16. package/templates/en/memory/technical-guides.md +97 -0
  17. package/templates/en/workflow/bmad/commands/bmad-init.md +103 -0
  18. package/templates/en/workflow/git/commands/git-cleanBranches.md +101 -0
  19. package/templates/en/workflow/git/commands/git-commit.md +152 -0
  20. package/templates/en/workflow/git/commands/git-rollback.md +89 -0
  21. package/templates/en/workflow/plan/agents/planner.md +116 -0
  22. package/templates/en/workflow/plan/agents/ui-ux-designer.md +91 -0
  23. package/templates/en/workflow/plan/commands/feat.md +105 -0
  24. package/templates/en/workflow/sixStep/commands/workflow.md +230 -0
  25. package/templates/settings.json +33 -0
  26. package/templates/zh-CN/memory/mcp.md +34 -0
  27. package/templates/zh-CN/memory/personality.md +1 -0
  28. package/templates/zh-CN/memory/rules.md +45 -0
  29. package/templates/zh-CN/memory/technical-guides.md +126 -0
  30. package/templates/zh-CN/workflow/bmad/commands/bmad-init.md +109 -0
  31. package/templates/zh-CN/workflow/git/commands/git-cleanBranches.md +101 -0
  32. package/templates/zh-CN/workflow/git/commands/git-commit.md +152 -0
  33. package/templates/zh-CN/workflow/git/commands/git-rollback.md +90 -0
  34. package/templates/zh-CN/workflow/plan/agents/planner.md +116 -0
  35. package/templates/zh-CN/workflow/plan/agents/ui-ux-designer.md +91 -0
  36. package/templates/zh-CN/workflow/plan/commands/feat.md +105 -0
  37. package/templates/zh-CN/workflow/sixStep/commands/workflow.md +199 -0
@@ -0,0 +1,154 @@
1
+ type SupportedLang$1 = 'zh-CN' | 'en';
2
+ interface TranslationStructure {
3
+ common: any;
4
+ language: any;
5
+ installation: any;
6
+ api: any;
7
+ bmad: any;
8
+ workflow: any;
9
+ configuration: any;
10
+ mcp: any;
11
+ menu: any;
12
+ cli: any;
13
+ errors: any;
14
+ tools: any;
15
+ ccr: any;
16
+ }
17
+
18
+ interface McpService {
19
+ id: string;
20
+ name: {
21
+ en: string;
22
+ 'zh-CN': string;
23
+ };
24
+ description: {
25
+ en: string;
26
+ 'zh-CN': string;
27
+ };
28
+ requiresApiKey: boolean;
29
+ apiKeyPrompt?: {
30
+ en: string;
31
+ 'zh-CN': string;
32
+ };
33
+ apiKeyPlaceholder?: string;
34
+ apiKeyEnvVar?: string;
35
+ config: McpServerConfig;
36
+ }
37
+ interface McpServerConfig {
38
+ type: 'stdio' | 'sse';
39
+ command?: string;
40
+ args?: string[];
41
+ url?: string;
42
+ env?: Record<string, string>;
43
+ }
44
+ interface ClaudeConfiguration {
45
+ mcpServers: Record<string, McpServerConfig>;
46
+ hasCompletedOnboarding?: boolean;
47
+ }
48
+
49
+ declare const CLAUDE_DIR: string;
50
+ declare const SETTINGS_FILE: string;
51
+ declare const CLAUDE_MD_FILE: string;
52
+ declare const ClAUDE_CONFIG_FILE: string;
53
+ declare const LEGACY_AICO_CONFIG_FILE: string;
54
+ declare const AICO_CONFIG_FILE: string;
55
+ declare const SUPPORTED_LANGS: readonly ["zh-CN", "en"];
56
+ type SupportedLang = (typeof SUPPORTED_LANGS)[number];
57
+ declare const LANG_LABELS: {
58
+ readonly "zh-CN": "简体中文";
59
+ readonly en: "English";
60
+ };
61
+ declare const AI_OUTPUT_LANGUAGES: {
62
+ readonly "zh-CN": {
63
+ readonly label: "简体中文";
64
+ readonly directive: "Always respond in Chinese-simplified";
65
+ };
66
+ readonly en: {
67
+ readonly label: "English";
68
+ readonly directive: "Always respond in English";
69
+ };
70
+ readonly custom: {
71
+ readonly label: "Custom";
72
+ readonly directive: "";
73
+ };
74
+ };
75
+ type AiOutputLanguage = keyof typeof AI_OUTPUT_LANGUAGES;
76
+ declare const I18N: Record<SupportedLang$1, TranslationStructure>;
77
+ declare const MCP_SERVICES: McpService[];
78
+
79
+ interface InitOptions {
80
+ lang?: SupportedLang;
81
+ configLang?: SupportedLang;
82
+ aiOutputLang?: AiOutputLanguage | string;
83
+ force?: boolean;
84
+ skipBanner?: boolean;
85
+ }
86
+ declare function init(options?: InitOptions): Promise<void>;
87
+
88
+ declare function getPlatform(): "windows" | "macos" | "linux";
89
+ declare function commandExists(command: string): Promise<boolean>;
90
+
91
+ declare function isClaudeCodeInstalled(): Promise<boolean>;
92
+ declare function installClaudeCode(lang: SupportedLang): Promise<void>;
93
+
94
+ /**
95
+ * API configuration for Claude Code
96
+ */
97
+ interface ApiConfig {
98
+ url: string;
99
+ key: string;
100
+ authType?: 'auth_token' | 'api_key';
101
+ }
102
+
103
+ declare function ensureClaudeDir(): void;
104
+ declare function backupExistingConfig(): string | null;
105
+ declare function copyConfigFiles(lang: SupportedLang, onlyMd?: boolean): void;
106
+ declare function configureApi(apiConfig: ApiConfig | null): ApiConfig | null;
107
+ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
108
+ declare function updateDefaultModel(model: 'opus' | 'sonnet'): void;
109
+ /**
110
+ * Merge settings.json intelligently
111
+ * Preserves user's environment variables and custom configurations
112
+ */
113
+ declare function mergeSettingsFile(templatePath: string, targetPath: string): void;
114
+ /**
115
+ * Get existing API configuration from settings.json
116
+ */
117
+ declare function getExistingApiConfig(): ApiConfig | null;
118
+ declare function applyAiLanguageDirective(aiOutputLang: AiOutputLanguage | string): void;
119
+
120
+ declare function getMcpConfigPath(): string;
121
+ declare function readMcpConfig(): ClaudeConfiguration | null;
122
+ declare function writeMcpConfig(config: ClaudeConfiguration): void;
123
+ declare function backupMcpConfig(): string | null;
124
+ declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
125
+ declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
126
+ declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
127
+ declare function addCompletedOnboarding(): void;
128
+
129
+ declare function importRecommendedEnv(): Promise<void>;
130
+ declare function importRecommendedPermissions(): Promise<void>;
131
+ declare function openSettingsJson(): Promise<void>;
132
+
133
+ /**
134
+ * Clean up and deduplicate permissions array
135
+ * Removes invalid and redundant permissions based on template
136
+ */
137
+ /**
138
+ * Clean up permissions array by removing invalid and redundant entries
139
+ * @param templatePermissions - Permissions from template (source of truth)
140
+ * @param userPermissions - User's existing permissions
141
+ * @returns Cleaned permissions array
142
+ */
143
+ declare function cleanupPermissions(templatePermissions: string[], userPermissions: string[]): string[];
144
+ /**
145
+ * Merge and clean permissions arrays
146
+ * Combines template and user permissions while removing invalid/redundant entries
147
+ * @param templatePermissions - Permissions from template
148
+ * @param userPermissions - User's existing permissions
149
+ * @returns Merged and cleaned permissions array
150
+ */
151
+ declare function mergeAndCleanPermissions(templatePermissions: string[] | undefined, userPermissions: string[] | undefined): string[];
152
+
153
+ export { AICO_CONFIG_FILE, AI_OUTPUT_LANGUAGES, CLAUDE_DIR, CLAUDE_MD_FILE, ClAUDE_CONFIG_FILE, I18N, LANG_LABELS, LEGACY_AICO_CONFIG_FILE, MCP_SERVICES, SETTINGS_FILE, SUPPORTED_LANGS, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, ensureClaudeDir, fixWindowsMcpConfig, getExistingApiConfig, getMcpConfigPath, getPlatform, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, isClaudeCodeInstalled, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, readMcpConfig, updateDefaultModel, writeMcpConfig };
154
+ export type { AiOutputLanguage, ApiConfig, ClaudeConfiguration, McpServerConfig, McpService, SupportedLang };
@@ -0,0 +1,154 @@
1
+ type SupportedLang$1 = 'zh-CN' | 'en';
2
+ interface TranslationStructure {
3
+ common: any;
4
+ language: any;
5
+ installation: any;
6
+ api: any;
7
+ bmad: any;
8
+ workflow: any;
9
+ configuration: any;
10
+ mcp: any;
11
+ menu: any;
12
+ cli: any;
13
+ errors: any;
14
+ tools: any;
15
+ ccr: any;
16
+ }
17
+
18
+ interface McpService {
19
+ id: string;
20
+ name: {
21
+ en: string;
22
+ 'zh-CN': string;
23
+ };
24
+ description: {
25
+ en: string;
26
+ 'zh-CN': string;
27
+ };
28
+ requiresApiKey: boolean;
29
+ apiKeyPrompt?: {
30
+ en: string;
31
+ 'zh-CN': string;
32
+ };
33
+ apiKeyPlaceholder?: string;
34
+ apiKeyEnvVar?: string;
35
+ config: McpServerConfig;
36
+ }
37
+ interface McpServerConfig {
38
+ type: 'stdio' | 'sse';
39
+ command?: string;
40
+ args?: string[];
41
+ url?: string;
42
+ env?: Record<string, string>;
43
+ }
44
+ interface ClaudeConfiguration {
45
+ mcpServers: Record<string, McpServerConfig>;
46
+ hasCompletedOnboarding?: boolean;
47
+ }
48
+
49
+ declare const CLAUDE_DIR: string;
50
+ declare const SETTINGS_FILE: string;
51
+ declare const CLAUDE_MD_FILE: string;
52
+ declare const ClAUDE_CONFIG_FILE: string;
53
+ declare const LEGACY_AICO_CONFIG_FILE: string;
54
+ declare const AICO_CONFIG_FILE: string;
55
+ declare const SUPPORTED_LANGS: readonly ["zh-CN", "en"];
56
+ type SupportedLang = (typeof SUPPORTED_LANGS)[number];
57
+ declare const LANG_LABELS: {
58
+ readonly "zh-CN": "简体中文";
59
+ readonly en: "English";
60
+ };
61
+ declare const AI_OUTPUT_LANGUAGES: {
62
+ readonly "zh-CN": {
63
+ readonly label: "简体中文";
64
+ readonly directive: "Always respond in Chinese-simplified";
65
+ };
66
+ readonly en: {
67
+ readonly label: "English";
68
+ readonly directive: "Always respond in English";
69
+ };
70
+ readonly custom: {
71
+ readonly label: "Custom";
72
+ readonly directive: "";
73
+ };
74
+ };
75
+ type AiOutputLanguage = keyof typeof AI_OUTPUT_LANGUAGES;
76
+ declare const I18N: Record<SupportedLang$1, TranslationStructure>;
77
+ declare const MCP_SERVICES: McpService[];
78
+
79
+ interface InitOptions {
80
+ lang?: SupportedLang;
81
+ configLang?: SupportedLang;
82
+ aiOutputLang?: AiOutputLanguage | string;
83
+ force?: boolean;
84
+ skipBanner?: boolean;
85
+ }
86
+ declare function init(options?: InitOptions): Promise<void>;
87
+
88
+ declare function getPlatform(): "windows" | "macos" | "linux";
89
+ declare function commandExists(command: string): Promise<boolean>;
90
+
91
+ declare function isClaudeCodeInstalled(): Promise<boolean>;
92
+ declare function installClaudeCode(lang: SupportedLang): Promise<void>;
93
+
94
+ /**
95
+ * API configuration for Claude Code
96
+ */
97
+ interface ApiConfig {
98
+ url: string;
99
+ key: string;
100
+ authType?: 'auth_token' | 'api_key';
101
+ }
102
+
103
+ declare function ensureClaudeDir(): void;
104
+ declare function backupExistingConfig(): string | null;
105
+ declare function copyConfigFiles(lang: SupportedLang, onlyMd?: boolean): void;
106
+ declare function configureApi(apiConfig: ApiConfig | null): ApiConfig | null;
107
+ declare function mergeConfigs(sourceFile: string, targetFile: string): void;
108
+ declare function updateDefaultModel(model: 'opus' | 'sonnet'): void;
109
+ /**
110
+ * Merge settings.json intelligently
111
+ * Preserves user's environment variables and custom configurations
112
+ */
113
+ declare function mergeSettingsFile(templatePath: string, targetPath: string): void;
114
+ /**
115
+ * Get existing API configuration from settings.json
116
+ */
117
+ declare function getExistingApiConfig(): ApiConfig | null;
118
+ declare function applyAiLanguageDirective(aiOutputLang: AiOutputLanguage | string): void;
119
+
120
+ declare function getMcpConfigPath(): string;
121
+ declare function readMcpConfig(): ClaudeConfiguration | null;
122
+ declare function writeMcpConfig(config: ClaudeConfiguration): void;
123
+ declare function backupMcpConfig(): string | null;
124
+ declare function mergeMcpServers(existing: ClaudeConfiguration | null, newServers: Record<string, McpServerConfig>): ClaudeConfiguration;
125
+ declare function buildMcpServerConfig(baseConfig: McpServerConfig, apiKey?: string, placeholder?: string, envVarName?: string): McpServerConfig;
126
+ declare function fixWindowsMcpConfig(config: ClaudeConfiguration): ClaudeConfiguration;
127
+ declare function addCompletedOnboarding(): void;
128
+
129
+ declare function importRecommendedEnv(): Promise<void>;
130
+ declare function importRecommendedPermissions(): Promise<void>;
131
+ declare function openSettingsJson(): Promise<void>;
132
+
133
+ /**
134
+ * Clean up and deduplicate permissions array
135
+ * Removes invalid and redundant permissions based on template
136
+ */
137
+ /**
138
+ * Clean up permissions array by removing invalid and redundant entries
139
+ * @param templatePermissions - Permissions from template (source of truth)
140
+ * @param userPermissions - User's existing permissions
141
+ * @returns Cleaned permissions array
142
+ */
143
+ declare function cleanupPermissions(templatePermissions: string[], userPermissions: string[]): string[];
144
+ /**
145
+ * Merge and clean permissions arrays
146
+ * Combines template and user permissions while removing invalid/redundant entries
147
+ * @param templatePermissions - Permissions from template
148
+ * @param userPermissions - User's existing permissions
149
+ * @returns Merged and cleaned permissions array
150
+ */
151
+ declare function mergeAndCleanPermissions(templatePermissions: string[] | undefined, userPermissions: string[] | undefined): string[];
152
+
153
+ export { AICO_CONFIG_FILE, AI_OUTPUT_LANGUAGES, CLAUDE_DIR, CLAUDE_MD_FILE, ClAUDE_CONFIG_FILE, I18N, LANG_LABELS, LEGACY_AICO_CONFIG_FILE, MCP_SERVICES, SETTINGS_FILE, SUPPORTED_LANGS, addCompletedOnboarding, applyAiLanguageDirective, backupExistingConfig, backupMcpConfig, buildMcpServerConfig, cleanupPermissions, commandExists, configureApi, copyConfigFiles, ensureClaudeDir, fixWindowsMcpConfig, getExistingApiConfig, getMcpConfigPath, getPlatform, importRecommendedEnv, importRecommendedPermissions, init, installClaudeCode, isClaudeCodeInstalled, mergeAndCleanPermissions, mergeConfigs, mergeMcpServers, mergeSettingsFile, openSettingsJson, readMcpConfig, updateDefaultModel, writeMcpConfig };
154
+ export type { AiOutputLanguage, ApiConfig, ClaudeConfiguration, McpServerConfig, McpService, SupportedLang };
package/dist/index.mjs ADDED
@@ -0,0 +1,10 @@
1
+ export { A as AICO_CONFIG_FILE, k as AI_OUTPUT_LANGUAGES, C as CLAUDE_DIR, e as CLAUDE_MD_FILE, f as ClAUDE_CONFIG_FILE, I as I18N, j as LANG_LABELS, L as LEGACY_AICO_CONFIG_FILE, M as MCP_SERVICES, S as SETTINGS_FILE, h as SUPPORTED_LANGS, H as addCompletedOnboarding, x as applyAiLanguageDirective, q as backupExistingConfig, D as backupMcpConfig, F as buildMcpServerConfig, d as cleanupPermissions, c as commandExists, s as configureApi, r as copyConfigFiles, p as ensureClaudeDir, G as fixWindowsMcpConfig, w as getExistingApiConfig, y as getMcpConfigPath, g as getPlatform, a as importRecommendedEnv, b as importRecommendedPermissions, i as init, n as installClaudeCode, l as isClaudeCodeInstalled, m as mergeAndCleanPermissions, t as mergeConfigs, E as mergeMcpServers, v as mergeSettingsFile, o as openSettingsJson, z as readMcpConfig, u as updateDefaultModel, B as writeMcpConfig } from './shared/aico-cli.D4gky7Vp.mjs';
2
+ import 'inquirer';
3
+ import 'ansis';
4
+ import 'node:fs';
5
+ import 'pathe';
6
+ import 'dayjs';
7
+ import 'node:url';
8
+ import 'tinyexec';
9
+ import 'node:fs/promises';
10
+ import 'node:os';