nex-framework-cli 1.0.1

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/nex-cli.js ADDED
@@ -0,0 +1,321 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * NEX CLI - Interface de linha de comando do NEX Framework
5
+ */
6
+ import { Command } from 'commander'
7
+ import chalk from 'chalk'
8
+ import inquirer from 'inquirer'
9
+ import fs from 'fs-extra'
10
+ import path from 'path'
11
+ import { fileURLToPath } from 'url'
12
+
13
+ const __filename = fileURLToPath(import.meta.url)
14
+ const __dirname = path.dirname(__filename)
15
+
16
+ const program = new Command()
17
+
18
+ program
19
+ .name('nex')
20
+ .description('NEX Framework - Framework completo de agentes AI')
21
+ .version('1.0.0')
22
+
23
+ // Comando: init
24
+ program
25
+ .command('init')
26
+ .description('Inicializa um novo projeto NEX')
27
+ .option('-n, --name <name>', 'Nome do projeto')
28
+ .option('-t, --template <template>', 'Template a usar')
29
+ .action(async (options) => {
30
+ console.log(chalk.blue('🚀 Inicializando projeto NEX...'))
31
+
32
+ const answers = await inquirer.prompt([
33
+ {
34
+ type: 'input',
35
+ name: 'projectName',
36
+ message: 'Nome do projeto:',
37
+ default: options.name || 'nex-project',
38
+ when: !options.name
39
+ },
40
+ {
41
+ type: 'list',
42
+ name: 'template',
43
+ message: 'Escolha um template:',
44
+ choices: ['blank', 'full-stack', 'api-only', 'mobile'],
45
+ default: options.template || 'blank',
46
+ when: !options.template
47
+ }
48
+ ])
49
+
50
+ const projectName = options.name || answers.projectName
51
+ const template = options.template || answers.template
52
+
53
+ // Criar estrutura do projeto
54
+ await createProjectStructure(projectName, template)
55
+
56
+ console.log(chalk.green(`✅ Projeto ${projectName} criado com sucesso!`))
57
+ })
58
+
59
+ // Comando: plan
60
+ program
61
+ .command('plan')
62
+ .description('Gera plano completo do projeto (PRD, arquitetura, etc.)')
63
+ .option('-r, --requirements <file>', 'Arquivo de requisitos')
64
+ .option('-o, --output <dir>', 'Diretório de saída')
65
+ .action(async (options) => {
66
+ console.log(chalk.blue('📋 Gerando plano do projeto...'))
67
+
68
+ // Importar agentes de planejamento
69
+ const { default: ANX } = await import('../src/services/nex/agents/planning/ANX.js')
70
+ const { default: PMX } = await import('../src/services/nex/agents/planning/PMX.js')
71
+ const { default: ARX } = await import('../src/services/nex/agents/planning/ARX.js')
72
+ const { default: DocumentGenerator } = await import('../src/services/nex/core/documentGenerator.js')
73
+
74
+ const anx = new ANX()
75
+ const pmx = new PMX()
76
+ const arx = new ARX()
77
+ const docGen = new DocumentGenerator()
78
+
79
+ // Ler requisitos
80
+ const requirements = options.requirements
81
+ ? await fs.readJSON(options.requirements)
82
+ : await promptRequirements()
83
+
84
+ // Análise
85
+ console.log(chalk.yellow('🔍 Analisando requisitos...'))
86
+ const analysis = await anx.analyzeRequirements(requirements)
87
+
88
+ // PRD
89
+ console.log(chalk.yellow('📝 Criando PRD...'))
90
+ const prdResult = await pmx.createPRD(analysis, requirements)
91
+ const prdPath = await docGen.generatePRD(prdResult.prd)
92
+
93
+ // Arquitetura
94
+ console.log(chalk.yellow('🏗️ Projetando arquitetura...'))
95
+ const archResult = await arx.designArchitecture(prdResult.prd, analysis)
96
+ const archPath = await docGen.generateArchitectureDoc(archResult.architecture)
97
+
98
+ console.log(chalk.green('✅ Plano gerado com sucesso!'))
99
+ console.log(chalk.cyan(`📄 PRD: ${prdPath}`))
100
+ console.log(chalk.cyan(`🏗️ Arquitetura: ${archPath}`))
101
+ })
102
+
103
+ // Comando: agent (Marketplace Integration)
104
+ const agentCmd = program
105
+ .command('agent')
106
+ .description('Gerencia agentes do NEX Marketplace')
107
+
108
+ // agent search
109
+ agentCmd
110
+ .command('search <query>')
111
+ .description('Busca agentes no marketplace')
112
+ .option('-c, --category <category>', 'Filtrar por categoria')
113
+ .option('--official', 'Apenas agentes oficiais')
114
+ .option('-l, --limit <number>', 'Limitar resultados', '50')
115
+ .action(async (query, options) => {
116
+ const { default: NEXMarketplace } = await import('../src/services/nex-marketplace/NEXMarketplace.js')
117
+ const marketplace = new NEXMarketplace()
118
+ await marketplace.search(query, options)
119
+ })
120
+
121
+ // agent install
122
+ agentCmd
123
+ .command('install <agentId>')
124
+ .description('Instala um agente')
125
+ .option('-v, --version <version>', 'Versão específica')
126
+ .option('-m, --method <method>', 'Método de instalação (symlink|copy)')
127
+ .action(async (agentId, options) => {
128
+ const { default: NEXMarketplace } = await import('../src/services/nex-marketplace/NEXMarketplace.js')
129
+ const marketplace = new NEXMarketplace()
130
+ await marketplace.install(agentId, options)
131
+ })
132
+
133
+ // agent list
134
+ agentCmd
135
+ .command('list')
136
+ .alias('ls')
137
+ .description('Lista agentes instalados')
138
+ .option('-a, --all', 'Mostrar todos os agentes')
139
+ .action(async (options) => {
140
+ const { default: NEXMarketplace } = await import('../src/services/nex-marketplace/NEXMarketplace.js')
141
+ const marketplace = new NEXMarketplace()
142
+ await marketplace.list(options)
143
+ })
144
+
145
+ // agent info
146
+ agentCmd
147
+ .command('info <agentId>')
148
+ .description('Mostra informações detalhadas do agente')
149
+ .action(async (agentId) => {
150
+ const { default: NEXMarketplace } = await import('../src/services/nex-marketplace/NEXMarketplace.js')
151
+ const marketplace = new NEXMarketplace()
152
+ await marketplace.info(agentId)
153
+ })
154
+
155
+ // agent uninstall
156
+ agentCmd
157
+ .command('uninstall <agentId>')
158
+ .alias('remove')
159
+ .description('Remove um agente instalado')
160
+ .action(async (agentId) => {
161
+ const { default: NEXMarketplace } = await import('../src/services/nex-marketplace/NEXMarketplace.js')
162
+ const marketplace = new NEXMarketplace()
163
+ await marketplace.uninstall(agentId)
164
+ })
165
+
166
+ // agent update
167
+ agentCmd
168
+ .command('update [agentId]')
169
+ .description('Atualiza agente(s)')
170
+ .option('-a, --all', 'Atualizar todos os agentes')
171
+ .action(async (agentId, options) => {
172
+ const { default: NEXMarketplace } = await import('../src/services/nex-marketplace/NEXMarketplace.js')
173
+ const marketplace = new NEXMarketplace()
174
+
175
+ if (options.all) {
176
+ const installed = await marketplace.list({ silent: true })
177
+ for (const agent of installed) {
178
+ await marketplace.update(agent.id)
179
+ }
180
+ } else if (agentId) {
181
+ await marketplace.update(agentId)
182
+ } else {
183
+ console.log(chalk.yellow('Especifique um agente ou use --all'))
184
+ }
185
+ })
186
+
187
+ // agent register
188
+ agentCmd
189
+ .command('register <agentId>')
190
+ .description('Registra um agente no NEX Hub para uso')
191
+ .action(async (agentId) => {
192
+ const { default: NEXMarketplace } = await import('../src/services/nex-marketplace/NEXMarketplace.js')
193
+ const marketplace = new NEXMarketplace()
194
+ await marketplace.register(agentId)
195
+ })
196
+
197
+ // agent my-agents
198
+ agentCmd
199
+ .command('my-agents')
200
+ .alias('registered')
201
+ .description('Lista agentes registrados no NEX Hub')
202
+ .action(async () => {
203
+ const { default: NEXMarketplace } = await import('../src/services/nex-marketplace/NEXMarketplace.js')
204
+ const marketplace = new NEXMarketplace()
205
+ await marketplace.listRegisteredAgents()
206
+ })
207
+
208
+ // Comando: store
209
+ program
210
+ .command('store')
211
+ .description('Interage com a NEX Store')
212
+ .option('browse', 'Abre a NEX Store no navegador')
213
+ .option('search <query>', 'Busca agentes na store')
214
+ .option('publish', 'Publica um agente na store')
215
+ .action(async (options) => {
216
+ if (options.browse) {
217
+ console.log(chalk.blue('🌐 Abrindo NEX Store...'))
218
+ // Abrir store
219
+ } else if (options.search) {
220
+ console.log(chalk.blue(`🔍 Buscando: ${options.search}`))
221
+ // Buscar agentes
222
+ } else if (options.publish) {
223
+ console.log(chalk.blue('📤 Publicando agente...'))
224
+ // Publicar agente
225
+ }
226
+ })
227
+
228
+ // Comando: workflow
229
+ program
230
+ .command('workflow')
231
+ .description('Executa workflows')
232
+ .option('list', 'Lista workflows disponíveis')
233
+ .option('run <workflow>', 'Executa um workflow')
234
+ .action(async (options) => {
235
+ if (options.list) {
236
+ console.log(chalk.blue('📋 Workflows disponíveis:'))
237
+ // Listar workflows
238
+ } else if (options.run) {
239
+ console.log(chalk.blue(`▶️ Executando workflow: ${options.run}`))
240
+ // Executar workflow
241
+ }
242
+ })
243
+
244
+ // Comando: config
245
+ program
246
+ .command('config')
247
+ .description('Gerencia configurações')
248
+ .option('get <key>', 'Obtém valor de configuração')
249
+ .option('set <key> <value>', 'Define valor de configuração')
250
+ .option('list', 'Lista todas as configurações')
251
+ .action(async (options) => {
252
+ if (options.get) {
253
+ // Obter configuração
254
+ } else if (options.set) {
255
+ // Definir configuração
256
+ } else if (options.list) {
257
+ // Listar configurações
258
+ }
259
+ })
260
+
261
+ // Funções auxiliares
262
+ async function createProjectStructure(projectName, template) {
263
+ const projectDir = path.join(process.cwd(), projectName)
264
+ await fs.ensureDir(projectDir)
265
+
266
+ // Criar estrutura básica
267
+ await fs.ensureDir(path.join(projectDir, 'src'))
268
+ await fs.ensureDir(path.join(projectDir, '.nex-core'))
269
+ await fs.ensureDir(path.join(projectDir, '.nex-core', 'agents'))
270
+ await fs.ensureDir(path.join(projectDir, '.nex-core', 'data'))
271
+ await fs.ensureDir(path.join(projectDir, '.nex-core', 'documents'))
272
+
273
+ // Criar package.json
274
+ const packageJson = {
275
+ name: projectName,
276
+ version: '1.0.0',
277
+ type: 'module',
278
+ scripts: {
279
+ start: 'node src/index.js',
280
+ dev: 'node --watch src/index.js'
281
+ }
282
+ }
283
+ await fs.writeJSON(path.join(projectDir, 'package.json'), packageJson, { spaces: 2 })
284
+
285
+ // Criar README
286
+ const readme = `# ${projectName}
287
+
288
+ Projeto criado com NEX Framework.
289
+
290
+ ## Getting Started
291
+
292
+ \`\`\`bash
293
+ npm install
294
+ npm start
295
+ \`\`\`
296
+ `
297
+ await fs.writeFile(path.join(projectDir, 'README.md'), readme)
298
+ }
299
+
300
+ async function promptRequirements() {
301
+ const answers = await inquirer.prompt([
302
+ {
303
+ type: 'input',
304
+ name: 'description',
305
+ message: 'Descreva o projeto:'
306
+ },
307
+ {
308
+ type: 'input',
309
+ name: 'features',
310
+ message: 'Liste as principais funcionalidades (separadas por vírgula):'
311
+ }
312
+ ])
313
+
314
+ return {
315
+ description: answers.description,
316
+ features: answers.features.split(',').map(f => f.trim())
317
+ }
318
+ }
319
+
320
+ program.parse(process.argv)
321
+
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "nex-framework-cli",
3
+ "version": "1.0.1",
4
+ "description": "NEX CLI - Command-line interface for NEX Framework and Agent Marketplace",
5
+ "type": "module",
6
+ "main": "cli/nex-cli.js",
7
+ "bin": {
8
+ "nex": "./cli/nex-cli.js"
9
+ },
10
+ "files": [
11
+ "cli/",
12
+ "src/services/nex-marketplace/",
13
+ "src/services/nex-installer/",
14
+ "registry/",
15
+ "README.md",
16
+ "LICENSE"
17
+ ],
18
+ "scripts": {
19
+ "prepublishOnly": "npm run test",
20
+ "test": "node cli/nex-cli.js --version"
21
+ },
22
+ "keywords": [
23
+ "nex",
24
+ "nex-cli",
25
+ "ai",
26
+ "agents",
27
+ "framework",
28
+ "marketplace",
29
+ "cli",
30
+ "command-line"
31
+ ],
32
+ "author": "INOSX (https://inosx.com)",
33
+ "license": "PROPRIETARY",
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://github.com/INOSX/nex-store.git"
37
+ },
38
+ "bugs": {
39
+ "url": "https://github.com/INOSX/nex-store/issues"
40
+ },
41
+ "homepage": "https://github.com/INOSX/nex-store#readme",
42
+ "engines": {
43
+ "node": ">=18.0.0"
44
+ },
45
+ "dependencies": {
46
+ "@supabase/supabase-js": "^2.39.0",
47
+ "chalk": "^5.3.0",
48
+ "commander": "^11.1.0",
49
+ "fs-extra": "^11.2.0",
50
+ "glob": "^10.3.10",
51
+ "inquirer": "^9.2.15",
52
+ "ora": "^8.0.1",
53
+ "semver": "^7.5.4",
54
+ "yaml": "^2.3.4"
55
+ }
56
+ }
@@ -0,0 +1,72 @@
1
+ # NEX Agent Registry Configuration
2
+ registry:
3
+ name: "NEX Expert Agent Marketplace"
4
+ version: "1.0.0"
5
+ type: hybrid # local + git + supabase
6
+ description: "Universal marketplace for NEX Framework agents"
7
+
8
+ # Paths
9
+ paths:
10
+ planning: ./planning
11
+ execution: ./execution
12
+ community: ./community
13
+ templates: ../templates/agent-template
14
+
15
+ # Remote sync
16
+ remote:
17
+ enabled: true
18
+ type: supabase
19
+ sync_on_install: true
20
+ auto_update_check: true
21
+
22
+ # Local configuration
23
+ local:
24
+ cache_enabled: true
25
+ cache_ttl_hours: 24
26
+ auto_compile: true
27
+
28
+ # Installation defaults
29
+ defaults:
30
+ install_location: .nex-core/agents
31
+ method: symlink # symlink, copy
32
+ backup_before_update: true
33
+ auto_dependency_install: true
34
+
35
+ # Security
36
+ security:
37
+ verify_manifests: true
38
+ allow_unsigned: false # Only for development
39
+ trusted_authors:
40
+ - INOSX
41
+ - nex-official
42
+ scan_code: true
43
+
44
+ # Analytics
45
+ analytics:
46
+ enabled: true
47
+ level: minimal # minimal, standard, detailed
48
+ anonymous: true
49
+
50
+ # Categories
51
+ categories:
52
+ planning:
53
+ - ANX # Analysis
54
+ - PMX # Product Management
55
+ - ARX # Architecture
56
+ - DVX # Development
57
+ - DOCX # Documentation
58
+ - QAX # Quality Assurance
59
+ - DEPX # Deployment
60
+ - MONX # Monitoring
61
+
62
+ execution:
63
+ - ORDX # Order/Validation
64
+ - FLX # Flow/Planning
65
+ - AGX # Action/Domain
66
+ - OPX # Technical/Specialized
67
+
68
+ # Store integration
69
+ store:
70
+ enabled: true
71
+ url: http://localhost:3000/store
72
+ api_url: http://localhost:3000/api/store
@@ -0,0 +1,181 @@
1
+ # 🏪 NEX Agent Registry
2
+
3
+ > Official & Community Agent Repository
4
+
5
+ Este é o registry oficial de agents do NEX Framework. Aqui você encontra agents oficiais da INOSX e agents da comunidade.
6
+
7
+ ## 📁 Estrutura
8
+
9
+ ```
10
+ registry/
11
+ ├── .meta/
12
+ │ └── registry.yaml # Configuração do registry
13
+
14
+ ├── planning/ # Agents de planejamento
15
+ │ ├── anx/ # Analysis Expert
16
+ │ ├── pmx/ # Product Management Expert
17
+ │ ├── arx/ # Architecture Expert
18
+ │ ├── dvx/ # Development Expert
19
+ │ ├── docx/ # Documentation Expert
20
+ │ ├── qax/ # Quality Assurance Expert
21
+ │ ├── depx/ # Deployment Expert
22
+ │ └── monx/ # Monitoring Expert
23
+
24
+ ├── execution/ # Agents de execução
25
+ │ ├── supervisor/ # Supervisor Agent
26
+ │ ├── voice-intent/ # Voice Intent Agent
27
+ │ └── ... # Outros 18 agents
28
+
29
+ ├── community/ # Agents da comunidade
30
+ │ └── ... # Submit via PR
31
+
32
+ └── .templates/ # Templates para novos agents
33
+ └── agent-template/
34
+ ```
35
+
36
+ ## 🎯 Agents Oficiais
37
+
38
+ ### 🔷 NEX Planning Agents (8)
39
+
40
+ | ID | Name | Category | Status |
41
+ |----|------|----------|--------|
42
+ | **anx** | Analysis Expert | FLX | ✅ Stable |
43
+ | **pmx** | Product Management Expert | FLX | ✅ Stable |
44
+ | **arx** | Architecture Expert | OPX | ✅ Stable |
45
+ | **dvx** | Development Expert | AGX | 🚧 Beta |
46
+ | **docx** | Documentation Expert | OPX | 🚧 Beta |
47
+ | **qax** | Quality Assurance Expert | ORDX | 🚧 Beta |
48
+ | **depx** | Deployment Expert | AGX | 🚧 Beta |
49
+ | **monx** | Monitoring Expert | ORDX | 🚧 Beta |
50
+
51
+ ### ⚡ NEX Execution Agents (18)
52
+
53
+ Ver [documentação completa](../DOCUMENTACAO_AGENTES_NEX.md) para lista de agents de execução.
54
+
55
+ ### 💎 BMAD Expert Agents (3) ⭐ NEW!
56
+
57
+ | ID | Name | Specialty | Status |
58
+ |----|------|-----------|--------|
59
+ | **vex** | The Conversion Hypnotist | CRO & Psychology | ✅ Stable |
60
+ | **ada** | The Analytics Oracle | Data & Insights | ✅ Stable |
61
+ | **rex** | The SEO Master | SEO & Growth | ✅ Stable |
62
+
63
+ **BMAD = Better Model for AI Development**
64
+
65
+ Agents especializados que funcionam em **Cursor + NEX**:
66
+ - 🎭 **VEX** - Conversion optimization (Cialdini + AIDA)
67
+ - 📊 **ADA** - Analytics intelligence (AARRR + NSM)
68
+ - 🔍 **REX** - SEO strategy (E-E-A-T + Topic Clusters)
69
+
70
+ [Ver documentação BMAD →](./bmad/README.md)
71
+
72
+ ## 🚀 Como Usar
73
+
74
+ ### Instalar NEX Agent
75
+
76
+ ```bash
77
+ nex agent install anx # Planning agent
78
+ nex agent install pmx # Product manager
79
+ ```
80
+
81
+ ### Instalar BMAD Agent
82
+
83
+ ```bash
84
+ nex agent install vex # Conversion expert
85
+ nex agent install ada # Analytics expert
86
+ nex agent install rex # SEO expert
87
+ ```
88
+
89
+ ### Buscar Agents
90
+
91
+ ```bash
92
+ nex agent search "planning" # NEX agents
93
+ nex agent search "" --category bmad # BMAD agents
94
+ ```
95
+
96
+ ### Ver Detalhes
97
+
98
+ ```bash
99
+ nex agent info anx # NEX agent
100
+ nex agent info vex # BMAD agent
101
+ ```
102
+
103
+ ## 📤 Submeter Agent
104
+
105
+ ### 1. Crie seu Agent
106
+
107
+ Use o template:
108
+
109
+ ```bash
110
+ cp -r .templates/agent-template community/my-agent
111
+ cd community/my-agent
112
+ ```
113
+
114
+ ### 2. Edite Manifest
115
+
116
+ Edite `manifest.yaml` com informações do seu agent.
117
+
118
+ ### 3. Adicione README
119
+
120
+ Documente seu agent em `README.md`.
121
+
122
+ ### 4. Teste Localmente
123
+
124
+ ```bash
125
+ nex agent install my-agent
126
+ nex agent info my-agent
127
+ ```
128
+
129
+ ### 5. Submit Pull Request
130
+
131
+ ```bash
132
+ git checkout -b add-my-agent
133
+ git add registry/community/my-agent/
134
+ git commit -m "Add: My Agent - Does X Y Z"
135
+ git push origin add-my-agent
136
+ ```
137
+
138
+ Abra PR no GitHub!
139
+
140
+ ## 📋 Requisitos para Aprovação
141
+
142
+ ✅ **Obrigatório:**
143
+ - [ ] `manifest.yaml` completo e válido
144
+ - [ ] `README.md` com documentação clara
145
+ - [ ] Código sem vulnerabilidades
146
+ - [ ] Testes passando (se aplicável)
147
+ - [ ] Licença especificada
148
+
149
+ 🌟 **Recomendado:**
150
+ - [ ] `CHANGELOG.md` com histórico
151
+ - [ ] Screenshots ou demos
152
+ - [ ] Exemplos de uso
153
+ - [ ] Testes unitários
154
+
155
+ ## 🔐 Segurança
156
+
157
+ Todos os agents passam por:
158
+ - ✅ Code scanning automático
159
+ - ✅ Dependency vulnerability check
160
+ - ✅ Manual review (agents comunitários)
161
+ - ✅ Sandbox testing
162
+
163
+ ## 📊 Stats
164
+
165
+ - **Total Agents**: 26+
166
+ - **Official**: 26
167
+ - **Community**: 0+ (aceita contribuições!)
168
+ - **Total Installs**: Tracking via Supabase
169
+
170
+ ## 🤝 Contribua
171
+
172
+ Veja nosso [guia de contribuição](../docs/NEX_AGENT_MARKETPLACE.md#contribuindo).
173
+
174
+ ## 📄 Licença
175
+
176
+ - **Agents Oficiais**: Proprietary (INOSX)
177
+ - **Agents Comunitários**: Conforme licença de cada agent
178
+
179
+ ---
180
+
181
+ **Registry mantido por [INOSX](https://inosx.com)**