tmpa-cli 1.0.5 → 1.0.6

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 (2) hide show
  1. package/bin/index.js +42 -42
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -8,18 +8,19 @@ const { execSync } = require('child_process');
8
8
 
9
9
  const CONFIG_FILE = path.join(os.homedir(), '.tmpa_config.json');
10
10
 
11
- // Color Palette (TrueColor / ANSI Escape Codes)
12
- const COLOR = {
11
+ // Exact RGB Gradient Colors (Cyan -> Light Blue -> Deep Blue -> Purple)
12
+ const C = {
13
13
  reset: '\x1b[0m',
14
- dim: '\x1b[2m',
15
- bold: '\x1b[1m',
16
- cyan: '\x1b[36m',
17
- blue: '\x1b[38;2;59;130;246m', // #3B82F6
18
- purple: '\x1b[38;2;168;85;247m', // #A855F7
19
- green: '\x1b[38;2;34;197;94m', // #22C55E
20
- yellow: '\x1b[38;2;234;179;8m', // #EAB308
21
- red: '\x1b[38;2;239;68;68m', // #EF4444
22
- gray: '\x1b[38;2;100;116;139m' // #64748B
14
+ c1: '\x1b[38;2;0;210;255m', // Bright Cyan
15
+ c2: '\x1b[38;2;30;144;255m', // Light Blue
16
+ c3: '\x1b[38;2;99;102;241m', // Indigo Blue
17
+ c4: '\x1b[38;2;168;85;247m', // Purple
18
+ green: '\x1b[38;2;34;197;94m',
19
+ cyan: '\x1b[38;2;6x;182;212m',
20
+ yellow: '\x1b[38;2;234;179;8m',
21
+ red: '\x1b[38;2;239;68;68m',
22
+ gray: '\x1b[38;2;148;163;184m',
23
+ darkGray: '\x1b[38;2;71;85;105m'
23
24
  };
24
25
 
25
26
  function loadConfig() {
@@ -44,20 +45,19 @@ function saveConfig(config) {
44
45
  function showBanner() {
45
46
  console.clear();
46
47
 
47
- // ASCII Art Banner with Blue-to-Purple Gradient Effect
48
- const line1 = `${COLOR.blue} ████████╗███╗ ███╗██████╗ █████╗ ${COLOR.reset}`;
49
- const line2 = `${COLOR.blue} ╚══██╔══╝████╗ ████║██╔══██╗██╔══██╗${COLOR.reset}`;
50
- const line3 = `${COLOR.blue} ██║ ██╔████╔██║██████╔╝███████║${COLOR.reset}`;
51
- const line4 = `${COLOR.purple} ██║ ██║╚██╔╝██║██╔═══╝ ██╔══██║${COLOR.reset}`;
52
- const line5 = `${COLOR.purple} ██║ ██║ ╚═╝ ██║██║ ██║ ██║${COLOR.reset}`;
53
- const line6 = `${COLOR.purple} ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝${COLOR.reset}`;
54
-
55
- console.log(`\n${line1}\n${line2}\n${line3}\n${line4}\n${line5}\n${line6}`);
56
- console.log(`${COLOR.gray}───────────────────────────────────────────────────${COLOR.reset}`);
57
- console.log(` ${COLOR.green}The Multi Platform AI [Interactive Mode]${COLOR.reset}`);
58
- console.log(` ${COLOR.gray}/config${COLOR.reset} : Set API Key | ${COLOR.gray}/connect${COLOR.reset} : Connect Web`);
59
- console.log(` ${COLOR.gray}/uninstall${COLOR.reset} : Remove CLI | ${COLOR.gray}/exit${COLOR.reset} : Exit Session`);
60
- console.log(`${COLOR.gray}───────────────────────────────────────────────────${COLOR.reset}\n`);
48
+ // Exact Banner matching the image structure
49
+ console.log(`
50
+ ${C.c1}████████╗███╗ ███╗██████╗ █████╗ ${C.reset}
51
+ ${C.c2}╚══██╔══╝████╗ ████║██╔══██╗██╔══██╗${C.reset}
52
+ ${C.c2} ██║ ██╔████╔██║██████╔╝███████║${C.reset}
53
+ ${C.c3} ██║ ██║╚██╔╝██║██╔═══╝ ██╔══██║${C.reset}
54
+ ${C.c4} ██║ ██║ ╚═╝ ██║██║ ██║ ██║${C.reset}
55
+ ${C.c4} ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝${C.reset}
56
+ ${C.darkGray}────────────────────────────────────────────────────────────${C.reset}
57
+ ${C.reset}The Multi Platform AI ${C.green}[Interactive Mode]${C.reset}
58
+ ${C.gray}/config : Set API | /connect : Web Integration | /uninstall : Remove | /exit : Exit${C.reset}
59
+ ${C.darkGray}────────────────────────────────────────────────────────────${C.reset}
60
+ `);
61
61
  }
62
62
 
63
63
  const rl = readline.createInterface({
@@ -68,12 +68,12 @@ const rl = readline.createInterface({
68
68
  let config = loadConfig();
69
69
 
70
70
  function askConfig(callback) {
71
- rl.question(`${COLOR.yellow}[>] Enter API Key:${COLOR.reset} `, (apiKey) => {
72
- rl.question(`${COLOR.yellow}[>] Enter Endpoint URL (Press Enter for Default Gemini):${COLOR.reset} `, (endpoint) => {
71
+ rl.question(`${C.yellow}[>] Enter API Key:${C.reset} `, (apiKey) => {
72
+ rl.question(`${C.yellow}[>] Enter Endpoint URL (Press Enter for Default Gemini):${C.reset} `, (endpoint) => {
73
73
  config.apiKey = apiKey.trim();
74
74
  config.endpoint = endpoint.trim() || 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent';
75
75
  saveConfig(config);
76
- console.log(`${COLOR.green}[+] Configuration saved successfully!${COLOR.reset}\n`);
76
+ console.log(`${C.green}[+] Configuration saved successfully!${C.reset}\n`);
77
77
  if (callback) callback();
78
78
  });
79
79
  });
@@ -81,7 +81,7 @@ function askConfig(callback) {
81
81
 
82
82
  async function handleChat(prompt) {
83
83
  if (!config.apiKey) {
84
- console.log(`${COLOR.yellow}[!] API Key is not set.${COLOR.reset}`);
84
+ console.log(`${C.yellow}[!] API Key is not set.${C.reset}`);
85
85
  return askConfig(() => startPrompt());
86
86
  }
87
87
 
@@ -89,7 +89,7 @@ async function handleChat(prompt) {
89
89
  config.endpoint = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent';
90
90
  }
91
91
 
92
- console.log(`${COLOR.yellow}TMPA CLI processing...${COLOR.reset}`);
92
+ console.log(`${C.yellow}TMPA CLI processing...${C.reset}`);
93
93
 
94
94
  try {
95
95
  const url = config.endpoint.includes('googleapis.com')
@@ -117,43 +117,43 @@ async function handleChat(prompt) {
117
117
  reply = data.message;
118
118
  }
119
119
 
120
- console.log(`\n${COLOR.blue}TMPA CLI :${COLOR.reset} ${reply}\n`);
120
+ console.log(`\n${C.c1}TMPA CLI :${C.reset} ${reply}\n`);
121
121
  } catch (error) {
122
- console.log(`\n${COLOR.red}[x] Error: ${error.message}${COLOR.reset}\n`);
122
+ console.log(`\n${C.red}[x] Error: ${error.message}${C.reset}\n`);
123
123
  }
124
124
 
125
125
  startPrompt();
126
126
  }
127
127
 
128
128
  function handleUninstall() {
129
- rl.question(`${COLOR.red}[!] Are you sure you want to uninstall TMPA CLI? (y/N):${COLOR.reset} `, (answer) => {
129
+ rl.question(`${C.red}[!] Are you sure you want to uninstall TMPA CLI? (y/N):${C.reset} `, (answer) => {
130
130
  if (answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes') {
131
- console.log(`\n${COLOR.yellow}[...] Removing TMPA CLI and cleaning configuration...${COLOR.reset}`);
131
+ console.log(`\n${C.yellow}[...] Removing TMPA CLI and cleaning configuration...${C.reset}`);
132
132
  try {
133
133
  if (fs.existsSync(CONFIG_FILE)) {
134
134
  fs.unlinkSync(CONFIG_FILE);
135
135
  }
136
- console.log(`${COLOR.green}[+] Local configuration cleared.${COLOR.reset}`);
136
+ console.log(`${C.green}[+] Local configuration cleared.${C.reset}`);
137
137
  execSync('npm uninstall -g tmpa-cli', { stdio: 'inherit' });
138
- console.log(`\n${COLOR.green}[+] TMPA CLI uninstalled successfully. Goodbye!${COLOR.reset}\n`);
138
+ console.log(`\n${C.green}[+] TMPA CLI uninstalled successfully. Goodbye!${C.reset}\n`);
139
139
  process.exit(0);
140
140
  } catch (err) {
141
- console.log(`\n${COLOR.red}[x] Failed to uninstall automatically. Run: npm uninstall -g tmpa-cli manually.${COLOR.reset}\n`);
141
+ console.log(`\n${C.red}[x] Failed to uninstall automatically. Run: npm uninstall -g tmpa-cli manually.${C.reset}\n`);
142
142
  process.exit(0);
143
143
  }
144
144
  } else {
145
- console.log(`${COLOR.gray}Uninstall process cancelled.${COLOR.reset}\n`);
145
+ console.log(`${C.gray}Uninstall process cancelled.${C.reset}\n`);
146
146
  startPrompt();
147
147
  }
148
148
  });
149
149
  }
150
150
 
151
151
  function startPrompt() {
152
- rl.question(`${COLOR.cyan}TMPA >${COLOR.reset} `, (input) => {
152
+ rl.question(`${C.c1}TMPA >${C.reset} `, (input) => {
153
153
  const cmd = input.trim();
154
154
 
155
155
  if (cmd === '/exit') {
156
- console.log(`${COLOR.gray}Goodbye!${COLOR.reset}`);
156
+ console.log(`${C.gray}Goodbye!${C.reset}`);
157
157
  process.exit(0);
158
158
  } else if (cmd === '/clear') {
159
159
  showBanner();
@@ -161,7 +161,7 @@ function startPrompt() {
161
161
  } else if (cmd === '/config') {
162
162
  askConfig(() => startPrompt());
163
163
  } else if (cmd === '/connect') {
164
- console.log(`\n${COLOR.purple}[!] [COMING SOON] Web integration & auth login features will be available in the next release.${COLOR.reset}\n`);
164
+ console.log(`\n${C.c4}[!] [COMING SOON] Web integration & auth login features will be available in the next release.${C.reset}\n`);
165
165
  startPrompt();
166
166
  } else if (cmd === '/uninstall') {
167
167
  handleUninstall();
@@ -173,7 +173,7 @@ function startPrompt() {
173
173
  });
174
174
  }
175
175
 
176
- // Program Entry Point
176
+ // Program Execution
177
177
  showBanner();
178
178
  if (!config.apiKey) {
179
179
  askConfig(() => startPrompt());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tmpa-cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "bin": {