lovecode-ai 0.1.0

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.md ADDED
@@ -0,0 +1,175 @@
1
+ # LoveCode AI ⚡
2
+
3
+ **Open-source terminal-native autonomous coding agent powered by free AI models.**
4
+
5
+ LoveCode AI is a terminal-first autonomous coding assistant that helps developers write code, edit files, debug issues, execute commands, understand repositories, and automate workflows — using free and local AI models.
6
+
7
+ ```bash
8
+ npm install -g lovecode-ai
9
+ lovecode
10
+ ```
11
+
12
+ ---
13
+
14
+ ## Features
15
+
16
+ | Feature | Description |
17
+ |---------|-------------|
18
+ | **Lightweight** | Fast startup and low RAM usage |
19
+ | **Open Source** | Community-driven, MIT licensed |
20
+ | **Terminal Native** | Keyboard-first workflow, no IDE required |
21
+ | **Free AI First** | No paid API dependency |
22
+ | **Autonomous** | Multi-step agent workflows |
23
+ | **Offline Capable** | Local AI support via Ollama |
24
+
25
+ ## Install
26
+
27
+ ### npm (recommended)
28
+
29
+ ```bash
30
+ npm install -g lovecode-ai
31
+ ```
32
+
33
+ ### From source
34
+
35
+ ```bash
36
+ git clone https://github.com/anomalyco/lovecode.git
37
+ cd lovecode
38
+ npm install
39
+ npm run build
40
+ npm link
41
+ ```
42
+
43
+ ## Quick Start
44
+
45
+ ```bash
46
+ # Start an interactive chat session
47
+ lovecode chat
48
+
49
+ # Run an autonomous task
50
+ lovecode run "refactor the auth module to use async/await"
51
+
52
+ # Initialize LoveCode in your project
53
+ lovecode init
54
+ ```
55
+
56
+ ## Usage
57
+
58
+ ### `lovecode chat`
59
+
60
+ Start an interactive chat session with LoveCode AI.
61
+
62
+ ```bash
63
+ lovecode chat # defaults to codellama via Ollama
64
+ lovecode chat -m deepseek-coder # use a different model
65
+ lovecode chat -p ollama # specify provider
66
+ ```
67
+
68
+ ### `lovecode run`
69
+
70
+ Run LoveCode AI on a specific task in autonomous mode.
71
+
72
+ ```bash
73
+ lovecode run "add input validation"
74
+ lovecode run "fix the failing tests" --dir ./packages/core
75
+ ```
76
+
77
+ ### `lovecode init`
78
+
79
+ Initialize LoveCode AI configuration in your project.
80
+
81
+ ```bash
82
+ lovecode init
83
+ lovecode init --force # overwrite existing config
84
+ ```
85
+
86
+ ## AI Providers
87
+
88
+ | Provider | Free? | Offline? | Default Model |
89
+ |----------|-------|----------|---------------|
90
+ | **Ollama** | ✅ | ✅ | codellama |
91
+ | OpenAI Compatible | ✅ | ❌ | gpt-4o-mini |
92
+
93
+ LoveCode prioritizes **free** and **local** providers by default.
94
+
95
+ ### Prerequisites for local models
96
+
97
+ 1. Install [Ollama](https://ollama.com)
98
+ 2. Pull a model: `ollama pull codellama`
99
+ 3. Run LoveCode: `lovecode chat`
100
+
101
+ ## Configuration
102
+
103
+ LoveCode looks for config in `.lovecode/config` in your project or `~/.config/lovecode/`.
104
+
105
+ ```json
106
+ {
107
+ "provider": "ollama",
108
+ "model": "codellama",
109
+ "temperature": 0.2,
110
+ "maxTokens": 4096
111
+ }
112
+ ```
113
+
114
+ ## Architecture
115
+
116
+ ```
117
+ lovecode/
118
+ ├── bin/ # CLI entry point
119
+ ├── src/
120
+ │ ├── commands/ # Command implementations
121
+ │ ├── core/ # Agent and tool system
122
+ │ ├── ai/ # AI provider integrations
123
+ │ └── utils/ # Shared utilities
124
+ ├── dist/ # Compiled output
125
+ └── .lovecode/ # Project config
126
+ ```
127
+
128
+ ## Roadmap
129
+
130
+ - [x] CLI framework with chat, run, and init commands
131
+ - [ ] File read/write/edit tools
132
+ - [ ] Shell command execution
133
+ - [ ] Multi-step autonomous agent loop
134
+ - [ ] Code search (grep, glob)
135
+ - [ ] Git integration
136
+ - [ ] Multiple provider support
137
+ - [ ] Plugin system
138
+ - [ ] MCP server support
139
+ - [ ] Windows/WSL/Termux support
140
+
141
+ ## Requirements
142
+
143
+ - **Node.js** 18+
144
+ - **Ollama** (for local AI) or an OpenAI-compatible API
145
+
146
+ ## Development
147
+
148
+ ```bash
149
+ git clone https://github.com/anomalyco/lovecode.git
150
+ cd lovecode
151
+ npm install
152
+ npm run dev # watch mode
153
+ npm run build # production build
154
+ npm run test # run tests
155
+ npm run lint # lint code
156
+ npm run typecheck # type check
157
+ ```
158
+
159
+ ## Why LoveCode?
160
+
161
+ Most AI coding assistants are:
162
+ - **Paid** — requiring expensive subscriptions
163
+ - **Heavy** — running inside resource-hungry IDEs
164
+ - **Closed** — proprietary, with no community input
165
+ - **Tied to the cloud** — requiring internet always-on
166
+
167
+ LoveCode AI is none of those. It runs in your terminal, uses free/local AI, and is fully open source.
168
+
169
+ ## License
170
+
171
+ MIT — see [LICENSE](LICENSE)
172
+
173
+ ---
174
+
175
+ <p align="center">Built with ❤️ for the terminal</p>
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { program } from '../dist/index.js';
4
+
5
+ program.parse(process.argv);
@@ -0,0 +1,37 @@
1
+ import "./chunk-LKUWOZUZ.js";
2
+ import {
3
+ click,
4
+ closeBrowser,
5
+ evaluate,
6
+ formatDOMElement,
7
+ formatScreenshotResult,
8
+ getHTML,
9
+ goto,
10
+ inspect,
11
+ isBrowserRunning,
12
+ isPlaywrightAvailable,
13
+ launchBrowser,
14
+ runActions,
15
+ screenshot,
16
+ select,
17
+ type,
18
+ waitFor
19
+ } from "./chunk-IVAMLKMS.js";
20
+ export {
21
+ click,
22
+ closeBrowser,
23
+ evaluate,
24
+ formatDOMElement,
25
+ formatScreenshotResult,
26
+ getHTML,
27
+ goto,
28
+ inspect,
29
+ isBrowserRunning,
30
+ isPlaywrightAvailable,
31
+ launchBrowser,
32
+ runActions,
33
+ screenshot,
34
+ select,
35
+ type,
36
+ waitFor
37
+ };
@@ -0,0 +1,160 @@
1
+ // src/tui/theme.ts
2
+ import chalk from "chalk";
3
+ var themes = {
4
+ default: {
5
+ name: "Default",
6
+ colors: {
7
+ primary: "#00afff",
8
+ secondary: "#5f87ff",
9
+ accent: "#ff6b6b",
10
+ success: "#00d787",
11
+ warning: "#ffaf00",
12
+ error: "#ff3333",
13
+ info: "#00afff",
14
+ muted: "#585858",
15
+ border: "#444444",
16
+ background: "#1a1a2e",
17
+ surface: "#16213e",
18
+ text: "#e0e0e0",
19
+ textDim: "#888888",
20
+ selection: "#335577"
21
+ },
22
+ border: { type: "round", style: "\u2500" },
23
+ spacing: 1
24
+ },
25
+ dark: {
26
+ name: "Dark",
27
+ colors: {
28
+ primary: "#00d787",
29
+ secondary: "#00afff",
30
+ accent: "#ff6b6b",
31
+ success: "#00d787",
32
+ warning: "#ffaf00",
33
+ error: "#ff3333",
34
+ info: "#00afff",
35
+ muted: "#444444",
36
+ border: "#333333",
37
+ background: "#0d1117",
38
+ surface: "#161b22",
39
+ text: "#c9d1d9",
40
+ textDim: "#8b949e",
41
+ selection: "#1f6feb"
42
+ },
43
+ border: { type: "single", style: "\u2500" },
44
+ spacing: 1
45
+ },
46
+ light: {
47
+ name: "Light",
48
+ colors: {
49
+ primary: "#0066cc",
50
+ secondary: "#6633cc",
51
+ accent: "#cc3300",
52
+ success: "#008800",
53
+ warning: "#cc8800",
54
+ error: "#cc0000",
55
+ info: "#0066cc",
56
+ muted: "#999999",
57
+ border: "#cccccc",
58
+ background: "#ffffff",
59
+ surface: "#f5f5f5",
60
+ text: "#333333",
61
+ textDim: "#888888",
62
+ selection: "#b3d4fc"
63
+ },
64
+ border: { type: "single", style: "\u2500" },
65
+ spacing: 1
66
+ },
67
+ ocean: {
68
+ name: "Ocean",
69
+ colors: {
70
+ primary: "#4db8ff",
71
+ secondary: "#7c4dff",
72
+ accent: "#ff5252",
73
+ success: "#69f0ae",
74
+ warning: "#ffd740",
75
+ error: "#ff1744",
76
+ info: "#40c4ff",
77
+ muted: "#546e7a",
78
+ border: "#37474f",
79
+ background: "#0d1b2a",
80
+ surface: "#1b2838",
81
+ text: "#e0f7fa",
82
+ textDim: "#78909c",
83
+ selection: "#1565c0"
84
+ },
85
+ border: { type: "double", style: "\u2550" },
86
+ spacing: 1
87
+ },
88
+ solarized: {
89
+ name: "Solarized",
90
+ colors: {
91
+ primary: "#268bd2",
92
+ secondary: "#6c71c4",
93
+ accent: "#dc322f",
94
+ success: "#859900",
95
+ warning: "#b58900",
96
+ error: "#dc322f",
97
+ info: "#2aa198",
98
+ muted: "#657b83",
99
+ border: "#073642",
100
+ background: "#002b36",
101
+ surface: "#073642",
102
+ text: "#839496",
103
+ textDim: "#586e75",
104
+ selection: "#073642"
105
+ },
106
+ border: { type: "single", style: "\u2500" },
107
+ spacing: 1
108
+ }
109
+ };
110
+ var currentTheme = themes.default;
111
+ function setTheme(name) {
112
+ currentTheme = themes[name] || themes.default;
113
+ return currentTheme;
114
+ }
115
+ function getTheme() {
116
+ return currentTheme;
117
+ }
118
+ function getThemeNames() {
119
+ return Object.keys(themes);
120
+ }
121
+ function applyChalk(_theme) {
122
+ }
123
+ function c(colorKey, text) {
124
+ const hex = currentTheme.colors[colorKey];
125
+ return chalk.hex(hex)(text);
126
+ }
127
+ function styled(type, text) {
128
+ switch (type) {
129
+ case "header":
130
+ return chalk.hex(currentTheme.colors.primary).bold(text);
131
+ case "label":
132
+ return chalk.hex(currentTheme.colors.secondary)(text);
133
+ case "value":
134
+ return chalk.hex(currentTheme.colors.text)(text);
135
+ case "dim":
136
+ return chalk.hex(currentTheme.colors.textDim)(text);
137
+ case "error":
138
+ return chalk.hex(currentTheme.colors.error)(text);
139
+ case "success":
140
+ return chalk.hex(currentTheme.colors.success)(text);
141
+ case "warning":
142
+ return chalk.hex(currentTheme.colors.warning)(text);
143
+ case "info":
144
+ return chalk.hex(currentTheme.colors.info)(text);
145
+ case "accent":
146
+ return chalk.hex(currentTheme.colors.accent)(text);
147
+ default:
148
+ return text;
149
+ }
150
+ }
151
+
152
+ export {
153
+ themes,
154
+ setTheme,
155
+ getTheme,
156
+ getThemeNames,
157
+ applyChalk,
158
+ c,
159
+ styled
160
+ };