tars-ai-cli 0.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +133 -0
  3. package/dist/index.js +460 -0
  4. package/package.json +40 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 rain
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # TARS
2
+
3
+ **Tactical Automated Response System** - An AI-powered CLI coding assistant that helps you work with codebases through natural language.
4
+
5
+ ## Features
6
+
7
+ - **File Operations** - Read, edit, and create files with context awareness
8
+ - **Code Search** - Find files and search content using glob patterns and regex
9
+ - **Shell Integration** - Execute commands directly from the assistant
10
+ - **Project Understanding** - Analyzes your codebase structure and coding patterns
11
+ - **Style Consistency** - Matches existing code conventions automatically
12
+
13
+ ## Installation
14
+
15
+ ```bash
16
+ # Clone the repository
17
+ git clone https://github.com/0xrainee/tars
18
+ cd tars
19
+
20
+ # Install dependencies
21
+ bun install
22
+ ```
23
+
24
+ ## Setup
25
+
26
+ 1. Get a Google AI API key from [Google AI Studio](https://aistudio.google.com/app/apikey)
27
+
28
+ 2. Create a `.env` file:
29
+
30
+ ```bash
31
+ cp .env.example .env
32
+ ```
33
+
34
+ 3. Add your API key to `.env`:
35
+
36
+ ```
37
+ GOOGLE_GENERATIVE_AI_API_KEY=your_api_key_here
38
+ ```
39
+
40
+ ## Usage
41
+
42
+ ```bash
43
+ # Run in development mode
44
+ bun run dev
45
+
46
+ # Build for production
47
+ bun run build
48
+
49
+ # Run built version
50
+ bun start
51
+ ```
52
+
53
+ ### Example Commands
54
+
55
+ ```
56
+ What do you need? Add error handling to readFile function
57
+ What do you need? Find all TODO comments in the project
58
+ What do you need? Create a logger utility
59
+ What do you need? Fix the build
60
+ ```
61
+
62
+ ## How It Works
63
+
64
+ TARS operates autonomously through a loop:
65
+
66
+ 1. **Understands** your request using natural language
67
+ 2. **Analyzes** your codebase structure and patterns
68
+ 3. **Plans** the necessary steps
69
+ 4. **Executes** file operations and commands
70
+ 5. **Verifies** changes work correctly
71
+
72
+ ### Available Tools
73
+
74
+ - `read_file` - Read file contents with optional line ranges
75
+ - `edit_file` - Modify files using exact string replacement
76
+ - `new_file` - Create new files with proper formatting
77
+ - `grep` - Search file contents using regex patterns
78
+ - `glob` - Find files matching patterns (e.g., `**/*.ts`)
79
+ - `shell_command` - Execute shell commands
80
+
81
+ ## Configuration
82
+
83
+ TARS uses Google's Gemini 2.5 Flash model by default. The configuration can be modified in `src/core/processor.ts`:
84
+
85
+ ```typescript
86
+ this.config = {
87
+ LLMConfig: {
88
+ model: "gemini-2.5-flash",
89
+ },
90
+ // ...
91
+ };
92
+ ```
93
+
94
+ ## Project Structure
95
+
96
+ ```
97
+ tars/
98
+ ├── src/
99
+ │ ├── core/
100
+ │ │ ├── tools/ # Tool implementations
101
+ │ │ ├── ui/ # CLI interface
102
+ │ │ ├── contextManager.ts
103
+ │ │ ├── llm.ts
104
+ │ │ ├── processor.ts
105
+ │ │ └── prompt.ts
106
+ │ ├── types/
107
+ │ └── index.ts
108
+ └── package.json
109
+ ```
110
+
111
+ ## Requirements
112
+
113
+ - [Bun](https://bun.sh) v1.2.19 or higher
114
+ - Node.js (for compatibility)
115
+ - Google AI API key
116
+
117
+ ## Development
118
+
119
+ ```bash
120
+ # Run with auto-reload
121
+ bun run dev
122
+
123
+ # Type checking
124
+ bun run tsc --noEmit
125
+ ```
126
+
127
+ ## License
128
+
129
+ MIT License - see [LICENSE](LICENSE) for details
130
+
131
+ ## Credits
132
+
133
+ Created with Bun and powered by Google's Gemini AI.