ps-claw 2026.5.30 → 2026.5.31
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 +79 -59
- package/package.json +18 -3
- package/dist/entry.js +0 -163
- package/dist/entry.mjs +0 -163
- package/dist/web-ui/public/index.html +0 -1179
- package/dist/web-ui/server.mjs +0 -192
package/README.md
CHANGED
|
@@ -10,96 +10,101 @@ Fork enxuto com foco em leveza e facilidade de uso, sem apps mobile, geração d
|
|
|
10
10
|
|
|
11
11
|
### Requisitos
|
|
12
12
|
- [Node.js](https://nodejs.org/) v22.19 ou superior
|
|
13
|
-
- [pnpm](https://pnpm.io/) ou npm
|
|
14
13
|
|
|
15
|
-
###
|
|
14
|
+
### Instalar via npm (recomendado)
|
|
16
15
|
|
|
17
16
|
```bash
|
|
18
|
-
|
|
19
|
-
cd ps-claw-v2
|
|
17
|
+
npm i ps-claw
|
|
20
18
|
```
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
Pronto! O comando `ps-claw` fica disponível globalmente se instalado com `-g`:
|
|
23
21
|
|
|
24
22
|
```bash
|
|
25
|
-
npm
|
|
23
|
+
npm i -g ps-claw
|
|
26
24
|
```
|
|
27
25
|
|
|
28
|
-
###
|
|
26
|
+
### Instalar via npx (sem instalar)
|
|
29
27
|
|
|
30
28
|
```bash
|
|
31
|
-
|
|
32
|
-
# Edite o .env com sua chave de API
|
|
29
|
+
npx ps-claw --help
|
|
33
30
|
```
|
|
34
31
|
|
|
35
|
-
###
|
|
32
|
+
### Instalar a partir do código-fonte
|
|
36
33
|
|
|
37
34
|
```bash
|
|
38
|
-
|
|
35
|
+
git clone https://github.com/Pedro21062014/Ps-Claw.git
|
|
36
|
+
cd Ps-Claw
|
|
37
|
+
pnpm install
|
|
38
|
+
pnpm build
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
---
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
## 🚀 Usando o PS Claw
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
node web-ui/server.mjs
|
|
47
|
-
```
|
|
45
|
+
### CLI — Linha de comando
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
---
|
|
47
|
+
Após instalar com `npm i -g ps-claw`:
|
|
52
48
|
|
|
53
|
-
|
|
49
|
+
```bash
|
|
50
|
+
ps-claw --help # Mostra todos os comandos
|
|
51
|
+
ps-claw --version # Versão instalada
|
|
52
|
+
ps-claw web # Inicia a interface web
|
|
53
|
+
ps-claw gateway run # Inicia o gateway
|
|
54
|
+
ps-claw gateway status # Verifica status do gateway
|
|
55
|
+
ps-claw doctor # Diagnóstico do sistema
|
|
56
|
+
ps-claw models list # Lista modelos disponíveis
|
|
57
|
+
ps-claw secrets set openai # Configura chave OpenAI
|
|
58
|
+
ps-claw secrets set anthropic # Configura chave Anthropic
|
|
59
|
+
ps-claw configure # Configuração interativa
|
|
60
|
+
```
|
|
54
61
|
|
|
55
|
-
|
|
62
|
+
### Interface Web
|
|
56
63
|
|
|
57
64
|
```bash
|
|
58
|
-
|
|
59
|
-
node openclaw.mjs
|
|
60
|
-
|
|
61
|
-
# Terminal 2 — inicia a interface web
|
|
62
|
-
node web-ui/server.mjs
|
|
65
|
+
ps-claw web
|
|
63
66
|
```
|
|
64
67
|
|
|
65
|
-
|
|
68
|
+
Acesse **http://localhost:3000** no navegador.
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
- 💬 Chat
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
- ⚙️
|
|
72
|
-
- 📱 Responsivo para mobile
|
|
70
|
+
A interface web tem 4 abas:
|
|
71
|
+
- 💬 **Chat** — conversas com histórico salvo localmente
|
|
72
|
+
- 🔗 **Gateways** — conectar e gerenciar APIs (OpenAI, Anthropic, Ollama, LM Studio, etc.)
|
|
73
|
+
- 🧠 **Modelos** — selecionar modelos por provedor (GPT-4o, Claude Opus 4.5, Gemini 2.5 Pro, DeepSeek...)
|
|
74
|
+
- ⚙️ **Config** — temperatura, max tokens, system prompt, chaves de API, export/import de configurações
|
|
73
75
|
|
|
74
|
-
### Variáveis de ambiente
|
|
76
|
+
### Variáveis de ambiente
|
|
75
77
|
|
|
76
78
|
```bash
|
|
77
|
-
PS_CLAW_WEB_PORT=3000
|
|
78
|
-
PS_CLAW_GATEWAY_PORT=18789
|
|
79
|
+
PS_CLAW_WEB_PORT=3000 # Porta da interface web (padrão: 3000)
|
|
80
|
+
PS_CLAW_GATEWAY_PORT=18789 # Porta do gateway (padrão: 18789)
|
|
81
|
+
OPENCLAW_GATEWAY_TOKEN= # Token de autenticação do gateway
|
|
82
|
+
OPENAI_API_KEY=sk-... # Chave OpenAI
|
|
83
|
+
ANTHROPIC_API_KEY=sk-ant-... # Chave Anthropic
|
|
84
|
+
GEMINI_API_KEY=... # Chave Google/Gemini
|
|
85
|
+
DEEPSEEK_API_KEY=sk-... # Chave DeepSeek
|
|
86
|
+
OPENROUTER_API_KEY=sk-or-... # Chave OpenRouter
|
|
79
87
|
```
|
|
80
88
|
|
|
89
|
+
Ou configure as chaves na aba **Config** da interface web.
|
|
90
|
+
|
|
81
91
|
---
|
|
82
92
|
|
|
83
93
|
## 🔄 Atualizar o PS Claw
|
|
84
94
|
|
|
85
|
-
Para atualizar para a versão mais recente, execute o script de atualização:
|
|
86
|
-
|
|
87
|
-
**Linux / macOS:**
|
|
88
95
|
```bash
|
|
89
|
-
|
|
96
|
+
npm update -g ps-claw
|
|
90
97
|
```
|
|
91
98
|
|
|
92
|
-
|
|
99
|
+
Ou se instalou via código-fonte:
|
|
100
|
+
|
|
93
101
|
```bash
|
|
94
|
-
|
|
102
|
+
cd Ps-Claw
|
|
103
|
+
git pull
|
|
104
|
+
pnpm install
|
|
105
|
+
pnpm build
|
|
95
106
|
```
|
|
96
107
|
|
|
97
|
-
O script vai:
|
|
98
|
-
1. Verificar se há uma versão nova disponível
|
|
99
|
-
2. Baixar as atualizações do GitHub
|
|
100
|
-
3. Reinstalar dependências se necessário
|
|
101
|
-
4. Mostrar o que mudou
|
|
102
|
-
|
|
103
108
|
---
|
|
104
109
|
|
|
105
110
|
## ✅ O que está incluído
|
|
@@ -107,12 +112,14 @@ O script vai:
|
|
|
107
112
|
| Recurso | Status |
|
|
108
113
|
|---|---|
|
|
109
114
|
| Core do agente autônomo | ✅ |
|
|
110
|
-
|
|
|
111
|
-
|
|
|
115
|
+
| Provedores: OpenAI, Anthropic, Google, DeepSeek, OpenRouter | ✅ |
|
|
116
|
+
| Interface web com gateways, modelos e configurações | ✅ |
|
|
117
|
+
| CLI com comandos completos | ✅ |
|
|
118
|
+
| Pacote npm publicado | ✅ |
|
|
119
|
+
| Busca na web (DuckDuckGo, Brave) | ✅ |
|
|
112
120
|
| Suporte a MCP / Skills | ✅ |
|
|
113
121
|
| Memória persistente | ✅ |
|
|
114
|
-
|
|
|
115
|
-
| CLI e Docker | ✅ |
|
|
122
|
+
| Docker | ✅ |
|
|
116
123
|
| Apps iOS / Android / macOS | ❌ removido |
|
|
117
124
|
| Geração de vídeo / música / imagem | ❌ removido |
|
|
118
125
|
| Transcrição em tempo real / TTS | ❌ removido |
|
|
@@ -130,20 +137,33 @@ docker-compose up
|
|
|
130
137
|
## 📁 Estrutura
|
|
131
138
|
|
|
132
139
|
```
|
|
133
|
-
|
|
134
|
-
├──
|
|
135
|
-
├──
|
|
140
|
+
Ps-Claw/
|
|
141
|
+
├── ps-claw.mjs ← Binário CLI principal
|
|
142
|
+
├── scripts/
|
|
143
|
+
│ └── build-all.mjs ← Script de build
|
|
136
144
|
├── web-ui/
|
|
137
|
-
│ ├── server.mjs
|
|
145
|
+
│ ├── server.mjs ← Servidor da interface web
|
|
138
146
|
│ └── public/
|
|
139
|
-
│ └── index.html ← Interface
|
|
140
|
-
├── src/
|
|
141
|
-
├──
|
|
147
|
+
│ └── index.html ← Interface web (Chat, Gateways, Modelos, Config)
|
|
148
|
+
├── src/ ← Código-fonte TypeScript
|
|
149
|
+
├── extensions/ ← Provedores (OpenAI, Anthropic, DeepSeek...)
|
|
150
|
+
├── packages/ ← Bibliotecas internas
|
|
151
|
+
├── .env.example ← Exemplo de configuração
|
|
142
152
|
└── package.json
|
|
143
153
|
```
|
|
144
154
|
|
|
145
155
|
---
|
|
146
156
|
|
|
157
|
+
## 📦 npm
|
|
158
|
+
|
|
159
|
+
Disponível em: [https://www.npmjs.com/package/ps-claw](https://www.npmjs.com/package/ps-claw)
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
npm i ps-claw
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
147
167
|
## 📄 Licença
|
|
148
168
|
|
|
149
169
|
MIT — baseado no [OpenClaw](https://github.com/openclaw/openclaw) por Peter Steinberger e contribuidores.
|
package/package.json
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ps-claw",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.31",
|
|
4
4
|
"description": "PS Claw - AI Agent Gateway with multi-provider support, web UI, and CLI. Lightweight fork of OpenClaw.",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ai",
|
|
7
|
+
"agent",
|
|
8
|
+
"gateway",
|
|
9
|
+
"chatgpt",
|
|
10
|
+
"openai",
|
|
11
|
+
"anthropic",
|
|
12
|
+
"claude",
|
|
13
|
+
"gemini",
|
|
14
|
+
"deepseek",
|
|
15
|
+
"llm",
|
|
16
|
+
"ai-gateway",
|
|
17
|
+
"chatbot",
|
|
18
|
+
"cli",
|
|
19
|
+
"web-ui"
|
|
20
|
+
],
|
|
6
21
|
"homepage": "https://github.com/Pedro21062014/Ps-Claw#readme",
|
|
7
22
|
"bugs": {
|
|
8
23
|
"url": "https://github.com/Pedro21062014/Ps-Claw/issues"
|
|
@@ -1613,7 +1628,7 @@
|
|
|
1613
1628
|
"postinstall": "echo 'Skipping postinstall'",
|
|
1614
1629
|
"postpack": "echo 'Skipping postpack'",
|
|
1615
1630
|
"preinstall": "echo 'Skipping preinstall'",
|
|
1616
|
-
"prepack": "
|
|
1631
|
+
"prepack": "echo 'Skipping prepack — dist/ already included in files'",
|
|
1617
1632
|
"prepare": "echo 'Skipping prepare'",
|
|
1618
1633
|
"prepush:ci": "bash scripts/prepush-ci.sh",
|
|
1619
1634
|
"probe:anthropic:prompt": "node --import tsx scripts/anthropic-prompt-probe.ts",
|
package/dist/entry.js
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { execSync } from "node:child_process";
|
|
6
|
-
|
|
7
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
|
|
9
|
-
const args = process.argv.slice(2);
|
|
10
|
-
const command = args[0];
|
|
11
|
-
|
|
12
|
-
if (!command || command === "--help" || command === "-h") {
|
|
13
|
-
console.log(`
|
|
14
|
-
🦞 PS Claw — AI Agent Gateway
|
|
15
|
-
|
|
16
|
-
Uso: ps-claw <comando> [opções]
|
|
17
|
-
|
|
18
|
-
Comandos:
|
|
19
|
-
gateway run Inicia o gateway PS Claw
|
|
20
|
-
gateway status Verifica status do gateway
|
|
21
|
-
web Inicia a interface web
|
|
22
|
-
secrets set Configura chaves de API
|
|
23
|
-
configure Configuração interativa
|
|
24
|
-
doctor Diagnóstico do sistema
|
|
25
|
-
models list Lista modelos disponíveis
|
|
26
|
-
version Mostra a versão
|
|
27
|
-
|
|
28
|
-
Opções:
|
|
29
|
-
-h, --help Mostra esta ajuda
|
|
30
|
-
-v, --version Mostra a versão
|
|
31
|
-
|
|
32
|
-
Exemplos:
|
|
33
|
-
ps-claw gateway run # Inicia o gateway
|
|
34
|
-
ps-claw web # Abre interface web
|
|
35
|
-
ps-claw secrets set openai # Configura chave OpenAI
|
|
36
|
-
ps-claw doctor # Verifica instalação
|
|
37
|
-
`);
|
|
38
|
-
process.exit(0);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (command === "version" || command === "--version" || command === "-v" || command === "-V") {
|
|
42
|
-
try {
|
|
43
|
-
const pkg = await import("file://" + path.join(__dirname, "..", "package.json"), { assert: { type: "json" } });
|
|
44
|
-
console.log("PS Claw " + pkg.default.version);
|
|
45
|
-
} catch {
|
|
46
|
-
console.log("PS Claw dev");
|
|
47
|
-
}
|
|
48
|
-
process.exit(0);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (command === "web") {
|
|
52
|
-
const webPath = path.join(__dirname, "web-ui", "server.mjs");
|
|
53
|
-
if (existsSync(webPath)) {
|
|
54
|
-
import("file://" + webPath);
|
|
55
|
-
} else {
|
|
56
|
-
// Fallback: tenta web-ui na raiz
|
|
57
|
-
const fallbackPath = path.join(__dirname, "..", "web-ui", "server.mjs");
|
|
58
|
-
if (existsSync(fallbackPath)) {
|
|
59
|
-
import("file://" + fallbackPath);
|
|
60
|
-
} else {
|
|
61
|
-
console.error("❌ Interface web não encontrada. Execute: pnpm build");
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
} else if (command === "gateway") {
|
|
66
|
-
const subCommand = args[1];
|
|
67
|
-
if (subCommand === "run") {
|
|
68
|
-
console.log("🦞 Iniciando gateway PS Claw...");
|
|
69
|
-
console.log(" Para configurar, use: ps-claw configure");
|
|
70
|
-
console.log(" Para diagnóstico, use: ps-claw doctor");
|
|
71
|
-
console.log("");
|
|
72
|
-
console.log(" Nota: O gateway completo requer o build TypeScript.");
|
|
73
|
-
console.log(" Use 'ps-claw web' para iniciar a interface web.");
|
|
74
|
-
} else if (subCommand === "status") {
|
|
75
|
-
console.log("🦞 Verificando status do gateway...");
|
|
76
|
-
try {
|
|
77
|
-
const result = execSync("curl -s http://localhost:18789/health", { timeout: 3000 }).toString();
|
|
78
|
-
console.log(" Status: " + result);
|
|
79
|
-
} catch {
|
|
80
|
-
console.log(" Status: Offline (gateway não está rodando)");
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
console.log("Uso: ps-claw gateway <run|status>");
|
|
84
|
-
}
|
|
85
|
-
} else if (command === "secrets") {
|
|
86
|
-
const subCommand = args[1];
|
|
87
|
-
if (subCommand === "set") {
|
|
88
|
-
const provider = args[2];
|
|
89
|
-
if (!provider) {
|
|
90
|
-
console.log("Uso: ps-claw secrets set <provider>");
|
|
91
|
-
console.log("Providers: openai, anthropic, google, deepseek, openrouter");
|
|
92
|
-
process.exit(1);
|
|
93
|
-
}
|
|
94
|
-
console.log("Para configurar a chave " + provider.toUpperCase() + ", defina a variável de ambiente:");
|
|
95
|
-
console.log(" export " + provider.toUpperCase() + "_API_KEY=sua-chave-aqui");
|
|
96
|
-
console.log("");
|
|
97
|
-
console.log("Ou adicione no arquivo ~/.ps-claw/.env");
|
|
98
|
-
} else {
|
|
99
|
-
console.log("Uso: ps-claw secrets set <provider>");
|
|
100
|
-
}
|
|
101
|
-
} else if (command === "configure") {
|
|
102
|
-
console.log("🦞 PS Claw — Configuração");
|
|
103
|
-
console.log("");
|
|
104
|
-
console.log("Arquivo de configuração: ~/.ps-claw/ps-claw.json");
|
|
105
|
-
console.log("Variáveis de ambiente: ~/.ps-claw/.env");
|
|
106
|
-
console.log("");
|
|
107
|
-
console.log("Para configurar chaves de API:");
|
|
108
|
-
console.log(" ps-claw secrets set openai");
|
|
109
|
-
console.log(" ps-claw secrets set anthropic");
|
|
110
|
-
console.log("");
|
|
111
|
-
console.log("Para iniciar o gateway:");
|
|
112
|
-
console.log(" ps-claw gateway run");
|
|
113
|
-
console.log("");
|
|
114
|
-
console.log("Para abrir a interface web:");
|
|
115
|
-
console.log(" ps-claw web");
|
|
116
|
-
} else if (command === "doctor") {
|
|
117
|
-
console.log("🦞 PS Claw — Diagnóstico");
|
|
118
|
-
console.log("");
|
|
119
|
-
console.log("Node.js: " + process.version);
|
|
120
|
-
console.log("Plataforma: " + process.platform + " " + process.arch);
|
|
121
|
-
console.log("");
|
|
122
|
-
try {
|
|
123
|
-
const result = execSync("curl -s http://localhost:18789/health", { timeout: 3000 }).toString();
|
|
124
|
-
console.log("Gateway: Online ✅");
|
|
125
|
-
} catch {
|
|
126
|
-
console.log("Gateway: Offline ❌");
|
|
127
|
-
}
|
|
128
|
-
console.log("Interface Web: Execute 'ps-claw web' para iniciar");
|
|
129
|
-
console.log("");
|
|
130
|
-
console.log("Para mais informações: ps-claw --help");
|
|
131
|
-
} else if (command === "models") {
|
|
132
|
-
const subCommand = args[1];
|
|
133
|
-
if (subCommand === "list") {
|
|
134
|
-
console.log("🦞 Modelos disponíveis:");
|
|
135
|
-
console.log("");
|
|
136
|
-
console.log("OpenAI:");
|
|
137
|
-
console.log(" - gpt-4o");
|
|
138
|
-
console.log(" - gpt-4o-mini");
|
|
139
|
-
console.log(" - gpt-4-turbo");
|
|
140
|
-
console.log(" - o1-preview");
|
|
141
|
-
console.log("");
|
|
142
|
-
console.log("Anthropic:");
|
|
143
|
-
console.log(" - claude-opus-4-5");
|
|
144
|
-
console.log(" - claude-sonnet-4-5");
|
|
145
|
-
console.log(" - claude-3.5-sonnet");
|
|
146
|
-
console.log(" - claude-3-haiku");
|
|
147
|
-
console.log("");
|
|
148
|
-
console.log("Google:");
|
|
149
|
-
console.log(" - gemini-2.5-pro");
|
|
150
|
-
console.log(" - gemini-2.0-flash");
|
|
151
|
-
console.log("");
|
|
152
|
-
console.log("DeepSeek:");
|
|
153
|
-
console.log(" - deepseek-chat");
|
|
154
|
-
console.log(" - deepseek-reasoner");
|
|
155
|
-
console.log("");
|
|
156
|
-
console.log("OpenRouter:");
|
|
157
|
-
console.log(" - openrouter-auto");
|
|
158
|
-
console.log(" - meta-llama/llama-3.1-405b");
|
|
159
|
-
}
|
|
160
|
-
} else {
|
|
161
|
-
console.log("Comando desconhecido: " + command);
|
|
162
|
-
console.log("Use 'ps-claw --help' para ver os comandos disponíveis.");
|
|
163
|
-
}
|
package/dist/entry.mjs
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire } from "node:module";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
import { execSync } from "node:child_process";
|
|
6
|
-
|
|
7
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
-
|
|
9
|
-
const args = process.argv.slice(2);
|
|
10
|
-
const command = args[0];
|
|
11
|
-
|
|
12
|
-
if (!command || command === "--help" || command === "-h") {
|
|
13
|
-
console.log(`
|
|
14
|
-
🦞 PS Claw — AI Agent Gateway
|
|
15
|
-
|
|
16
|
-
Uso: ps-claw <comando> [opções]
|
|
17
|
-
|
|
18
|
-
Comandos:
|
|
19
|
-
gateway run Inicia o gateway PS Claw
|
|
20
|
-
gateway status Verifica status do gateway
|
|
21
|
-
web Inicia a interface web
|
|
22
|
-
secrets set Configura chaves de API
|
|
23
|
-
configure Configuração interativa
|
|
24
|
-
doctor Diagnóstico do sistema
|
|
25
|
-
models list Lista modelos disponíveis
|
|
26
|
-
version Mostra a versão
|
|
27
|
-
|
|
28
|
-
Opções:
|
|
29
|
-
-h, --help Mostra esta ajuda
|
|
30
|
-
-v, --version Mostra a versão
|
|
31
|
-
|
|
32
|
-
Exemplos:
|
|
33
|
-
ps-claw gateway run # Inicia o gateway
|
|
34
|
-
ps-claw web # Abre interface web
|
|
35
|
-
ps-claw secrets set openai # Configura chave OpenAI
|
|
36
|
-
ps-claw doctor # Verifica instalação
|
|
37
|
-
`);
|
|
38
|
-
process.exit(0);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if (command === "version" || command === "--version" || command === "-v" || command === "-V") {
|
|
42
|
-
try {
|
|
43
|
-
const pkg = await import("file://" + path.join(__dirname, "..", "package.json"), { assert: { type: "json" } });
|
|
44
|
-
console.log("PS Claw " + pkg.default.version);
|
|
45
|
-
} catch {
|
|
46
|
-
console.log("PS Claw dev");
|
|
47
|
-
}
|
|
48
|
-
process.exit(0);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
if (command === "web") {
|
|
52
|
-
const webPath = path.join(__dirname, "web-ui", "server.mjs");
|
|
53
|
-
if (existsSync(webPath)) {
|
|
54
|
-
import("file://" + webPath);
|
|
55
|
-
} else {
|
|
56
|
-
// Fallback: tenta web-ui na raiz
|
|
57
|
-
const fallbackPath = path.join(__dirname, "..", "web-ui", "server.mjs");
|
|
58
|
-
if (existsSync(fallbackPath)) {
|
|
59
|
-
import("file://" + fallbackPath);
|
|
60
|
-
} else {
|
|
61
|
-
console.error("❌ Interface web não encontrada. Execute: pnpm build");
|
|
62
|
-
process.exit(1);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
} else if (command === "gateway") {
|
|
66
|
-
const subCommand = args[1];
|
|
67
|
-
if (subCommand === "run") {
|
|
68
|
-
console.log("🦞 Iniciando gateway PS Claw...");
|
|
69
|
-
console.log(" Para configurar, use: ps-claw configure");
|
|
70
|
-
console.log(" Para diagnóstico, use: ps-claw doctor");
|
|
71
|
-
console.log("");
|
|
72
|
-
console.log(" Nota: O gateway completo requer o build TypeScript.");
|
|
73
|
-
console.log(" Use 'ps-claw web' para iniciar a interface web.");
|
|
74
|
-
} else if (subCommand === "status") {
|
|
75
|
-
console.log("🦞 Verificando status do gateway...");
|
|
76
|
-
try {
|
|
77
|
-
const result = execSync("curl -s http://localhost:18789/health", { timeout: 3000 }).toString();
|
|
78
|
-
console.log(" Status: " + result);
|
|
79
|
-
} catch {
|
|
80
|
-
console.log(" Status: Offline (gateway não está rodando)");
|
|
81
|
-
}
|
|
82
|
-
} else {
|
|
83
|
-
console.log("Uso: ps-claw gateway <run|status>");
|
|
84
|
-
}
|
|
85
|
-
} else if (command === "secrets") {
|
|
86
|
-
const subCommand = args[1];
|
|
87
|
-
if (subCommand === "set") {
|
|
88
|
-
const provider = args[2];
|
|
89
|
-
if (!provider) {
|
|
90
|
-
console.log("Uso: ps-claw secrets set <provider>");
|
|
91
|
-
console.log("Providers: openai, anthropic, google, deepseek, openrouter");
|
|
92
|
-
process.exit(1);
|
|
93
|
-
}
|
|
94
|
-
console.log("Para configurar a chave " + provider.toUpperCase() + ", defina a variável de ambiente:");
|
|
95
|
-
console.log(" export " + provider.toUpperCase() + "_API_KEY=sua-chave-aqui");
|
|
96
|
-
console.log("");
|
|
97
|
-
console.log("Ou adicione no arquivo ~/.ps-claw/.env");
|
|
98
|
-
} else {
|
|
99
|
-
console.log("Uso: ps-claw secrets set <provider>");
|
|
100
|
-
}
|
|
101
|
-
} else if (command === "configure") {
|
|
102
|
-
console.log("🦞 PS Claw — Configuração");
|
|
103
|
-
console.log("");
|
|
104
|
-
console.log("Arquivo de configuração: ~/.ps-claw/ps-claw.json");
|
|
105
|
-
console.log("Variáveis de ambiente: ~/.ps-claw/.env");
|
|
106
|
-
console.log("");
|
|
107
|
-
console.log("Para configurar chaves de API:");
|
|
108
|
-
console.log(" ps-claw secrets set openai");
|
|
109
|
-
console.log(" ps-claw secrets set anthropic");
|
|
110
|
-
console.log("");
|
|
111
|
-
console.log("Para iniciar o gateway:");
|
|
112
|
-
console.log(" ps-claw gateway run");
|
|
113
|
-
console.log("");
|
|
114
|
-
console.log("Para abrir a interface web:");
|
|
115
|
-
console.log(" ps-claw web");
|
|
116
|
-
} else if (command === "doctor") {
|
|
117
|
-
console.log("🦞 PS Claw — Diagnóstico");
|
|
118
|
-
console.log("");
|
|
119
|
-
console.log("Node.js: " + process.version);
|
|
120
|
-
console.log("Plataforma: " + process.platform + " " + process.arch);
|
|
121
|
-
console.log("");
|
|
122
|
-
try {
|
|
123
|
-
const result = execSync("curl -s http://localhost:18789/health", { timeout: 3000 }).toString();
|
|
124
|
-
console.log("Gateway: Online ✅");
|
|
125
|
-
} catch {
|
|
126
|
-
console.log("Gateway: Offline ❌");
|
|
127
|
-
}
|
|
128
|
-
console.log("Interface Web: Execute 'ps-claw web' para iniciar");
|
|
129
|
-
console.log("");
|
|
130
|
-
console.log("Para mais informações: ps-claw --help");
|
|
131
|
-
} else if (command === "models") {
|
|
132
|
-
const subCommand = args[1];
|
|
133
|
-
if (subCommand === "list") {
|
|
134
|
-
console.log("🦞 Modelos disponíveis:");
|
|
135
|
-
console.log("");
|
|
136
|
-
console.log("OpenAI:");
|
|
137
|
-
console.log(" - gpt-4o");
|
|
138
|
-
console.log(" - gpt-4o-mini");
|
|
139
|
-
console.log(" - gpt-4-turbo");
|
|
140
|
-
console.log(" - o1-preview");
|
|
141
|
-
console.log("");
|
|
142
|
-
console.log("Anthropic:");
|
|
143
|
-
console.log(" - claude-opus-4-5");
|
|
144
|
-
console.log(" - claude-sonnet-4-5");
|
|
145
|
-
console.log(" - claude-3.5-sonnet");
|
|
146
|
-
console.log(" - claude-3-haiku");
|
|
147
|
-
console.log("");
|
|
148
|
-
console.log("Google:");
|
|
149
|
-
console.log(" - gemini-2.5-pro");
|
|
150
|
-
console.log(" - gemini-2.0-flash");
|
|
151
|
-
console.log("");
|
|
152
|
-
console.log("DeepSeek:");
|
|
153
|
-
console.log(" - deepseek-chat");
|
|
154
|
-
console.log(" - deepseek-reasoner");
|
|
155
|
-
console.log("");
|
|
156
|
-
console.log("OpenRouter:");
|
|
157
|
-
console.log(" - openrouter-auto");
|
|
158
|
-
console.log(" - meta-llama/llama-3.1-405b");
|
|
159
|
-
}
|
|
160
|
-
} else {
|
|
161
|
-
console.log("Comando desconhecido: " + command);
|
|
162
|
-
console.log("Use 'ps-claw --help' para ver os comandos disponíveis.");
|
|
163
|
-
}
|