tmpa-cli 1.0.1 β†’ 1.0.3

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 (3) hide show
  1. package/README.md +91 -0
  2. package/bin/index.js +12 -2
  3. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # πŸš€ TMPA CLI (The Multi Platform AI)
2
+
3
+ [![npm version](https://img.shields.io/npm/v/tmpa-cli.svg?color=blue)](https://www.npmjs.com/package/tmpa-cli)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ **TMPA CLI** is an interactive Node.js-based Command Line Interface (CLI) application that allows you to chat with various AI models (such as Google Gemini API or your own Custom REST API) directly from your terminal without opening a browser.
7
+
8
+ ---
9
+
10
+ ## ✨ Key Features
11
+
12
+ - 🎨 **Modern Terminal UI**: Features a colorful futuristic ASCII Art banner and real-time loading indicators.
13
+ - 🌐 **Multi-Endpoint API**: Supports **Google Gemini API** (*default*) as well as your own **Custom REST API Endpoint**.
14
+ - βš™οΈ **Flexible Configuration**: Your API Key and Endpoint settings are securely saved in a local configuration file (`~/.tmpa_config.json`).
15
+ - ⚑ **Instant Commands**: Internal command support such as `/config`, `/clear`, and `/exit`.
16
+ - πŸͺΆ **Lightweight & Fast**: Zero heavy dependencies, runs smoothly on Termux (Android), Linux, macOS, and Windows Terminal.
17
+
18
+ ---
19
+
20
+ ## πŸ“¦ Installation
21
+
22
+ ### 1. Official Installation via npm (Recommended)
23
+
24
+ Make sure you have **Node.js** (v18+) installed in your terminal. Run the following global command:
25
+
26
+ ```bash
27
+ npm install -g tmpa-cli
28
+
29
+ 2. Installation via GitHub
30
+ ​You can also install directly from the GitHub repository:
31
+
32
+ npm install -g git+[https://github.com/zayyanathariz63-pixel/TMPA-CLI.git](https://github.com/zayyanathariz63-pixel/TMPA-CLI.git)
33
+
34
+ πŸš€ Usage
35
+ ​Once installed, simply open your terminal and type:
36
+
37
+ bash :
38
+ tmpa
39
+
40
+ πŸ”‘ First-Time Setup
41
+ ​When you run the application for the first time, you will be prompted to enter:
42
+
43
+ 1. API Key: Your API Key (e.g., from Google AI Studio).
44
+ 2. API Endpoint URL:
45
+ ​Press Enter to use the default Gemini API (gemini-2.5-flash).
46
+ ​Or enter your own Custom REST API URL.
47
+
48
+ β€‹πŸ•ΉοΈ In-CLI Commands
49
+ ​While inside the TMPA > chat session, you can use the following control commands:
50
+
51
+ Command Description
52
+ /config --> Update or change stored API Key and API Endpoint
53
+ /clear --> Clear the terminal screen and display the main banner
54
+ /exit --> Exit the TMPA CLI application
55
+
56
+ Preview Example :
57
+ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
58
+ β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—
59
+ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘
60
+ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘
61
+ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘
62
+ β•šβ•β• β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β• β•šβ•β•
63
+ ───────────────────────────────────────────────────
64
+ The Multi Platform AI [Interactive Mode]
65
+ /config : Change API | /clear : Clear Screen | /exit : Exit
66
+ ───────────────────────────────────────────────────
67
+
68
+ TMPA > hello, who are you?
69
+ TMPA CLI processing...
70
+ TMPA CLI : I am an AI assistant ready to help you!
71
+
72
+ πŸ“ Project Structure :
73
+ tmpa-cli/
74
+ β”œβ”€β”€ bin/
75
+ β”‚ └── index.js # Main CLI script (Node.js)
76
+ β”œβ”€β”€ .gitignore # Git ignore rules
77
+ β”œβ”€β”€ package.json # npm package manifest
78
+ └── README.md # Official project documentation
79
+
80
+ ## πŸ“Œ Roadmap (Fitur Yang Akan Datang)
81
+
82
+ - [ ] πŸ” **Sistem Login Integration**: Auth langsung dari CLI ke akun TMPA.
83
+ - [ ] πŸ”— **Perintah `/connect`**: Fitur interaktif untuk memilih dan terhubung ke berbagai endpoint/website TMPA secara langsung.
84
+ - [ ] 🎨 **Tema UI Kustom**: Pilihan warna dan tampilan terminal.
85
+
86
+
87
+ πŸ“„ License
88
+ ​This project is licensed under the MIT License.
89
+ β€‹πŸ‘€ Developer
90
+ ​Developed by Zayyan Athariz - GitHub: @zayyanathariz63-pixel
91
+ ​npm: tmpa-cli
package/bin/index.js CHANGED
@@ -11,7 +11,12 @@ const CONFIG_FILE = path.join(os.homedir(), '.tmpa_config.json');
11
11
  function loadConfig() {
12
12
  if (fs.existsSync(CONFIG_FILE)) {
13
13
  try {
14
- return JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
14
+ const data = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf8'));
15
+ // Pastikan endpoint selalu ada nilainya agar tidak undefined
16
+ if (!data.endpoint) {
17
+ data.endpoint = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent';
18
+ }
19
+ return data;
15
20
  } catch (e) {
16
21
  return {};
17
22
  }
@@ -63,6 +68,11 @@ async function handleChat(prompt) {
63
68
  return askConfig(() => startPrompt());
64
69
  }
65
70
 
71
+ // Pastikan endpoint aman dari undefined
72
+ if (!config.endpoint) {
73
+ config.endpoint = 'https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent';
74
+ }
75
+
66
76
  console.log('\x1b[33mTMPA CLI memproses...\x1b[0m');
67
77
 
68
78
  try {
@@ -113,7 +123,7 @@ function handleUninstall() {
113
123
  process.exit(0);
114
124
  } catch (err) {
115
125
  console.log('\n❌ Gagal uninstall otomatis. Jalankan: npm uninstall -g tmpa-cli secara manual.\n');
116
- startPrompt();
126
+ process.exit(0);
117
127
  }
118
128
  } else {
119
129
  console.log('Batal menghapus.\n');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tmpa-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "bin": {