trace.ai-cli 1.0.0 → 1.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.
- package/README.markdown +153 -0
- package/package.json +2 -3
package/README.markdown
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Trace.Ai CLI
|
|
2
|
+
|
|
3
|
+
A powerful AI-powered command-line tool powered by mixkey for analyzing files, folders, and images. Trace.AI CLI leverages artificial intelligence to provide code analysis, project structure insights, and text extraction from images, making it an essential tool for developers and analysts.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **File Analysis**: Analyze code files (e.g., JavaScript, Python, Java) for structure, quality, and potential improvements.
|
|
8
|
+
- **Folder Structure Analysis**: Get insights into project architecture, technology stack, and file organization, including a simple file tree.
|
|
9
|
+
- **Image Text Extraction**: Extract text from images (e.g., PNG, JPEG) using AI-powered OCR.
|
|
10
|
+
- **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
|
+
- **Extensible**: Supports a wide range of file types and languages, with customizable queries.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### Prerequisites
|
|
17
|
+
|
|
18
|
+
- **Node.js**: Version 14.0.0 or higher.
|
|
19
|
+
- **npm**: Included with Node.js.
|
|
20
|
+
|
|
21
|
+
### Install via npm
|
|
22
|
+
|
|
23
|
+
Install Trace.AI CLI globally:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install -g trace.ai-cli
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
If you encounter permission issues, try one of the following:
|
|
30
|
+
|
|
31
|
+
- **With sudo**:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
sudo npm install -g trace.ai-cli
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- **With a user-owned directory**:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
mkdir -p ~/.npm-global
|
|
41
|
+
npm config set prefix '~/.npm-global'
|
|
42
|
+
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc # or ~/.bashrc
|
|
43
|
+
source ~/.zshrc
|
|
44
|
+
npm install -g trace.ai-cli
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Verify the installation:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
trace-ai --version
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
Run the CLI in interactive mode:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
trace-ai
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This starts the interactive interface, where you can enter commands. Available commands:
|
|
62
|
+
|
|
63
|
+
- `/file "<path>" [question]`: Analyze a file with an optional question.
|
|
64
|
+
- `/folder "<path>" [question]`: Analyze a folder's structure with an optional question.
|
|
65
|
+
- `/image "<path>" [question]`: Extract text from an image with an optional question.
|
|
66
|
+
- `/context <text>`: Set text context for AI queries.
|
|
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.
|
|
72
|
+
|
|
73
|
+
### Examples
|
|
74
|
+
|
|
75
|
+
1. **Analyze a JavaScript file**:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
/file "/path/to/app.js"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Output: Code overview, key functions, issues, and optimization suggestions.
|
|
82
|
+
|
|
83
|
+
2. **Analyze a file with a specific question**:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
/file "/path/to/app.js" "find security vulnerabilities"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
3. **Analyze a project folder**:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
/folder "/path/to/project"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Output: Project overview, technology stack, and file tree.
|
|
96
|
+
|
|
97
|
+
4. **Extract text from an image**:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
/image "/path/to/screenshot.png"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
5. **Ask about a folder's structure**:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
/folder "/path/to/project" "describe the project structure"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
6. **Direct AI query**:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
Explain quantum computing
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Non-Interactive Usage
|
|
116
|
+
|
|
117
|
+
Run commands directly from the terminal:
|
|
118
|
+
|
|
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
|
+
```
|
|
125
|
+
|
|
126
|
+
## Configuration
|
|
127
|
+
|
|
128
|
+
- **Node.js Version**: Ensure Node.js >= 14.0.0 is installed.
|
|
129
|
+
- **File Size Limit**: File analysis is limited to 1MB for safety.
|
|
130
|
+
- **Folder Depth**: Folder analysis is limited to a depth of 2 by default to avoid excessive recursion.
|
|
131
|
+
|
|
132
|
+
## Supported File Types
|
|
133
|
+
|
|
134
|
+
- **Code**: JavaScript, Python, Java, C++, TypeScript, HTML, CSS, and more.
|
|
135
|
+
- **Images**: JPG, PNG, GIF, WebP, BMP, SVG.
|
|
136
|
+
- **Other**: JSON, YAML, Markdown, SQL, Shell scripts, and more.
|
|
137
|
+
|
|
138
|
+
## Contributing
|
|
139
|
+
|
|
140
|
+
Contributions are welcome! To contribute:
|
|
141
|
+
|
|
142
|
+
1. Fork the repository: https://github.com/yourusername/trace-ai-cli
|
|
143
|
+
2. Create a feature branch: `git checkout -b feature-name`
|
|
144
|
+
3. Commit your changes: `git commit -m "Add feature-name"`
|
|
145
|
+
4. Push to the branch: `git push origin feature-name`
|
|
146
|
+
5. Open a pull request.
|
|
147
|
+
|
|
148
|
+
Please include tests and update documentation as needed.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
Powered by Mixkey\
|
|
153
|
+
Built with ❤️ by Dukeindustries7.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trace.ai-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A powerful AI-powered CLI tool",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -34,6 +34,5 @@
|
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": ">=14.0.0"
|
|
37
|
-
}
|
|
38
|
-
"homepage": "https://github.com/yourusername/trace-ai-cli#readme"
|
|
37
|
+
}
|
|
39
38
|
}
|