@paulojalowyj/openkit 0.2.0 → 0.2.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/README.md CHANGED
@@ -27,9 +27,12 @@ npx @paulojalowyj/openkit init
27
27
  npx @paulojalowyj/openkit init --blueprint fullstack
28
28
 
29
29
  # Use the OpenCode Framework
30
- # (restart OpenCode TUI and use / commands)
30
+ # (run opencode in your project and use / commands)
31
+ opencode
31
32
  ```
32
33
 
34
+ > **Important:** Use `npx` to run OpenKit commands. Do not install OpenKit as a project dependency (`npm install @paulojalowyj/openkit`). OpenKit is a CLI tool, not a runtime library.
35
+
33
36
  ## Upgrade
34
37
 
35
38
  ```bash
package/README.pt-BR.md CHANGED
@@ -27,8 +27,11 @@ npx @paulojalowyj/openkit init --blueprint fullstack
27
27
 
28
28
  # Usar o OpenKit
29
29
  # (execute `opencode` no seu projeto e use os comandos /)
30
+ opencode
30
31
  ```
31
32
 
33
+ > **Importante:** Use `npx` para executar comandos do OpenKit. Não instale o OpenKit como dependência do projeto (`npm install @paulojalowyj/openkit`). OpenKit é uma ferramenta CLI, não uma biblioteca de runtime.
34
+
32
35
  ## Upgrade
33
36
 
34
37
  ```bash
package/bin/cli.js CHANGED
@@ -375,7 +375,7 @@ async function copyBlueprint(blueprintName, targetDir, replacements) {
375
375
  program
376
376
  .name('openkit')
377
377
  .description('OpenKit - OpenCode Agent System in your project')
378
- .version('0.2.0');
378
+ .version('0.2.1');
379
379
 
380
380
  program
381
381
  .command('init')
@@ -482,18 +482,37 @@ program
482
482
  }
483
483
 
484
484
  console.log('');
485
- console.log(chalk.green(' Successfully initialized OpenCode!'));
486
- console.log(chalk.cyan('\n Next steps:'));
487
- console.log(' 1. Restart OpenCode TUI');
488
- console.log(' 2. Use /engineer, /plan, /debug, and other commands');
485
+ console.log(chalk.green('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
486
+ console.log(chalk.green(' OpenKit installed successfully!'));
487
+ console.log(chalk.green('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
488
+ console.log('');
489
+ console.log(chalk.cyan(' Next steps:'));
490
+ console.log('');
491
+ console.log(chalk.white(' 1. Start OpenCode in your project:'));
492
+ console.log(chalk.yellow(' opencode'));
493
+ console.log('');
494
+ console.log(chalk.white(' 2. Use available commands:'));
495
+ console.log(chalk.gray(' /engineer - Universal builder with planning'));
496
+ console.log(chalk.gray(' /plan - Create implementation plan'));
497
+ console.log(chalk.gray(' /impl - Implement features'));
498
+ console.log(chalk.gray(' /test - Run tests'));
499
+ console.log(chalk.gray(' /debug - Systematic debugging'));
489
500
 
490
501
  if (options.blueprint) {
491
502
  console.log('');
492
- console.log(chalk.cyan('Development:'));
493
- console.log(' 1. Start services: docker compose -f docker-compose.dev.yml up -d');
494
- console.log(' 2. Access backend: http://localhost:8000');
495
- console.log(' 3. Access frontend: http://localhost:5173');
503
+ console.log(chalk.cyan(' Development environment:'));
504
+ console.log('');
505
+ console.log(chalk.white(' 1. Start services:'));
506
+ console.log(chalk.yellow(' docker compose -f docker-compose.dev.yml up -d'));
507
+ console.log('');
508
+ console.log(chalk.white(' 2. Access application:'));
509
+ console.log(chalk.gray(' Backend: http://localhost:8000'));
510
+ console.log(chalk.gray(' Frontend: http://localhost:5173'));
511
+ console.log(chalk.gray(' API Docs: http://localhost:8000/docs'));
496
512
  }
513
+
514
+ console.log('');
515
+ console.log(chalk.green('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
497
516
  console.log('');
498
517
  });
499
518
 
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { join } from 'path';
4
+ import { existsSync, readFileSync } from 'fs';
5
+
6
+ // ANSI color codes (sem dependências externas)
7
+ const colors = {
8
+ reset: '\x1b[0m',
9
+ yellow: '\x1b[33m',
10
+ white: '\x1b[37m',
11
+ cyan: '\x1b[36m',
12
+ gray: '\x1b[90m'
13
+ };
14
+
15
+ // Detectar se está sendo instalado como dependência via npm env vars
16
+ // INIT_CWD = diretório onde o usuário executou npm install
17
+ const initCwd = process.env.INIT_CWD;
18
+
19
+ // Se não temos INIT_CWD, provavelmente é desenvolvimento ou npx
20
+ if (!initCwd) {
21
+ process.exit(0);
22
+ }
23
+
24
+ // Caminho do package.json do projeto pai (onde npm install foi executado)
25
+ const parentPackageJson = join(initCwd, 'package.json');
26
+
27
+ // Ler o package.json do projeto pai
28
+ if (!existsSync(parentPackageJson)) {
29
+ process.exit(0);
30
+ }
31
+
32
+ try {
33
+ const pkg = JSON.parse(readFileSync(parentPackageJson, 'utf8'));
34
+ const hasOpenKit =
35
+ pkg.dependencies?.['@paulojalowyj/openkit'] ||
36
+ pkg.devDependencies?.['@paulojalowyj/openkit'];
37
+
38
+ if (hasOpenKit) {
39
+ console.error('');
40
+ console.error(`${colors.yellow}OpenKit detected as a project dependency${colors.reset}`);
41
+ console.error('');
42
+ console.error(`${colors.white}OpenKit does not need to be in your project's package.json.${colors.reset}`);
43
+ console.error(`${colors.white}The recommended way is to use npx directly:${colors.reset}`);
44
+ console.error('');
45
+ console.error(`${colors.cyan} # Install OpenKit in your project${colors.reset}`);
46
+ console.error(`${colors.cyan} npx @paulojalowyj/openkit init${colors.reset}`);
47
+ console.error('');
48
+ console.error(`${colors.cyan} # Upgrade OpenKit${colors.reset}`);
49
+ console.error(`${colors.cyan} npx @paulojalowyj/openkit upgrade${colors.reset}`);
50
+ console.error('');
51
+ console.error(`${colors.cyan} # Start OpenCode in your project${colors.reset}`);
52
+ console.error(`${colors.cyan} opencode${colors.reset}`);
53
+ console.error('');
54
+ console.error(`${colors.gray}To remove the dependency: npm uninstall @paulojalowyj/openkit${colors.reset}`);
55
+ console.error('');
56
+ }
57
+ } catch (error) {
58
+ // Erro ao ler package.json, sair silenciosamente
59
+ process.exit(0);
60
+ }
package/index.js CHANGED
@@ -1,14 +1,28 @@
1
1
  /**
2
- * Opencode GLMs - Entry Point
2
+ * OpenKit - Entry Point
3
+ *
4
+ * OpenKit should not be imported as a module.
5
+ *
6
+ * Use the CLI via npx:
7
+ * npx @paulojalowyj/openkit init
8
+ * npx @paulojalowyj/openkit upgrade
9
+ *
10
+ * Documentation: https://github.com/paulojalowyj/openkit
3
11
  */
4
12
 
5
- const path = require('path');
6
- const pkg = require('./package.json');
13
+ console.error(`
14
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
+ OpenKit should not be imported as a module
7
16
 
8
- module.exports = {
9
- name: pkg.name,
10
- version: pkg.version,
11
- description: pkg.description,
12
- bin: path.resolve(__dirname, 'bin', 'cli.js'),
13
- template: path.dirname(__dirname),
14
- };
17
+ OpenKit is a CLI tool, not a code library.
18
+
19
+ Use via npx:
20
+ npx @paulojalowyj/openkit init # Install in project
21
+ npx @paulojalowyj/openkit upgrade # Upgrade framework
22
+ opencode # Start OpenCode
23
+
24
+ Documentation: https://github.com/paulojalowyj/openkit
25
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
26
+ `);
27
+
28
+ process.exit(1);
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@paulojalowyj/openkit",
4
- "version": "0.2.0",
5
- "description": "OpenKit - OpenCode Agent System - 15 specialized prompts, 33+ skills, validation scripts\n\nQuick Start:\n1. Install: npx @paulojalowyj/openkit init\n2. Start OpenCode: opencode\n3. Use workflows: /engineer, /plan, /impl, /test\n\nDocumentation: https://opencode.ai/docs",
4
+ "version": "0.2.1",
5
+ "description": "Use 'npx @paulojalowyj/openkit init' (not npm install). OpenKit is a CLI tool for OpenCode Agent System - 15 specialized agents, 33+ skills, validation scripts.\n\nQuick Start:\n1. Install: npx @paulojalowyj/openkit init\n2. Start OpenCode: opencode\n3. Use workflows: /engineer, /plan, /impl, /test\n\nDocumentation: https://opencode.ai/docs",
6
6
  "main": "index.js",
7
7
  "bin": {
8
8
  "openkit": "bin/cli.js"
9
9
  },
10
10
  "scripts": {
11
+ "postinstall": "node bin/postinstall-check.js",
11
12
  "init": "node bin/cli.js init",
12
13
  "doctor": "node bin/cli.js doctor",
13
14
  "test": "node --test test/*.test.js",
@@ -16,6 +17,7 @@
16
17
  },
17
18
  "files": [
18
19
  "bin",
20
+ "index.js",
19
21
  ".opencode",
20
22
  "opencode.json",
21
23
  "blueprints",
@@ -26,6 +28,9 @@
26
28
  "README.pt-BR.md"
27
29
  ],
28
30
  "keywords": [
31
+ "cli-tool",
32
+ "npx-only",
33
+ "no-install-needed",
29
34
  "ai",
30
35
  "agents",
31
36
  "opencode",