codrninja 0.1.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Milan
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.
@@ -0,0 +1,222 @@
1
+ Metadata-Version: 2.4
2
+ Name: codrninja
3
+ Version: 0.1.0
4
+ Summary: AI-first coding assistant for automation
5
+ Author-email: Milan <your-email@example.com>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/20ZollCoder/codrninja
8
+ Project-URL: Repository, https://github.com/20ZollCoder/codrninja
9
+ Project-URL: Issues, https://github.com/20ZollCoder/codrninja/issues
10
+ Keywords: ai,coding,automation,ollama,cli
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Classifier: Topic :: Software Development :: Code Generators
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Environment :: Console
24
+ Classifier: Operating System :: OS Independent
25
+ Requires-Python: >=3.9
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: requests>=2.25.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=7.0; extra == "dev"
31
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
32
+ Requires-Dist: black>=23.0; extra == "dev"
33
+ Requires-Dist: flake8>=6.0; extra == "dev"
34
+ Dynamic: license-file
35
+
36
+ # 🥷 codrninja
37
+
38
+ AI-first coding assistant for automation. A lightweight, programmatic alternative to interactive coding tools like OpenCode or Claude Code.
39
+
40
+ ## 🔌 Multi-Provider Support
41
+
42
+ Works with **any** AI provider:
43
+
44
+ | Provider | Setup | Models |
45
+ |----------|-------|--------|
46
+ | **Ollama** (default) | Local server | codellama, llama2, mistral |
47
+ | **OpenAI** | API key | gpt-4, gpt-4-turbo, gpt-3.5 |
48
+ | **Anthropic** | API key | claude-3-opus, claude-3-sonnet |
49
+ | **OpenRouter** | API key | Access to all major models |
50
+
51
+ ### Provider Configuration
52
+
53
+ ```bash
54
+ # Ollama (default)
55
+ export OLLAMA_URL=http://localhost:11434
56
+ export OLLAMA_MODEL=codellama
57
+
58
+ # OpenAI
59
+ export OPENAI_API_KEY=sk-...
60
+ export CODRNINJA_PROVIDER=openai
61
+ export CODRNINJA_MODEL=gpt-4
62
+
63
+ # Anthropic
64
+ export ANTHROPIC_API_KEY=sk-ant-...
65
+ export CODRNINJA_PROVIDER=anthropic
66
+ export CODRNINJA_MODEL=claude-3-sonnet-20240229
67
+
68
+ # OpenRouter
69
+ export OPENROUTER_API_KEY=sk-or-...
70
+ export CODRNINJA_PROVIDER=openrouter
71
+ export CODRNINJA_MODEL=openai/gpt-4
72
+ ```
73
+
74
+ ## 🚀 Quick Install
75
+
76
+ ```bash
77
+ curl -fsSL https://raw.githubusercontent.com/20ZollCoder/codrninja/main/install.sh | bash
78
+ ```
79
+
80
+ Or install from source:
81
+
82
+ ```bash
83
+ git clone https://github.com/20ZollCoder/codrninja.git
84
+ cd codrninja
85
+ pip install -e .
86
+ pip install rich # Optional, for TUI
87
+ ```
88
+
89
+ ## ⚡ Quick Start
90
+
91
+ ```bash
92
+ # Set your provider (Ollama is default)
93
+ export OLLAMA_URL=http://localhost:11434
94
+
95
+ # Or use OpenAI
96
+ # export OPENAI_API_KEY=sk-...
97
+ # export CODRNINJA_PROVIDER=openai
98
+
99
+ # Start interactive TUI
100
+ codrninja-tui my-project
101
+
102
+ # Or use agent mode
103
+ codrninja agent my-project "Create a Button component"
104
+ ```
105
+
106
+ ## 🎯 Features
107
+
108
+ ### For Humans (TUI Mode)
109
+ - 🎨 Beautiful terminal UI with ASCII art welcome
110
+ - 💻 Syntax highlighting for code blocks
111
+ - 📊 Tool usage tables
112
+ - ⌨️ Slash commands (`/help`, `/files`, `/read`, `/exec`)
113
+ - ⚡ Progress indicators
114
+
115
+ ### For AI Systems (Automation Mode)
116
+ - 🤖 Agent loop with tool execution
117
+ - 🛠️ Read, write, edit files automatically
118
+ - 🔧 Execute shell commands
119
+ - 📤 JSON output for scripting
120
+ - 🧠 Session-based conversations
121
+
122
+ ## 📖 Usage
123
+
124
+ ### Interactive TUI
125
+
126
+ ```bash
127
+ # Start TUI
128
+ codrninja-tui my-project
129
+
130
+ # Inside TUI:
131
+ You: Create a Button component in React
132
+ 🤖 AI: I'll create that for you...
133
+ ✅ Tool: write_file → src/components/Button.jsx
134
+ ✅ Tool: execute_command → npm test (passed)
135
+
136
+ You: /read src/components/Button.jsx
137
+ 📄 (shows file with syntax highlighting)
138
+
139
+ You: /exec npm run build
140
+ ⚡ (runs build command)
141
+
142
+ You: /help
143
+ 📖 (shows all commands)
144
+ ```
145
+
146
+ ### Agent Mode (Scripting)
147
+
148
+ ```bash
149
+ # Set automation mode
150
+ export AI_CODE_MODE=automation
151
+
152
+ # Run agent with auto-approval
153
+ codrninja agent my-project "Create a login form"
154
+
155
+ # Continue conversation
156
+ codrninja agent my-project "Add validation to the form"
157
+ ```
158
+
159
+ ### Commands
160
+
161
+ | Command | Description |
162
+ |---------|-------------|
163
+ | `codrninja-tui <session>` | Start interactive TUI |
164
+ | `codrninja agent <session> "msg"` | Run agent with tools |
165
+ | `codrninja send <session> "msg"` | Send message |
166
+ | `codrninja create-session <name>` | Create session |
167
+ | `codrninja show-session <name>` | Show history |
168
+
169
+ ### TUI Slash Commands
170
+
171
+ | Command | Description |
172
+ |---------|-------------|
173
+ | `/help` | Show help |
174
+ | `/files` | List files |
175
+ | `/read <file>` | Read file |
176
+ | `/write <file>` | Write file (interactive) |
177
+ | `/exec <cmd>` | Execute command |
178
+ | `/model` | Show AI model config |
179
+ | `/session` | Show session info |
180
+ | `/clear` | Clear screen |
181
+ | `/exit` | Quit |
182
+
183
+ ## 🔧 Configuration
184
+
185
+ ```bash
186
+ # Environment variables
187
+ export OLLAMA_URL=http://localhost:11434 # Ollama endpoint
188
+ export OLLAMA_MODEL=codellama # Default model
189
+ export AI_CODE_MODE=automation # JSON output mode
190
+ ```
191
+
192
+ ## 🆚 Comparison with OpenCode
193
+
194
+ | Feature | OpenCode | codrninja |
195
+ |---------|----------|-----------|
196
+ | **Size** | ~146MB Go binary | ~8KB Python |
197
+ | **TTY Required** | ❌ Yes | ✅ No |
198
+ | **JSON Output** | ❌ No | ✅ Yes |
199
+ | **Agent Loop** | ✅ Yes | ✅ Yes |
200
+ | **Tool Execution** | ✅ Yes | ✅ Yes |
201
+ | **Session API** | Hidden | Simple CLI |
202
+ | **Installation** | Complex | `pip install` |
203
+ | **Automation** | Limited | First-class |
204
+
205
+ ## 📦 Installation Details
206
+
207
+ The install script will:
208
+ 1. ✅ Check Python and pip
209
+ 2. ✅ Install codrninja from PyPI or git
210
+ 3. ✅ Install Rich (optional, for TUI)
211
+ 4. ✅ Add `~/.local/bin` to PATH
212
+ 5. ✅ Create config directory
213
+ 6. ✅ Install `codrninja-setup` helper
214
+
215
+ ## 🔗 Links
216
+
217
+ - **GitHub:** https://github.com/20ZollCoder/codrninja
218
+ - **Issues:** https://github.com/20ZollCoder/codrninja/issues
219
+
220
+ ## 📄 License
221
+
222
+ MIT
@@ -0,0 +1,187 @@
1
+ # 🥷 codrninja
2
+
3
+ AI-first coding assistant for automation. A lightweight, programmatic alternative to interactive coding tools like OpenCode or Claude Code.
4
+
5
+ ## 🔌 Multi-Provider Support
6
+
7
+ Works with **any** AI provider:
8
+
9
+ | Provider | Setup | Models |
10
+ |----------|-------|--------|
11
+ | **Ollama** (default) | Local server | codellama, llama2, mistral |
12
+ | **OpenAI** | API key | gpt-4, gpt-4-turbo, gpt-3.5 |
13
+ | **Anthropic** | API key | claude-3-opus, claude-3-sonnet |
14
+ | **OpenRouter** | API key | Access to all major models |
15
+
16
+ ### Provider Configuration
17
+
18
+ ```bash
19
+ # Ollama (default)
20
+ export OLLAMA_URL=http://localhost:11434
21
+ export OLLAMA_MODEL=codellama
22
+
23
+ # OpenAI
24
+ export OPENAI_API_KEY=sk-...
25
+ export CODRNINJA_PROVIDER=openai
26
+ export CODRNINJA_MODEL=gpt-4
27
+
28
+ # Anthropic
29
+ export ANTHROPIC_API_KEY=sk-ant-...
30
+ export CODRNINJA_PROVIDER=anthropic
31
+ export CODRNINJA_MODEL=claude-3-sonnet-20240229
32
+
33
+ # OpenRouter
34
+ export OPENROUTER_API_KEY=sk-or-...
35
+ export CODRNINJA_PROVIDER=openrouter
36
+ export CODRNINJA_MODEL=openai/gpt-4
37
+ ```
38
+
39
+ ## 🚀 Quick Install
40
+
41
+ ```bash
42
+ curl -fsSL https://raw.githubusercontent.com/20ZollCoder/codrninja/main/install.sh | bash
43
+ ```
44
+
45
+ Or install from source:
46
+
47
+ ```bash
48
+ git clone https://github.com/20ZollCoder/codrninja.git
49
+ cd codrninja
50
+ pip install -e .
51
+ pip install rich # Optional, for TUI
52
+ ```
53
+
54
+ ## ⚡ Quick Start
55
+
56
+ ```bash
57
+ # Set your provider (Ollama is default)
58
+ export OLLAMA_URL=http://localhost:11434
59
+
60
+ # Or use OpenAI
61
+ # export OPENAI_API_KEY=sk-...
62
+ # export CODRNINJA_PROVIDER=openai
63
+
64
+ # Start interactive TUI
65
+ codrninja-tui my-project
66
+
67
+ # Or use agent mode
68
+ codrninja agent my-project "Create a Button component"
69
+ ```
70
+
71
+ ## 🎯 Features
72
+
73
+ ### For Humans (TUI Mode)
74
+ - 🎨 Beautiful terminal UI with ASCII art welcome
75
+ - 💻 Syntax highlighting for code blocks
76
+ - 📊 Tool usage tables
77
+ - ⌨️ Slash commands (`/help`, `/files`, `/read`, `/exec`)
78
+ - ⚡ Progress indicators
79
+
80
+ ### For AI Systems (Automation Mode)
81
+ - 🤖 Agent loop with tool execution
82
+ - 🛠️ Read, write, edit files automatically
83
+ - 🔧 Execute shell commands
84
+ - 📤 JSON output for scripting
85
+ - 🧠 Session-based conversations
86
+
87
+ ## 📖 Usage
88
+
89
+ ### Interactive TUI
90
+
91
+ ```bash
92
+ # Start TUI
93
+ codrninja-tui my-project
94
+
95
+ # Inside TUI:
96
+ You: Create a Button component in React
97
+ 🤖 AI: I'll create that for you...
98
+ ✅ Tool: write_file → src/components/Button.jsx
99
+ ✅ Tool: execute_command → npm test (passed)
100
+
101
+ You: /read src/components/Button.jsx
102
+ 📄 (shows file with syntax highlighting)
103
+
104
+ You: /exec npm run build
105
+ ⚡ (runs build command)
106
+
107
+ You: /help
108
+ 📖 (shows all commands)
109
+ ```
110
+
111
+ ### Agent Mode (Scripting)
112
+
113
+ ```bash
114
+ # Set automation mode
115
+ export AI_CODE_MODE=automation
116
+
117
+ # Run agent with auto-approval
118
+ codrninja agent my-project "Create a login form"
119
+
120
+ # Continue conversation
121
+ codrninja agent my-project "Add validation to the form"
122
+ ```
123
+
124
+ ### Commands
125
+
126
+ | Command | Description |
127
+ |---------|-------------|
128
+ | `codrninja-tui <session>` | Start interactive TUI |
129
+ | `codrninja agent <session> "msg"` | Run agent with tools |
130
+ | `codrninja send <session> "msg"` | Send message |
131
+ | `codrninja create-session <name>` | Create session |
132
+ | `codrninja show-session <name>` | Show history |
133
+
134
+ ### TUI Slash Commands
135
+
136
+ | Command | Description |
137
+ |---------|-------------|
138
+ | `/help` | Show help |
139
+ | `/files` | List files |
140
+ | `/read <file>` | Read file |
141
+ | `/write <file>` | Write file (interactive) |
142
+ | `/exec <cmd>` | Execute command |
143
+ | `/model` | Show AI model config |
144
+ | `/session` | Show session info |
145
+ | `/clear` | Clear screen |
146
+ | `/exit` | Quit |
147
+
148
+ ## 🔧 Configuration
149
+
150
+ ```bash
151
+ # Environment variables
152
+ export OLLAMA_URL=http://localhost:11434 # Ollama endpoint
153
+ export OLLAMA_MODEL=codellama # Default model
154
+ export AI_CODE_MODE=automation # JSON output mode
155
+ ```
156
+
157
+ ## 🆚 Comparison with OpenCode
158
+
159
+ | Feature | OpenCode | codrninja |
160
+ |---------|----------|-----------|
161
+ | **Size** | ~146MB Go binary | ~8KB Python |
162
+ | **TTY Required** | ❌ Yes | ✅ No |
163
+ | **JSON Output** | ❌ No | ✅ Yes |
164
+ | **Agent Loop** | ✅ Yes | ✅ Yes |
165
+ | **Tool Execution** | ✅ Yes | ✅ Yes |
166
+ | **Session API** | Hidden | Simple CLI |
167
+ | **Installation** | Complex | `pip install` |
168
+ | **Automation** | Limited | First-class |
169
+
170
+ ## 📦 Installation Details
171
+
172
+ The install script will:
173
+ 1. ✅ Check Python and pip
174
+ 2. ✅ Install codrninja from PyPI or git
175
+ 3. ✅ Install Rich (optional, for TUI)
176
+ 4. ✅ Add `~/.local/bin` to PATH
177
+ 5. ✅ Create config directory
178
+ 6. ✅ Install `codrninja-setup` helper
179
+
180
+ ## 🔗 Links
181
+
182
+ - **GitHub:** https://github.com/20ZollCoder/codrninja
183
+ - **Issues:** https://github.com/20ZollCoder/codrninja/issues
184
+
185
+ ## 📄 License
186
+
187
+ MIT
@@ -0,0 +1,62 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "codrninja"
7
+ version = "0.1.0"
8
+ description = "AI-first coding assistant for automation"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ authors = [
12
+ {name = "Milan", email = "your-email@example.com"}
13
+ ]
14
+ keywords = ["ai", "coding", "automation", "ollama", "cli"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.9",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Programming Language :: Python :: 3.14",
26
+ "Topic :: Software Development :: Code Generators",
27
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
28
+ "Environment :: Console",
29
+ "Operating System :: OS Independent",
30
+ ]
31
+ requires-python = ">=3.9"
32
+ dependencies = [
33
+ "requests>=2.25.0",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=7.0",
39
+ "pytest-cov>=4.0",
40
+ "black>=23.0",
41
+ "flake8>=6.0",
42
+ ]
43
+
44
+ [project.scripts]
45
+ codrninja = "codrninja.cli:main"
46
+ codrninja-tui = "codrninja.tui:main"
47
+
48
+ [project.urls]
49
+ Homepage = "https://github.com/20ZollCoder/codrninja"
50
+ Repository = "https://github.com/20ZollCoder/codrninja"
51
+ Issues = "https://github.com/20ZollCoder/codrninja/issues"
52
+
53
+ [tool.setuptools.packages.find]
54
+ where = ["src"]
55
+
56
+ [tool.black]
57
+ line-length = 100
58
+ target-version = ['py39']
59
+
60
+ [tool.pytest.ini_options]
61
+ testpaths = ["tests"]
62
+ python_files = ["test_*.py"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,14 @@
1
+ """
2
+ codrninja: AI-first coding assistant for automation
3
+ """
4
+
5
+ __version__ = "0.1.0"
6
+ __author__ = "Milan"
7
+ __license__ = "MIT"
8
+
9
+ from .core import AICode, Session
10
+ from .config import Config
11
+ from .agent import Agent
12
+ from .providers import ProviderManager, OllamaProvider, OpenAIProvider, AnthropicProvider, OpenRouterProvider
13
+
14
+ __all__ = ["AICode", "Session", "Config", "Agent", "ProviderManager", "OllamaProvider", "OpenAIProvider", "AnthropicProvider", "OpenRouterProvider"]