@runflow-ai/cli 0.2.18 → 0.2.20

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/CLI-DOCS.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # RunFlow CLI Documentation
2
2
 
3
- **Version:** 0.2.0
3
+ **Version:** 0.2.19
4
4
  **Command:** `rf`
5
5
 
6
6
  A CLI para interagir com a API Portal RunFlow, permitindo gerenciar agentes de IA, usuários, prompts e muito mais.
@@ -8,7 +8,7 @@ A CLI para interagir com a API Portal RunFlow, permitindo gerenciar agentes de I
8
8
  ## Instalação
9
9
 
10
10
  ```bash
11
- npm install -g runflow-cli
11
+ npm install -g @runflow-ai/cli
12
12
  ```
13
13
 
14
14
  ## Autenticação
@@ -131,7 +131,9 @@ rf prompt <action> <name> [data] # alias
131
131
  | Ação | Descrição | Exemplo |
132
132
  |------|-----------|---------|
133
133
  | `get <name>` | Obtém um prompt | `rf prompts get meu-prompt` |
134
- | `render <name> <json>` | Renderiza prompt com variáveis | `rf prompts render meu-prompt '{"var":"value"}'` |
134
+ | `render <name> <json>` | Renderiza prompt com variáveis (JSON obrigatório) | `rf prompts render meu-prompt '{"username":"João","product":"RunFlow"}'` |
135
+
136
+ **Nota:** O comando `render` requer um JSON válido como terceiro parâmetro contendo as variáveis para renderizar o template.
135
137
 
136
138
  ### 🔑 Credentials (Credenciais)
137
139
 
@@ -149,104 +151,6 @@ rf credential <action> [name] # alias
149
151
  | `list` | Lista credenciais | `rf credentials list` |
150
152
  | `get <name>` | Obtém credencial específica | `rf credentials get minha-credencial` |
151
153
 
152
- ### 🔍 Search Tools
153
-
154
- Gerenciar ferramentas de busca.
155
-
156
- ```bash
157
- rf search-tools <action>
158
- ```
159
-
160
- **Ações:**
161
-
162
- | Ação | Descrição | Exemplo |
163
- |------|-----------|---------|
164
- | `list` | Lista ferramentas de busca | `rf search-tools list` |
165
-
166
- ### ⚡ Executions
167
-
168
- Gerenciar execuções.
169
-
170
- ```bash
171
- rf executions <action>
172
- ```
173
-
174
- **Ações:**
175
-
176
- | Ação | Descrição | Exemplo |
177
- |------|-----------|---------|
178
- | `list` | Lista execuções | `rf executions list` |
179
-
180
- ### 💾 Sessions
181
-
182
- Gerenciar sessões.
183
-
184
- ```bash
185
- rf sessions <action>
186
- ```
187
-
188
- **Ações:**
189
-
190
- | Ação | Descrição | Exemplo |
191
- |------|-----------|---------|
192
- | `list` | Lista sessões | `rf sessions list` |
193
-
194
- ### 📊 Datasources
195
-
196
- Gerenciar fontes de dados.
197
-
198
- ```bash
199
- rf datasources <action>
200
- ```
201
-
202
- **Ações:**
203
-
204
- | Ação | Descrição | Exemplo |
205
- |------|-----------|---------|
206
- | `list` | Lista fontes de dados | `rf datasources list` |
207
-
208
- ### 🔗 Connectors
209
-
210
- Gerenciar conectores.
211
-
212
- ```bash
213
- rf connectors <action>
214
- ```
215
-
216
- **Ações:**
217
-
218
- | Ação | Descrição | Exemplo |
219
- |------|-----------|---------|
220
- | `list` | Lista conectores | `rf connectors list` |
221
-
222
- ### 🎯 Triggers
223
-
224
- Gerenciar triggers.
225
-
226
- ```bash
227
- rf triggers <action>
228
- ```
229
-
230
- **Ações:**
231
-
232
- | Ação | Descrição | Exemplo |
233
- |------|-----------|---------|
234
- | `list` | Lista triggers | `rf triggers list` |
235
-
236
- ### 📈 Traces
237
-
238
- Gerenciar traces.
239
-
240
- ```bash
241
- rf traces <action>
242
- ```
243
-
244
- **Ações:**
245
-
246
- | Ação | Descrição | Exemplo |
247
- |------|-----------|---------|
248
- | `list` | Lista traces | `rf traces list` |
249
-
250
154
  ### 🔐 Secret
251
155
 
252
156
  Gerenciar secrets.
@@ -261,16 +165,6 @@ rf secret <action>
261
165
  |------|-----------|---------|
262
166
  | `list` | Lista secrets | `rf secret list` |
263
167
 
264
- ### 🏥 Health
265
-
266
- Verificar saúde da API.
267
-
268
- ```bash
269
- rf health [detail]
270
- ```
271
-
272
- **Descrição:** Verifica o status de saúde da API Portal.
273
-
274
168
  ### 🔓 Login
275
169
 
276
170
  Autenticar com a API RunFlow.
@@ -386,21 +280,21 @@ rf prompts render welcome-message '{"username": "João", "product": "RunFlow"}'
386
280
 
387
281
  ### Monitoramento
388
282
  ```bash
389
- # Verificar saúde da API
390
- rf health
283
+ # Testar localmente com observabilidade
284
+ rf test
391
285
 
392
- # Ver execuções recentes
393
- rf executions list
286
+ # Verificar prompts
287
+ rf prompts get my-prompt
394
288
 
395
- # Analisar traces
396
- rf traces list
289
+ # Gerenciar credenciais
290
+ rf credentials list
397
291
  ```
398
292
 
399
293
  ---
400
294
 
401
295
  ## 🧪 Test (Local Testing)
402
296
 
403
- Inicia servidor local de observabilidade e abre o portal cloud para testar agentes.
297
+ Inicia servidor local de observabilidade com interface web para testar agentes.
404
298
 
405
299
  ```bash
406
300
  rf test [options]
@@ -413,8 +307,8 @@ rf test [options]
413
307
  **Características:**
414
308
  - ✅ Zero configuração - detecta `agentId` automaticamente do `.runflow/rf.json`
415
309
  - ✅ Portas aleatórias - evita conflitos tentando até 3 portas
416
- - ✅ Portal cloud - usa `platform.runflow.ai` sempre atualizado
417
- - ✅ Dados locais - traces armazenados em `.runflow/traces/`
310
+ - ✅ Portal local - interface web servida em `localhost` com arquivos estáticos incluídos
311
+ - ✅ Dados locais - traces armazenados em `.runflow/traces.json`
418
312
  - ✅ Monitoramento real-time - visualize threads, execuções e traces
419
313
 
420
314
  **Exemplo básico:**
@@ -430,9 +324,9 @@ rf test
430
324
  # ✓ Opening browser...
431
325
  #
432
326
  # 📊 Test Portal Ready!
433
- # 🌐 Portal: https://platform.runflow.ai/agents/abc.../test-monitor?...
327
+ # 🌐 Portal: http://localhost:3421/agents/abc.../test-monitor?...
434
328
  # 📡 API: http://localhost:3421
435
- # 💾 Storage: .runflow/traces/
329
+ # 💾 Storage: .runflow/traces.json
436
330
  ```
437
331
 
438
332
  **Com opções:**
@@ -449,8 +343,8 @@ rf test --no-browser
449
343
  1. **Lê configuração** do `.runflow/rf.json` (agentId, agentName)
450
344
  2. **Inicia servidor local** com 3 APIs de observabilidade
451
345
  3. **Tenta até 3 portas** caso a primeira esteja ocupada
452
- 4. **Abre portal cloud** (`platform.runflow.ai`) com parâmetros corretos
453
- 5. **Portal conecta** ao servidor local para buscar dados
346
+ 4. **Serve interface web local** em `localhost` com arquivos estáticos incluídos na CLI
347
+ 5. **Portal mostra dados** armazenados localmente em `.runflow/traces.json`
454
348
 
455
349
  **APIs disponíveis:**
456
350
  - `GET /health` - Health check
@@ -462,11 +356,7 @@ rf test --no-browser
462
356
  ```
463
357
  .runflow/
464
358
  ├── rf.json # Configuração do agente
465
- └── traces/ # Armazenamento de traces
466
- ├── 2025-11-06/ # Pastas por data
467
- │ └── session-*.json
468
- └── 2025-11-07/
469
- └── ...
359
+ └── traces.json # Armazenamento de traces local
470
360
  ```
471
361
 
472
362
  **Fluxo típico de uso:**
@@ -489,11 +379,12 @@ node agent.ts
489
379
 
490
380
  ### Problemas de Autenticação
491
381
  ```bash
492
- # Verificar configuração
493
- rf health
494
-
495
382
  # Fazer login novamente
496
383
  rf login --api-key sua-chave
384
+
385
+ # Verificar configuração
386
+ ls -la .runflow/rf.json
387
+ cat .runflow/rf.json
497
388
  ```
498
389
 
499
390
  ### Problemas de Git
package/README.md CHANGED
@@ -8,6 +8,7 @@ Command line interface to manage AI agents via **API Portal**. Authenticate, pro
8
8
  - **Complete AI agent management** with cloning and deployment
9
9
  - **Interactive interface** with menu selection
10
10
  - **Secure credentials** integrated
11
+ - **Local testing** with observability server
11
12
 
12
13
  ## 🚀 Installation
13
14
 
@@ -34,27 +35,96 @@ rf agents deploy
34
35
 
35
36
  # 5. Pull latest changes when needed
36
37
  rf agents pull
38
+
39
+ # 6. Test locally with observability
40
+ rf test
37
41
  ```
38
42
 
39
- ## 🛠️ Main Commands
43
+ ## 🛠️ Available Commands
44
+
45
+ ### Authentication
46
+
47
+ | Command | Description | Options |
48
+ | --- | --- | --- |
49
+ | `rf login --api-key <key>` | Authenticate with RunFlow API | `--api <url>`, `--tenant-id <id>` |
50
+
51
+ ### Agents Management
40
52
 
41
53
  | Command | Description |
42
54
  | --- | --- |
43
- | `rf login --api-key <key>` | Authentication |
44
- | `rf agents <action>` | Manage AI agents |
45
- | `rf users <action>` | Manage users |
46
- | `rf prompts <action>` | Manage prompts |
47
- | `rf credentials <action>` | Manage credentials |
48
-
49
- **Key agent actions:**
50
- - `rf agents list` - List and select agents
51
- - `rf agents clone` - Download agent repository
52
- - `rf agents pull` - Pull latest changes (overwrites local)
53
- - `rf agents deploy` - Deploy local changes
55
+ | `rf agents list` | List agents with **interactive menu** (clone, deploy, duplicate, delete) |
56
+ | `rf agents get` | Show current/selected agent details |
57
+ | `rf agents create <json>` | Create a new agent |
58
+ | `rf agents update <json>` | Update the selected agent |
59
+ | `rf agents delete` | Delete the selected agent |
60
+ | `rf agents clone` | Download agent repository (clone) |
61
+ | `rf agents pull` | Pull latest changes from server |
62
+ | `rf agents duplicate` | Duplicate agent on server |
63
+ | `rf agents deploy` | Deploy local changes to server |
64
+
65
+ **Aliases:** `rf agent` (singular)
66
+
67
+ ### Users Management
68
+
69
+ | Command | Description |
70
+ | --- | --- |
71
+ | `rf users list` | List and select users |
72
+ | `rf users get` | Show selected user details |
73
+ | `rf users create <json>` | Create a new user |
74
+ | `rf users update <json>` | Update selected user |
75
+ | `rf users delete` | Delete selected user |
76
+
77
+ **Aliases:** `rf user` (singular)
78
+
79
+ ### Prompts Management
80
+
81
+ | Command | Description |
82
+ | --- | --- |
83
+ | `rf prompts get <name>` | Get prompt template by name |
84
+ | `rf prompts render <name> <json>` | Render prompt with variables (JSON required) |
85
+
86
+ **Example:**
87
+ ```bash
88
+ rf prompts render welcome-message '{"username": "John", "product": "RunFlow"}'
89
+ ```
90
+
91
+ **Aliases:** `rf prompt` (singular)
92
+
93
+ ### Credentials Management
94
+
95
+ | Command | Description |
96
+ | --- | --- |
97
+ | `rf credentials list` | List and select credentials |
98
+ | `rf credentials get <name>` | Get credential details by name |
99
+
100
+ **Aliases:** `rf credential` (singular)
101
+
102
+ ### Testing & Development
103
+
104
+ | Command | Description | Options |
105
+ | --- | --- | --- |
106
+ | `rf test` | Start **local** observability server with web interface | `-p, --port <port>`, `--no-browser` |
107
+
108
+ **Features:**
109
+ - Zero configuration - auto-detects agent from `.runflow/rf.json`
110
+ - Random ports (3000-4000) to avoid conflicts
111
+ - Local web portal with real-time monitoring
112
+ - Traces storage in `.runflow/traces.json`
113
+
114
+ ### Global Options
115
+
116
+ All commands support:
117
+ - `--api-key <key>` - Override API key
118
+ - `--api <url>` - Override API URL
119
+ - `--verbose` - Show detailed output
120
+ - `--quiet` - Suppress output
121
+ - `--help, -h` - Show help
54
122
 
55
123
  Run `rf --help` to see all commands.
56
124
 
57
- ## 📦 Usage Example
125
+ ## 📦 Usage Examples
126
+
127
+ ### Basic Workflow
58
128
 
59
129
  ```bash
60
130
  # 1. Authenticate
@@ -74,6 +144,49 @@ rf agents deploy
74
144
  rf agents pull
75
145
  ```
76
146
 
147
+ ### Local Testing
148
+
149
+ ```bash
150
+ # Start local server with web interface
151
+ cd agent-name/
152
+ rf test
153
+
154
+ # Opens browser automatically at:
155
+ # http://localhost:PORT/agents/your-agent/test-monitor
156
+
157
+ # Specify custom port
158
+ rf test --port 4500
159
+
160
+ # Without opening browser
161
+ rf test --no-browser
162
+ ```
163
+
164
+ ### Managing Prompts
165
+
166
+ ```bash
167
+ # Get a prompt template
168
+ rf prompts get welcome-message
169
+
170
+ # Render prompt with variables
171
+ rf prompts render welcome-message '{"username": "John", "product": "RunFlow"}'
172
+ ```
173
+
174
+ ### Managing Credentials
175
+
176
+ ```bash
177
+ # List all credentials
178
+ rf credentials list
179
+
180
+ # Get specific credential
181
+ rf credentials get my-api-key
182
+ ```
183
+
184
+ ## 📚 Documentation
185
+
186
+ For detailed documentation, see:
187
+ - [CLI-DOCS.md](./CLI-DOCS.md) - Complete command reference
188
+ - [docs/TEST-COMMAND.md](./docs/TEST-COMMAND.md) - Test command guide
189
+
77
190
  ## 📝 License
78
191
 
79
192
  MIT – (c) IFTL 2025
@@ -6,7 +6,6 @@ interface TestCommandOptions {
6
6
  export declare class TestCommand extends CommandRunner {
7
7
  private server;
8
8
  private app;
9
- private storageDir;
10
9
  run(passedParam: string[], options?: TestCommandOptions): Promise<void>;
11
10
  parsePort(val: string): number;
12
11
  parseNoBrowser(): boolean;
@@ -20,14 +19,13 @@ export declare class TestCommand extends CommandRunner {
20
19
  private generateSessionId;
21
20
  private generateUserId;
22
21
  private createFingerprint;
23
- private ensureStorageDir;
22
+ private ensureTracesFile;
24
23
  private startObservabilityServer;
25
24
  private setupObservabilityEndpoints;
26
25
  private getThreads;
27
26
  private getThreadExecutions;
28
27
  private getExecutionTraces;
29
28
  private countAllTraces;
30
- private getAllTraceFiles;
31
29
  private getSDKTraces;
32
30
  private buildTraceHierarchy;
33
31
  private openBrowser;