azerclaw 1.0.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/LICENSE +21 -0
- package/README.md +222 -0
- package/bin/azerclaw.ts +290 -0
- package/dist/bin/azerclaw.d.ts +19 -0
- package/dist/bin/azerclaw.d.ts.map +1 -0
- package/dist/bin/azerclaw.js +247 -0
- package/dist/bin/azerclaw.js.map +1 -0
- package/dist/skills/code-review/SKILL.md +46 -0
- package/dist/skills/daily-briefing/SKILL.md +35 -0
- package/dist/skills/git-assistant/SKILL.md +31 -0
- package/dist/src/agents/builtin.d.ts +52 -0
- package/dist/src/agents/builtin.d.ts.map +1 -0
- package/dist/src/agents/builtin.js +497 -0
- package/dist/src/agents/builtin.js.map +1 -0
- package/dist/src/agents/loader.d.ts +23 -0
- package/dist/src/agents/loader.d.ts.map +1 -0
- package/dist/src/agents/loader.js +154 -0
- package/dist/src/agents/loader.js.map +1 -0
- package/dist/src/channels/adapter.d.ts +57 -0
- package/dist/src/channels/adapter.d.ts.map +1 -0
- package/dist/src/channels/adapter.js +45 -0
- package/dist/src/channels/adapter.js.map +1 -0
- package/dist/src/channels/discord.d.ts +23 -0
- package/dist/src/channels/discord.d.ts.map +1 -0
- package/dist/src/channels/discord.js +129 -0
- package/dist/src/channels/discord.js.map +1 -0
- package/dist/src/channels/slack.d.ts +19 -0
- package/dist/src/channels/slack.d.ts.map +1 -0
- package/dist/src/channels/slack.js +97 -0
- package/dist/src/channels/slack.js.map +1 -0
- package/dist/src/channels/telegram.d.ts +20 -0
- package/dist/src/channels/telegram.d.ts.map +1 -0
- package/dist/src/channels/telegram.js +87 -0
- package/dist/src/channels/telegram.js.map +1 -0
- package/dist/src/channels/webhook.d.ts +19 -0
- package/dist/src/channels/webhook.d.ts.map +1 -0
- package/dist/src/channels/webhook.js +124 -0
- package/dist/src/channels/webhook.js.map +1 -0
- package/dist/src/cli/animations/fish.d.ts +33 -0
- package/dist/src/cli/animations/fish.d.ts.map +1 -0
- package/dist/src/cli/animations/fish.js +297 -0
- package/dist/src/cli/animations/fish.js.map +1 -0
- package/dist/src/cli/commands/agents.d.ts +8 -0
- package/dist/src/cli/commands/agents.d.ts.map +1 -0
- package/dist/src/cli/commands/agents.js +104 -0
- package/dist/src/cli/commands/agents.js.map +1 -0
- package/dist/src/cli/commands/chat.d.ts +9 -0
- package/dist/src/cli/commands/chat.d.ts.map +1 -0
- package/dist/src/cli/commands/chat.js +236 -0
- package/dist/src/cli/commands/chat.js.map +1 -0
- package/dist/src/cli/commands/config.d.ts +9 -0
- package/dist/src/cli/commands/config.d.ts.map +1 -0
- package/dist/src/cli/commands/config.js +97 -0
- package/dist/src/cli/commands/config.js.map +1 -0
- package/dist/src/cli/commands/doctor.d.ts +8 -0
- package/dist/src/cli/commands/doctor.d.ts.map +1 -0
- package/dist/src/cli/commands/doctor.js +159 -0
- package/dist/src/cli/commands/doctor.js.map +1 -0
- package/dist/src/cli/commands/models.d.ts +7 -0
- package/dist/src/cli/commands/models.d.ts.map +1 -0
- package/dist/src/cli/commands/models.js +64 -0
- package/dist/src/cli/commands/models.js.map +1 -0
- package/dist/src/cli/commands/onboard.d.ts +6 -0
- package/dist/src/cli/commands/onboard.d.ts.map +1 -0
- package/dist/src/cli/commands/onboard.js +150 -0
- package/dist/src/cli/commands/onboard.js.map +1 -0
- package/dist/src/cli/commands/run.d.ts +9 -0
- package/dist/src/cli/commands/run.d.ts.map +1 -0
- package/dist/src/cli/commands/run.js +84 -0
- package/dist/src/cli/commands/run.js.map +1 -0
- package/dist/src/cli/commands/tui.d.ts +6 -0
- package/dist/src/cli/commands/tui.d.ts.map +1 -0
- package/dist/src/cli/commands/tui.js +252 -0
- package/dist/src/cli/commands/tui.js.map +1 -0
- package/dist/src/config/manager.d.ts +80 -0
- package/dist/src/config/manager.d.ts.map +1 -0
- package/dist/src/config/manager.js +232 -0
- package/dist/src/config/manager.js.map +1 -0
- package/dist/src/config/schema.d.ts +910 -0
- package/dist/src/config/schema.d.ts.map +1 -0
- package/dist/src/config/schema.js +138 -0
- package/dist/src/config/schema.js.map +1 -0
- package/dist/src/core/gateway.d.ts +35 -0
- package/dist/src/core/gateway.d.ts.map +1 -0
- package/dist/src/core/gateway.js +205 -0
- package/dist/src/core/gateway.js.map +1 -0
- package/dist/src/core/runtime.d.ts +69 -0
- package/dist/src/core/runtime.d.ts.map +1 -0
- package/dist/src/core/runtime.js +188 -0
- package/dist/src/core/runtime.js.map +1 -0
- package/dist/src/core/security.d.ts +55 -0
- package/dist/src/core/security.d.ts.map +1 -0
- package/dist/src/core/security.js +241 -0
- package/dist/src/core/security.js.map +1 -0
- package/dist/src/index.d.ts +24 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +46 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/memory/store.d.ts +65 -0
- package/dist/src/memory/store.d.ts.map +1 -0
- package/dist/src/memory/store.js +250 -0
- package/dist/src/memory/store.js.map +1 -0
- package/dist/src/providers/anthropic.d.ts +25 -0
- package/dist/src/providers/anthropic.d.ts.map +1 -0
- package/dist/src/providers/anthropic.js +163 -0
- package/dist/src/providers/anthropic.js.map +1 -0
- package/dist/src/providers/base.d.ts +90 -0
- package/dist/src/providers/base.d.ts.map +1 -0
- package/dist/src/providers/base.js +12 -0
- package/dist/src/providers/base.js.map +1 -0
- package/dist/src/providers/google.d.ts +23 -0
- package/dist/src/providers/google.d.ts.map +1 -0
- package/dist/src/providers/google.js +118 -0
- package/dist/src/providers/google.js.map +1 -0
- package/dist/src/providers/ollama.d.ts +24 -0
- package/dist/src/providers/ollama.d.ts.map +1 -0
- package/dist/src/providers/ollama.js +81 -0
- package/dist/src/providers/ollama.js.map +1 -0
- package/dist/src/providers/openai.d.ts +30 -0
- package/dist/src/providers/openai.d.ts.map +1 -0
- package/dist/src/providers/openai.js +187 -0
- package/dist/src/providers/openai.js.map +1 -0
- package/dist/src/providers/router.d.ts +20 -0
- package/dist/src/providers/router.d.ts.map +1 -0
- package/dist/src/providers/router.js +156 -0
- package/dist/src/providers/router.js.map +1 -0
- package/dist/src/scheduler/heartbeat.d.ts +62 -0
- package/dist/src/scheduler/heartbeat.d.ts.map +1 -0
- package/dist/src/scheduler/heartbeat.js +267 -0
- package/dist/src/scheduler/heartbeat.js.map +1 -0
- package/dist/src/skills/loader.d.ts +25 -0
- package/dist/src/skills/loader.d.ts.map +1 -0
- package/dist/src/skills/loader.js +165 -0
- package/dist/src/skills/loader.js.map +1 -0
- package/dist/src/tools/advanced.d.ts +15 -0
- package/dist/src/tools/advanced.d.ts.map +1 -0
- package/dist/src/tools/advanced.js +102 -0
- package/dist/src/tools/advanced.js.map +1 -0
- package/dist/src/tools/filesystem.d.ts +10 -0
- package/dist/src/tools/filesystem.d.ts.map +1 -0
- package/dist/src/tools/filesystem.js +160 -0
- package/dist/src/tools/filesystem.js.map +1 -0
- package/dist/src/tools/registry.d.ts +26 -0
- package/dist/src/tools/registry.d.ts.map +1 -0
- package/dist/src/tools/registry.js +49 -0
- package/dist/src/tools/registry.js.map +1 -0
- package/dist/src/tools/shell.d.ts +7 -0
- package/dist/src/tools/shell.d.ts.map +1 -0
- package/dist/src/tools/shell.js +46 -0
- package/dist/src/tools/shell.js.map +1 -0
- package/dist/src/workflow/engine.d.ts +65 -0
- package/dist/src/workflow/engine.d.ts.map +1 -0
- package/dist/src/workflow/engine.js +297 -0
- package/dist/src/workflow/engine.js.map +1 -0
- package/package.json +113 -0
- package/skills/code-review/SKILL.md +46 -0
- package/skills/daily-briefing/SKILL.md +35 -0
- package/skills/git-assistant/SKILL.md +31 -0
- package/templates/HEARTBEAT.md +27 -0
- package/templates/IDENTITY.md +23 -0
- package/templates/deploy-pipeline.fishbone +39 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 AZERCLAW
|
|
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,222 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
█████╗ ███████╗███████╗██████╗ ██████╗██╗ █████╗ ██╗ ██╗
|
|
5
|
+
██╔══██╗╚══███╔╝██╔════╝██╔══██╗██╔════╝██║ ██╔══██╗██║ ██║
|
|
6
|
+
███████║ ███╔╝ █████╗ ██████╔╝██║ ██║ ███████║██║ █╗ ██║
|
|
7
|
+
██╔══██║ ███╔╝ ██╔══╝ ██╔══██╗██║ ██║ ██╔══██║██║███╗██║
|
|
8
|
+
██║ ██║███████╗███████╗██║ ██║╚██████╗███████╗██║ ██║╚███╔███╔╝
|
|
9
|
+
╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═════╝╚══════╝╚═╝ ╚═╝ ╚══╝╚══╝
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**🐟 Your AI · Your Keys · Your Way**
|
|
13
|
+
|
|
14
|
+
[](LICENSE)
|
|
15
|
+
[](https://nodejs.org)
|
|
16
|
+
[](#-byok-providers)
|
|
17
|
+
|
|
18
|
+
*An open-source, BYOK autonomous AI agent for your terminal.*
|
|
19
|
+
*Inspired by OpenClaw 🦞, powered by a fish 🐟.*
|
|
20
|
+
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## ✨ Features
|
|
26
|
+
|
|
27
|
+
| Feature | Description |
|
|
28
|
+
|---|---|
|
|
29
|
+
| 🔑 **BYOK** | Bring Your Own Key — zero platform fees, use any provider |
|
|
30
|
+
| 🤖 **Autonomous Agent** | Multi-step task execution with tool use |
|
|
31
|
+
| 🐠 **Sub-Agents** | Spawn parallel agents for complex workloads |
|
|
32
|
+
| 🐟 **Fish CLI** | Animated ASCII fish instead of a lobster |
|
|
33
|
+
| 🖥️ **Premium TUI** | Luxe terminal UI with status bar & panels |
|
|
34
|
+
| 🔧 **8 Built-in Tools** | Shell, filesystem, search, code analysis, web |
|
|
35
|
+
| 📦 **Skills System** | SKILL.md compatible, extensible capabilities |
|
|
36
|
+
| 🔒 **Security First** | AES-256-GCM key encryption, zero telemetry |
|
|
37
|
+
| 🌐 **8 Providers** | OpenAI, Anthropic, Google, Ollama, Groq, DeepSeek, OpenRouter, Custom |
|
|
38
|
+
| 💻 **Cross-Platform** | macOS (Intel + Silicon), Windows, Linux |
|
|
39
|
+
|
|
40
|
+
## 🚀 Quick Start
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Clone
|
|
44
|
+
git clone https://github.com/azerclaw/azerclaw.git
|
|
45
|
+
cd azerclaw
|
|
46
|
+
|
|
47
|
+
# Install
|
|
48
|
+
npm install
|
|
49
|
+
|
|
50
|
+
# First run — launches setup wizard with animated splash
|
|
51
|
+
npx tsx bin/azerclaw.ts
|
|
52
|
+
|
|
53
|
+
# Or use npm scripts
|
|
54
|
+
npm start # Launch TUI
|
|
55
|
+
npm run chat # Interactive chat
|
|
56
|
+
npm run doctor # Health check
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 📸 Preview
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
><(((º> AZERCLAW v1.0.0
|
|
63
|
+
Your AI · Your Keys · Your Way
|
|
64
|
+
|
|
65
|
+
╭──────────────────────────────────────────────────────────╮
|
|
66
|
+
│ 🩺 AZERCLAW Doctor │
|
|
67
|
+
│──────────────────────────────────────────────────────────│
|
|
68
|
+
│ Running health checks... │
|
|
69
|
+
╰──────────────────────────────────────────────────────────╯
|
|
70
|
+
|
|
71
|
+
═══════════════════════════════════════><(((º> 100% System
|
|
72
|
+
|
|
73
|
+
✓ Config File Found at ~/.azerclaw/config.json
|
|
74
|
+
✓ Directories All present
|
|
75
|
+
✓ Permissions Config is 0600 (secure)
|
|
76
|
+
✓ Providers 1 configured: openrouter
|
|
77
|
+
✓ Connectivity 1 providers initialized
|
|
78
|
+
✓ Node.js v22.0.0
|
|
79
|
+
✓ System darwin arm64 | 10 cores | 16GB RAM
|
|
80
|
+
|
|
81
|
+
><(((°> ✓ All 7 checks passed! 🐟
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## 🔑 BYOK Providers
|
|
85
|
+
|
|
86
|
+
| Provider | Models | How to Get Key |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| **OpenAI** | GPT-4o, GPT-4.1, o3, o4-mini | [platform.openai.com](https://platform.openai.com) |
|
|
89
|
+
| **Anthropic** | Claude Opus 4, Sonnet 4, Haiku | [console.anthropic.com](https://console.anthropic.com) |
|
|
90
|
+
| **Google** | Gemini 2.5 Pro/Flash | [aistudio.google.com](https://aistudio.google.com) |
|
|
91
|
+
| **Groq** | Llama 3.3, Mixtral | [console.groq.com](https://console.groq.com) |
|
|
92
|
+
| **DeepSeek** | DeepSeek V3, R1 | [platform.deepseek.com](https://platform.deepseek.com) |
|
|
93
|
+
| **OpenRouter** | 100+ models | [openrouter.ai](https://openrouter.ai) |
|
|
94
|
+
| **Ollama** | Any local model | [ollama.ai](https://ollama.ai) |
|
|
95
|
+
| **Custom** | Any OpenAI-compatible | Your own endpoint |
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Configure via CLI
|
|
99
|
+
azerclaw config set ai.providers.openrouter.apiKey "sk-or-..."
|
|
100
|
+
azerclaw config set ai.providers.openrouter.enabled true
|
|
101
|
+
azerclaw config set ai.defaultProvider openrouter
|
|
102
|
+
|
|
103
|
+
# Or use the interactive wizard
|
|
104
|
+
azerclaw onboard
|
|
105
|
+
|
|
106
|
+
# Or use environment variables
|
|
107
|
+
export OPENAI_API_KEY="sk-..."
|
|
108
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 🎮 Commands
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
azerclaw # Launch TUI (or onboard if first run)
|
|
115
|
+
azerclaw chat # Interactive chat
|
|
116
|
+
azerclaw run "task" # Execute a single task
|
|
117
|
+
azerclaw tui # Premium terminal UI
|
|
118
|
+
azerclaw onboard # Setup wizard
|
|
119
|
+
azerclaw config list # Show configuration
|
|
120
|
+
azerclaw config get <key> # Get a config value
|
|
121
|
+
azerclaw config set <k> <v> # Set a config value
|
|
122
|
+
azerclaw models list # List available models
|
|
123
|
+
azerclaw models status # Current model info
|
|
124
|
+
azerclaw doctor # Health check
|
|
125
|
+
azerclaw doctor --fix # Auto-repair issues
|
|
126
|
+
azerclaw security audit # Security check
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## 🐟 Fish Animations
|
|
130
|
+
|
|
131
|
+
AZERCLAW replaces OpenClaw's lobster 🦞 with a fish 🐟:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
Thinking: ><(((º> ○ ○ Working...
|
|
135
|
+
Success: ><(((°> ✓ Done!
|
|
136
|
+
Error: ><(((x> ✗ Failed!
|
|
137
|
+
Progress: ═══════><(((º>░░░░░ 67%
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## 🤖 Agent & Sub-Agents
|
|
141
|
+
|
|
142
|
+
AZERCLAW uses an autonomous agent loop with sub-agent orchestration:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
┌──────────────────────────┐
|
|
146
|
+
│ Main Agent │
|
|
147
|
+
│ (receives user task) │
|
|
148
|
+
├──────────────────────────┤
|
|
149
|
+
│ ↓ Thinks & Plans │
|
|
150
|
+
│ ↓ Uses Tools │
|
|
151
|
+
│ ↓ Spawns Sub-Agents │
|
|
152
|
+
│ │
|
|
153
|
+
│ ┌────────┐ ┌────────┐ │
|
|
154
|
+
│ │Sub 🐠 A│ │Sub 🐠 B│ │
|
|
155
|
+
│ │Research│ │ Code │ │
|
|
156
|
+
│ └────────┘ └────────┘ │
|
|
157
|
+
│ │
|
|
158
|
+
│ ↓ Aggregates Results │
|
|
159
|
+
│ ↓ Returns Response │
|
|
160
|
+
└──────────────────────────┘
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## 🔒 Security
|
|
164
|
+
|
|
165
|
+
- **Zero telemetry** — no data ever leaves your machine
|
|
166
|
+
- **No analytics** — we don't track anything
|
|
167
|
+
- **No phone-home** — no background network requests
|
|
168
|
+
- **AES-256-GCM** — API keys encrypted at rest
|
|
169
|
+
- **0600 permissions** — config files owner-only
|
|
170
|
+
- **Audit logging** — local security event log
|
|
171
|
+
- **Env sanitization** — sensitive vars stripped from child processes
|
|
172
|
+
- **SSRF protection** — blocks requests to private/internal IPs
|
|
173
|
+
|
|
174
|
+
## 📦 Skills System
|
|
175
|
+
|
|
176
|
+
Skills are SKILL.md files compatible with the OpenClaw ecosystem:
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
---
|
|
180
|
+
name: Code Review
|
|
181
|
+
description: Review code for bugs and security issues
|
|
182
|
+
version: 1.0.0
|
|
183
|
+
tags: code, review
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
# Code Review Skill
|
|
187
|
+
When asked to review code...
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
Skills load from (priority order):
|
|
191
|
+
1. `<workspace>/skills/` — Project-specific
|
|
192
|
+
2. `~/.agents/skills/` — Personal
|
|
193
|
+
3. `~/.azerclaw/skills/` — Managed
|
|
194
|
+
4. `<install>/skills/` — Bundled defaults
|
|
195
|
+
|
|
196
|
+
## 🛠️ Development
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# Install dependencies
|
|
200
|
+
npm install
|
|
201
|
+
|
|
202
|
+
# Run in dev mode
|
|
203
|
+
npm run dev
|
|
204
|
+
|
|
205
|
+
# Build
|
|
206
|
+
npm run build
|
|
207
|
+
|
|
208
|
+
# Run doctor
|
|
209
|
+
npm run doctor
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## 📄 License
|
|
213
|
+
|
|
214
|
+
MIT — Free and open source forever.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
<div align="center">
|
|
219
|
+
|
|
220
|
+
**🐟 AZERCLAW — Your AI, Your Keys, Your Way**
|
|
221
|
+
|
|
222
|
+
</div>
|
package/bin/azerclaw.ts
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 🐟 AZERCLAW — CLI Entry Point
|
|
5
|
+
*
|
|
6
|
+
* An open-source, BYOK AI agent for your terminal.
|
|
7
|
+
* Inspired by OpenClaw, themed with a fish 🐟 instead of a lobster.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* azerclaw — Launch TUI (or onboard if first run)
|
|
11
|
+
* azerclaw chat — Interactive chat
|
|
12
|
+
* azerclaw run "task" — Execute a task
|
|
13
|
+
* azerclaw tui — Premium terminal UI
|
|
14
|
+
* azerclaw onboard — Setup wizard
|
|
15
|
+
* azerclaw config — Manage configuration
|
|
16
|
+
* azerclaw models — Manage AI models
|
|
17
|
+
* azerclaw doctor — Health check
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const { Command } = require('commander');
|
|
21
|
+
const { playSplashScreen, printQuickSplash, fishError, fishInfo } = require('../src/cli/animations/fish');
|
|
22
|
+
const { getConfigManager } = require('../src/config/manager');
|
|
23
|
+
|
|
24
|
+
const VERSION = '1.0.0';
|
|
25
|
+
const program = new Command();
|
|
26
|
+
|
|
27
|
+
// ─── Program Setup ──────────────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
program
|
|
30
|
+
.name('azerclaw')
|
|
31
|
+
.description('🐟 AZERCLAW — Your AI, Your Keys, Your Way')
|
|
32
|
+
.version(VERSION, '-v, --version', 'Display version')
|
|
33
|
+
.option('--no-splash', 'Skip the splash screen')
|
|
34
|
+
.option('--no-color', 'Disable colors');
|
|
35
|
+
|
|
36
|
+
// ─── Default Action (no command) ────────────────────────────────
|
|
37
|
+
|
|
38
|
+
program
|
|
39
|
+
.action(async (opts: any) => {
|
|
40
|
+
const config = getConfigManager();
|
|
41
|
+
config.resolveEnvOverrides();
|
|
42
|
+
|
|
43
|
+
if (config.isFirstRun()) {
|
|
44
|
+
// First run: show full splash + onboard
|
|
45
|
+
await playSplashScreen(VERSION);
|
|
46
|
+
const { runOnboard } = require('../src/cli/commands/onboard');
|
|
47
|
+
await runOnboard();
|
|
48
|
+
} else {
|
|
49
|
+
// Launch TUI by default
|
|
50
|
+
const { runTUI } = require('../src/cli/commands/tui');
|
|
51
|
+
await runTUI();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// ─── Chat Command ───────────────────────────────────────────────
|
|
56
|
+
|
|
57
|
+
program
|
|
58
|
+
.command('chat')
|
|
59
|
+
.description('Start an interactive chat session')
|
|
60
|
+
.option('-m, --model <model>', 'Override the default model')
|
|
61
|
+
.option('-p, --provider <provider>', 'Override the default provider')
|
|
62
|
+
.action(async (opts: any) => {
|
|
63
|
+
const config = getConfigManager();
|
|
64
|
+
config.resolveEnvOverrides();
|
|
65
|
+
|
|
66
|
+
if (!opts.parent?.splash === false) {
|
|
67
|
+
printQuickSplash(VERSION);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (config.isFirstRun()) {
|
|
71
|
+
fishInfo('First time? Run `azerclaw onboard` to configure your AI providers.');
|
|
72
|
+
const { runOnboard } = require('../src/cli/commands/onboard');
|
|
73
|
+
await runOnboard();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const { runChat } = require('../src/cli/commands/chat');
|
|
78
|
+
await runChat(opts);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// ─── Run Command ────────────────────────────────────────────────
|
|
82
|
+
|
|
83
|
+
program
|
|
84
|
+
.command('run <task>')
|
|
85
|
+
.description('Execute a single task')
|
|
86
|
+
.option('-m, --model <model>', 'Override the default model')
|
|
87
|
+
.option('-V, --verbose', 'Show tool calls in detail')
|
|
88
|
+
.action(async (task: string, opts: any) => {
|
|
89
|
+
const config = getConfigManager();
|
|
90
|
+
config.resolveEnvOverrides();
|
|
91
|
+
printQuickSplash(VERSION);
|
|
92
|
+
|
|
93
|
+
const { runTask } = require('../src/cli/commands/run');
|
|
94
|
+
await runTask(task, opts);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// ─── TUI Command ────────────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
program
|
|
100
|
+
.command('tui')
|
|
101
|
+
.description('Launch the premium terminal UI')
|
|
102
|
+
.action(async () => {
|
|
103
|
+
const config = getConfigManager();
|
|
104
|
+
config.resolveEnvOverrides();
|
|
105
|
+
|
|
106
|
+
const { runTUI } = require('../src/cli/commands/tui');
|
|
107
|
+
await runTUI();
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// ─── Onboard Command ───────────────────────────────────────────
|
|
111
|
+
|
|
112
|
+
program
|
|
113
|
+
.command('onboard')
|
|
114
|
+
.description('Run the interactive setup wizard')
|
|
115
|
+
.action(async () => {
|
|
116
|
+
await playSplashScreen(VERSION);
|
|
117
|
+
const { runOnboard } = require('../src/cli/commands/onboard');
|
|
118
|
+
await runOnboard();
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// ─── Config Command ─────────────────────────────────────────────
|
|
122
|
+
|
|
123
|
+
const configCmd = program
|
|
124
|
+
.command('config')
|
|
125
|
+
.description('Manage configuration');
|
|
126
|
+
|
|
127
|
+
configCmd
|
|
128
|
+
.command('get <key>')
|
|
129
|
+
.description('Get a configuration value')
|
|
130
|
+
.action((key: string) => {
|
|
131
|
+
const { configGet } = require('../src/cli/commands/config');
|
|
132
|
+
configGet(key);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
configCmd
|
|
136
|
+
.command('set <key> <value>')
|
|
137
|
+
.description('Set a configuration value')
|
|
138
|
+
.action((key: string, value: string) => {
|
|
139
|
+
const { configSet } = require('../src/cli/commands/config');
|
|
140
|
+
configSet(key, value);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
configCmd
|
|
144
|
+
.command('list')
|
|
145
|
+
.description('Show all configuration')
|
|
146
|
+
.action(() => {
|
|
147
|
+
const { configList } = require('../src/cli/commands/config');
|
|
148
|
+
configList();
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
configCmd
|
|
152
|
+
.command('reset')
|
|
153
|
+
.description('Reset to default configuration')
|
|
154
|
+
.action(() => {
|
|
155
|
+
const { configReset } = require('../src/cli/commands/config');
|
|
156
|
+
configReset();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// Default config action (no sub-command) shows list
|
|
160
|
+
configCmd.action(() => {
|
|
161
|
+
const { configList } = require('../src/cli/commands/config');
|
|
162
|
+
configList();
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
// ─── Models Command ─────────────────────────────────────────────
|
|
166
|
+
|
|
167
|
+
const modelsCmd = program
|
|
168
|
+
.command('models')
|
|
169
|
+
.description('Manage AI models');
|
|
170
|
+
|
|
171
|
+
modelsCmd
|
|
172
|
+
.command('list')
|
|
173
|
+
.description('List all available models')
|
|
174
|
+
.action(async () => {
|
|
175
|
+
const { modelsList } = require('../src/cli/commands/models');
|
|
176
|
+
await modelsList();
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
modelsCmd
|
|
180
|
+
.command('status')
|
|
181
|
+
.description('Show current model status')
|
|
182
|
+
.action(async () => {
|
|
183
|
+
const { modelsStatus } = require('../src/cli/commands/models');
|
|
184
|
+
await modelsStatus();
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
modelsCmd.action(async () => {
|
|
188
|
+
const { modelsStatus } = require('../src/cli/commands/models');
|
|
189
|
+
await modelsStatus();
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
// ─── Doctor Command ─────────────────────────────────────────────
|
|
193
|
+
|
|
194
|
+
program
|
|
195
|
+
.command('doctor')
|
|
196
|
+
.description('Run health checks on your AZERCLAW installation')
|
|
197
|
+
.option('-f, --fix', 'Attempt to auto-fix issues')
|
|
198
|
+
.action(async (opts: any) => {
|
|
199
|
+
printQuickSplash(VERSION);
|
|
200
|
+
const { runDoctor } = require('../src/cli/commands/doctor');
|
|
201
|
+
await runDoctor(opts);
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// ─── Security Audit Command ────────────────────────────────────
|
|
205
|
+
|
|
206
|
+
program
|
|
207
|
+
.command('security')
|
|
208
|
+
.description('Security audit')
|
|
209
|
+
.command('audit')
|
|
210
|
+
.option('-f, --fix', 'Auto-fix security issues')
|
|
211
|
+
.action(async (opts: any) => {
|
|
212
|
+
printQuickSplash(VERSION);
|
|
213
|
+
fishInfo('Running security audit...');
|
|
214
|
+
|
|
215
|
+
const fs = require('fs');
|
|
216
|
+
const config = getConfigManager();
|
|
217
|
+
const issues: string[] = [];
|
|
218
|
+
|
|
219
|
+
// Check config file permissions
|
|
220
|
+
try {
|
|
221
|
+
const stats = fs.statSync(config.paths.configFile);
|
|
222
|
+
const mode = (stats.mode & 0o777).toString(8);
|
|
223
|
+
if (mode !== '600') {
|
|
224
|
+
issues.push(`Config file has permissions 0${mode} (should be 0600)`);
|
|
225
|
+
if (opts.fix) {
|
|
226
|
+
fs.chmodSync(config.paths.configFile, 0o600);
|
|
227
|
+
fishInfo('Fixed: Config permissions set to 0600');
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
} catch { /* skip */ }
|
|
231
|
+
|
|
232
|
+
// Check for keys in environment
|
|
233
|
+
const envKeys = ['OPENAI_API_KEY', 'ANTHROPIC_API_KEY', 'GOOGLE_API_KEY'];
|
|
234
|
+
for (const key of envKeys) {
|
|
235
|
+
if (process.env[key]) {
|
|
236
|
+
fishInfo(`${key} found in environment (normal for CI/CD, prefer config file for local use)`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (issues.length === 0) {
|
|
241
|
+
const { fishSuccess } = require('../src/cli/animations/fish');
|
|
242
|
+
fishSuccess('Security audit passed! 🔒');
|
|
243
|
+
} else {
|
|
244
|
+
for (const issue of issues) {
|
|
245
|
+
const { fishWarn } = require('../src/cli/animations/fish');
|
|
246
|
+
fishWarn(issue);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
// ─── Agents Command ─────────────────────────────────────────────
|
|
252
|
+
|
|
253
|
+
const agentsCmd = program
|
|
254
|
+
.command('agents')
|
|
255
|
+
.description('Manage the Pantheon of built-in agents');
|
|
256
|
+
|
|
257
|
+
agentsCmd
|
|
258
|
+
.command('list')
|
|
259
|
+
.description('List all available agents')
|
|
260
|
+
.action(() => {
|
|
261
|
+
const { agentsList } = require('../src/cli/commands/agents');
|
|
262
|
+
agentsList();
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
agentsCmd
|
|
266
|
+
.command('invoke <name> <task>')
|
|
267
|
+
.description('Invoke a specific agent')
|
|
268
|
+
.action(async (name: string, task: string, opts: any) => {
|
|
269
|
+
printQuickSplash(VERSION);
|
|
270
|
+
const { agentInvoke } = require('../src/cli/commands/agents');
|
|
271
|
+
await agentInvoke(name, task, opts);
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
agentsCmd
|
|
275
|
+
.command('auto <task>')
|
|
276
|
+
.description('Auto-match the best agent for a task')
|
|
277
|
+
.action(async (task: string) => {
|
|
278
|
+
printQuickSplash(VERSION);
|
|
279
|
+
const { agentAuto } = require('../src/cli/commands/agents');
|
|
280
|
+
await agentAuto(task);
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
agentsCmd.action(() => {
|
|
284
|
+
const { agentsList } = require('../src/cli/commands/agents');
|
|
285
|
+
agentsList();
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
// ─── Parse & Run ────────────────────────────────────────────────
|
|
289
|
+
|
|
290
|
+
program.parse(process.argv);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* 🐟 AZERCLAW — CLI Entry Point
|
|
4
|
+
*
|
|
5
|
+
* An open-source, BYOK AI agent for your terminal.
|
|
6
|
+
* Inspired by OpenClaw, themed with a fish 🐟 instead of a lobster.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* azerclaw — Launch TUI (or onboard if first run)
|
|
10
|
+
* azerclaw chat — Interactive chat
|
|
11
|
+
* azerclaw run "task" — Execute a task
|
|
12
|
+
* azerclaw tui — Premium terminal UI
|
|
13
|
+
* azerclaw onboard — Setup wizard
|
|
14
|
+
* azerclaw config — Manage configuration
|
|
15
|
+
* azerclaw models — Manage AI models
|
|
16
|
+
* azerclaw doctor — Health check
|
|
17
|
+
*/
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=azerclaw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azerclaw.d.ts","sourceRoot":"","sources":["../../bin/azerclaw.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;GAeG"}
|