trace.ai-cli 1.1.0 → 1.1.2
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.
- package/README.markdown +126 -57
- package/cli/traceAI.js +19 -0
- package/package.json +7 -5
- package/services/aiService.js +522 -1
- package/services/systemInfoService.js +713 -0
package/README.markdown
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# Trace.Ai CLI
|
|
2
2
|
|
|
3
|
-
A powerful AI-powered command-line tool powered by mixkey for analyzing files, folders, and
|
|
3
|
+
A powerful AI-powered command-line tool powered by mixkey for analyzing files, folders, images, and system information. Trace.AI CLI leverages artificial intelligence to provide code analysis, project structure insights, text extraction from images, and detailed system information, making it an essential tool for developers and analysts.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **File Analysis**: Analyze code files (e.g., JavaScript, Python, Java) for structure, quality, and potential improvements.
|
|
8
8
|
- **Folder Structure Analysis**: Get insights into project architecture, technology stack, and file organization, including a simple file tree.
|
|
9
9
|
- **Image Text Extraction**: Extract text from images (e.g., PNG, JPEG) using AI-powered OCR.
|
|
10
|
+
- **System Information**: Get detailed information about your system's hardware, software, and configuration.
|
|
10
11
|
- **Context Management**: Add text or file-based context to enhance AI responses.
|
|
11
|
-
- **Interactive CLI**: Easy-to-use interface with commands like `/file`, `/folder`, `/image`, and more.
|
|
12
|
+
- **Interactive CLI**: Easy-to-use interface with commands like `/file`, `/folder`, `/image`, `/system`, and more.
|
|
12
13
|
- **Extensible**: Supports a wide range of file types and languages, with customizable queries.
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
@@ -52,89 +53,157 @@ trace-ai --version
|
|
|
52
53
|
|
|
53
54
|
## Usage
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
### Interactive Mode
|
|
57
|
+
|
|
58
|
+
Start Trace.AI CLI in interactive mode:
|
|
56
59
|
|
|
57
60
|
```bash
|
|
58
61
|
trace-ai
|
|
59
62
|
```
|
|
60
63
|
|
|
61
|
-
This
|
|
64
|
+
This launches the interactive CLI interface where you can enter commands and queries.
|
|
65
|
+
|
|
66
|
+
### Commands
|
|
67
|
+
|
|
68
|
+
- **File Analysis**:
|
|
69
|
+
```
|
|
70
|
+
/file <file_path> [query]
|
|
71
|
+
```
|
|
72
|
+
Example: `/file src/app.js explain the main function`
|
|
73
|
+
|
|
74
|
+
- **Folder Analysis**:
|
|
75
|
+
```
|
|
76
|
+
/folder <folder_path> [query]
|
|
77
|
+
```
|
|
78
|
+
Example: `/folder src/ what is the architecture?`
|
|
79
|
+
|
|
80
|
+
- **Image Analysis**:
|
|
81
|
+
```
|
|
82
|
+
/image <image_path> [query]
|
|
83
|
+
```
|
|
84
|
+
Example: `/image diagram.png explain this flowchart`
|
|
85
|
+
|
|
86
|
+
- **System Information**:
|
|
87
|
+
```
|
|
88
|
+
/system [query]
|
|
89
|
+
```
|
|
90
|
+
Example: `/system cpu` or `/system memory` or just `/system` for all information
|
|
91
|
+
|
|
92
|
+
- **Add Context**:
|
|
93
|
+
```
|
|
94
|
+
/context <text>
|
|
95
|
+
```
|
|
96
|
+
Example: `/context This is a React project using TypeScript`
|
|
97
|
+
|
|
98
|
+
- **Add File as Context**:
|
|
99
|
+
```
|
|
100
|
+
/context-file <file_path>
|
|
101
|
+
```
|
|
102
|
+
Example: `/context-file README.md`
|
|
103
|
+
|
|
104
|
+
- **View Context**:
|
|
105
|
+
```
|
|
106
|
+
/view-context
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
- **Clear Context or Screen**:
|
|
110
|
+
```
|
|
111
|
+
/clear [type]
|
|
112
|
+
```
|
|
113
|
+
Example: `/clear context` or `/clear screen`
|
|
114
|
+
|
|
115
|
+
- **Help**:
|
|
116
|
+
```
|
|
117
|
+
/help
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
- **Statistics**:
|
|
121
|
+
```
|
|
122
|
+
/stats
|
|
123
|
+
```
|
|
62
124
|
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- `/context-file "<path>"`: Add a file as context.
|
|
68
|
-
- `/view-context`: View current contexts.
|
|
69
|
-
- `/clear [text|file "<path>"]`: Clear text or file context.
|
|
70
|
-
- `/exit`: Exit the CLI.
|
|
71
|
-
- Direct questions: Type a question to query the AI with current context.
|
|
125
|
+
- **Exit**:
|
|
126
|
+
```
|
|
127
|
+
/exit
|
|
128
|
+
```
|
|
72
129
|
|
|
73
|
-
###
|
|
130
|
+
### Direct Queries
|
|
74
131
|
|
|
75
|
-
|
|
132
|
+
You can also ask questions directly without using commands:
|
|
76
133
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
134
|
+
```
|
|
135
|
+
What is the difference between let and const in JavaScript?
|
|
136
|
+
```
|
|
80
137
|
|
|
81
|
-
|
|
138
|
+
```
|
|
139
|
+
How do I implement a binary search tree in Python?
|
|
140
|
+
```
|
|
82
141
|
|
|
83
|
-
|
|
142
|
+
```
|
|
143
|
+
What's the current CPU usage on my system?
|
|
144
|
+
```
|
|
84
145
|
|
|
85
|
-
|
|
86
|
-
/file "/path/to/app.js" "find security vulnerabilities"
|
|
87
|
-
```
|
|
146
|
+
## System Information Features
|
|
88
147
|
|
|
89
|
-
|
|
148
|
+
Trace.AI CLI can provide detailed information about your system, including:
|
|
90
149
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
150
|
+
- **System Overview**: Platform, architecture, hostname, uptime, manufacturer, model, and system details
|
|
151
|
+
- **CPU Information**: Manufacturer, brand, model, cores, speed, temperature, load, virtualization, and cache details
|
|
152
|
+
- **Memory Information**: Total, used, free, and available memory with usage percentages, swap information, and detailed memory module specifications
|
|
153
|
+
- **Disk Information**: Filesystem details, block devices, disk layout, size, used space, available space, and usage percentages
|
|
154
|
+
- **Network Information**: Interface details, IP addresses (IPv4/IPv6), MAC addresses, connection statistics, WiFi networks, internet latency, and public IP address
|
|
155
|
+
- **Process Information**: Current process details, system process summary, top CPU-consuming processes, and system services
|
|
156
|
+
- **Environment Variables**: Filtered environment variables for security (PATH, USER, HOME, etc.), user session information, and shell history
|
|
94
157
|
|
|
95
|
-
|
|
158
|
+
The system information is retrieved using the powerful `systeminformation` library with fallback mechanisms for reliability across different operating systems.
|
|
96
159
|
|
|
97
|
-
|
|
160
|
+
## Examples
|
|
98
161
|
|
|
99
|
-
|
|
100
|
-
/image "/path/to/screenshot.png"
|
|
101
|
-
```
|
|
162
|
+
### Get All System Information
|
|
102
163
|
|
|
103
|
-
|
|
164
|
+
```
|
|
165
|
+
/system
|
|
166
|
+
```
|
|
167
|
+
Returns all available system information categories.
|
|
104
168
|
|
|
105
|
-
|
|
106
|
-
/folder "/path/to/project" "describe the project structure"
|
|
107
|
-
```
|
|
169
|
+
### Natural Language Queries
|
|
108
170
|
|
|
109
|
-
|
|
171
|
+
The system information feature supports natural language queries that automatically determine which information to return:
|
|
110
172
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
173
|
+
```
|
|
174
|
+
/system How much RAM do I have available?
|
|
175
|
+
```
|
|
176
|
+
Automatically returns memory information.
|
|
114
177
|
|
|
115
|
-
|
|
178
|
+
```
|
|
179
|
+
/system What's my CPU temperature?
|
|
180
|
+
```
|
|
181
|
+
Automatically returns CPU information with temperature details.
|
|
116
182
|
|
|
117
|
-
|
|
183
|
+
```
|
|
184
|
+
/system Tell me about my disk usage
|
|
185
|
+
```
|
|
186
|
+
Automatically returns disk information with usage statistics.
|
|
118
187
|
|
|
119
|
-
```bash
|
|
120
|
-
trace-ai file "/path/to/app.js" "explain this code"
|
|
121
|
-
trace-ai folder "/path/to/project" "what is the architecture?"
|
|
122
|
-
trace-ai image "/path/to/image.png"
|
|
123
|
-
trace-ai ask "What is the purpose of a manifest.json file?"
|
|
124
188
|
```
|
|
189
|
+
/system Show me my network connections
|
|
190
|
+
```
|
|
191
|
+
Automatically returns network information.
|
|
125
192
|
|
|
126
|
-
|
|
193
|
+
You can also ask direct questions without the /system command:
|
|
127
194
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
195
|
+
```
|
|
196
|
+
What's my operating system version?
|
|
197
|
+
```
|
|
131
198
|
|
|
132
|
-
|
|
199
|
+
```
|
|
200
|
+
How many CPU cores do I have?
|
|
201
|
+
```
|
|
133
202
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
203
|
+
```
|
|
204
|
+
What's my current memory usage?
|
|
205
|
+
```
|
|
137
206
|
|
|
207
|
+
## License
|
|
138
208
|
|
|
139
|
-
|
|
140
|
-
Built with ❤️ by Dukeindustries7.
|
|
209
|
+
MIT
|
package/cli/traceAI.js
CHANGED
|
@@ -140,6 +140,12 @@ class TraceAI {
|
|
|
140
140
|
example: '/stats',
|
|
141
141
|
icon: '📊'
|
|
142
142
|
},
|
|
143
|
+
{
|
|
144
|
+
cmd: '/system [query]',
|
|
145
|
+
desc: 'Get system information',
|
|
146
|
+
example: '/system cpu',
|
|
147
|
+
icon: '💻'
|
|
148
|
+
},
|
|
143
149
|
{
|
|
144
150
|
cmd: '/exit',
|
|
145
151
|
desc: 'Exit the application',
|
|
@@ -213,6 +219,7 @@ class TraceAI {
|
|
|
213
219
|
'/clear': () => this.handleClearCommand(trimmedInput),
|
|
214
220
|
'/help': () => this.displayHelp(),
|
|
215
221
|
'/stats': () => this.displayStats(),
|
|
222
|
+
'/system': () => this.handleSystemCommand(trimmedInput),
|
|
216
223
|
'/exit': () => this.close()
|
|
217
224
|
};
|
|
218
225
|
|
|
@@ -385,6 +392,18 @@ class TraceAI {
|
|
|
385
392
|
console.log(`${chalk.blueBright('📅')} Started: ${chalk.white(this.sessionStartTime.toLocaleString())}`);
|
|
386
393
|
console.log(chalk.gray('━'.repeat(40)));
|
|
387
394
|
}
|
|
395
|
+
|
|
396
|
+
async handleSystemCommand(input) {
|
|
397
|
+
const query = input.substring('/system'.length).trim();
|
|
398
|
+
|
|
399
|
+
await this.executeWithSpinner(
|
|
400
|
+
'Retrieving system information',
|
|
401
|
+
async () => {
|
|
402
|
+
const result = await processWithAI(query ? `Get system information about ${query}` : 'Get system information');
|
|
403
|
+
this.displayResult('System Information', result);
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
}
|
|
388
407
|
|
|
389
408
|
async handleTextQuery(input) {
|
|
390
409
|
await this.executeWithSpinner(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trace.ai-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "A powerful AI-powered CLI tool",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -30,13 +30,15 @@
|
|
|
30
30
|
"author": "Dukeindustries7",
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"node-fetch": "^2.6.7",
|
|
34
|
-
"figlet": "^1.7.0",
|
|
35
33
|
"chalk": "^4.1.2",
|
|
36
34
|
"cli-spinners": "^2.9.2",
|
|
37
|
-
"
|
|
35
|
+
"figlet": "^1.7.0",
|
|
36
|
+
"node-fetch": "^2.6.7",
|
|
37
|
+
"ora": "^5.4.1",
|
|
38
|
+
"os-utils": "^0.0.14",
|
|
39
|
+
"systeminformation": "^5.27.1"
|
|
38
40
|
},
|
|
39
41
|
"engines": {
|
|
40
42
|
"node": ">=14.0.0"
|
|
41
43
|
}
|
|
42
|
-
}
|
|
44
|
+
}
|