create-ombutocode 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/bin/create-ombutocode.js +170 -0
- package/package.json +31 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { execSync } = require('child_process');
|
|
6
|
+
|
|
7
|
+
const REPO_URL = 'https://github.com/FrancoisBotha/ombutocode.git';
|
|
8
|
+
const VERSION = '1.0.0';
|
|
9
|
+
|
|
10
|
+
// ── Helpers ──
|
|
11
|
+
|
|
12
|
+
function log(msg) { console.log(` ${msg}`); }
|
|
13
|
+
function heading(msg) { console.log(`\n── ${msg} ──`); }
|
|
14
|
+
|
|
15
|
+
function fatal(msg) {
|
|
16
|
+
console.error(`\n✖ ${msg}`);
|
|
17
|
+
process.exit(1);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function run(cmd, opts = {}) {
|
|
21
|
+
try {
|
|
22
|
+
execSync(cmd, { stdio: 'inherit', ...opts });
|
|
23
|
+
} catch {
|
|
24
|
+
fatal(`Command failed: ${cmd}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function copyDirSync(src, dest) {
|
|
29
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
30
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
31
|
+
const srcPath = path.join(src, entry.name);
|
|
32
|
+
const destPath = path.join(dest, entry.name);
|
|
33
|
+
if (entry.isDirectory()) {
|
|
34
|
+
copyDirSync(srcPath, destPath);
|
|
35
|
+
} else {
|
|
36
|
+
fs.copyFileSync(srcPath, destPath);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ── CLI ──
|
|
42
|
+
|
|
43
|
+
const args = process.argv.slice(2);
|
|
44
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
45
|
+
console.log(`
|
|
46
|
+
create-ombutocode v${VERSION}
|
|
47
|
+
|
|
48
|
+
Create a new Ombuto Code project — Agentic Software Engineering Workbench
|
|
49
|
+
|
|
50
|
+
Usage:
|
|
51
|
+
npx create-ombutocode <project-name>
|
|
52
|
+
|
|
53
|
+
Example:
|
|
54
|
+
npx create-ombutocode my-app
|
|
55
|
+
cd my-app
|
|
56
|
+
.ombutocode/buildandrun.bat # Windows
|
|
57
|
+
bash .ombutocode/buildandrun # macOS / Linux
|
|
58
|
+
`);
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const projectName = args[0];
|
|
63
|
+
if (!projectName) {
|
|
64
|
+
fatal('Please specify a project name:\n\n npx create-ombutocode my-app\n');
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (fs.existsSync(projectName)) {
|
|
68
|
+
fatal(`Directory "${projectName}" already exists.`);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// ── Banner ──
|
|
72
|
+
|
|
73
|
+
console.log(`
|
|
74
|
+
╔═══════════════════════════════════════════╗
|
|
75
|
+
║ create-ombutocode v${VERSION} ║
|
|
76
|
+
║ Agentic Software Engineering Workbench ║
|
|
77
|
+
╚═══════════════════════════════════════════╝
|
|
78
|
+
`);
|
|
79
|
+
|
|
80
|
+
console.log(`Creating project: ${projectName}`);
|
|
81
|
+
|
|
82
|
+
// ── Step 1: Clone the repository ──
|
|
83
|
+
|
|
84
|
+
heading('Cloning Ombuto Code repository');
|
|
85
|
+
run(`git clone --depth 1 ${REPO_URL} "${projectName}"`);
|
|
86
|
+
|
|
87
|
+
const projectDir = path.resolve(projectName);
|
|
88
|
+
|
|
89
|
+
// Remove the .git directory so the user starts fresh
|
|
90
|
+
const gitDir = path.join(projectDir, '.git');
|
|
91
|
+
if (fs.existsSync(gitDir)) {
|
|
92
|
+
log('Removing upstream .git history...');
|
|
93
|
+
fs.rmSync(gitDir, { recursive: true, force: true });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Remove create-ombutocode directory (the installer itself)
|
|
97
|
+
const installerDir = path.join(projectDir, 'create-ombutocode');
|
|
98
|
+
if (fs.existsSync(installerDir)) {
|
|
99
|
+
log('Removing installer package...');
|
|
100
|
+
fs.rmSync(installerDir, { recursive: true, force: true });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// ── Step 2: Install dependencies ──
|
|
104
|
+
|
|
105
|
+
heading('Installing dependencies');
|
|
106
|
+
const srcDir = path.join(projectDir, '.ombutocode', 'src');
|
|
107
|
+
if (fs.existsSync(path.join(srcDir, 'package.json'))) {
|
|
108
|
+
run('npm install --no-audit --no-fund', { cwd: srcDir });
|
|
109
|
+
} else {
|
|
110
|
+
fatal('.ombutocode/src/package.json not found — repository may be corrupted.');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// ── Step 3: Initialise project data ──
|
|
114
|
+
|
|
115
|
+
heading('Initialising project');
|
|
116
|
+
|
|
117
|
+
// Run initombuto with --clear to create fresh docs/
|
|
118
|
+
const isWindows = process.platform === 'win32';
|
|
119
|
+
const initScript = path.join(projectDir, '.ombutocode', isWindows ? 'initombuto.bat' : 'initombuto');
|
|
120
|
+
|
|
121
|
+
if (fs.existsSync(initScript)) {
|
|
122
|
+
if (isWindows) {
|
|
123
|
+
run(`"${initScript}" --clear "${projectDir}"`, { cwd: projectDir });
|
|
124
|
+
} else {
|
|
125
|
+
// Ensure executable
|
|
126
|
+
try { fs.chmodSync(initScript, 0o755); } catch {}
|
|
127
|
+
run(`bash "${initScript}" --clear "${projectDir}"`, { cwd: projectDir });
|
|
128
|
+
}
|
|
129
|
+
} else {
|
|
130
|
+
log('initombuto script not found — creating docs/ structure manually...');
|
|
131
|
+
const dirs = [
|
|
132
|
+
'Structure', 'Product Requirements Document', 'Architecture',
|
|
133
|
+
'Functional Requirements', 'Non-Functional Requirements', 'Epics',
|
|
134
|
+
'Use Cases', 'Use Case Diagrams', 'Class Diagrams', 'Data Model',
|
|
135
|
+
'Style Guide', 'Mockups', 'References', 'Skills', 'ScratchPad'
|
|
136
|
+
];
|
|
137
|
+
for (const dir of dirs) {
|
|
138
|
+
fs.mkdirSync(path.join(projectDir, 'docs', dir), { recursive: true });
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ── Step 4: Initialise git ──
|
|
143
|
+
|
|
144
|
+
heading('Initialising Git repository');
|
|
145
|
+
run('git init', { cwd: projectDir });
|
|
146
|
+
run('git add -A', { cwd: projectDir });
|
|
147
|
+
run('git commit -m "Initial commit — Ombuto Code project"', { cwd: projectDir });
|
|
148
|
+
|
|
149
|
+
// ── Done ──
|
|
150
|
+
|
|
151
|
+
console.log(`
|
|
152
|
+
╔═══════════════════════════════════════════╗
|
|
153
|
+
║ Project ready! ║
|
|
154
|
+
╚═══════════════════════════════════════════╝
|
|
155
|
+
|
|
156
|
+
cd ${projectName}
|
|
157
|
+
|
|
158
|
+
# Run Ombuto Code:
|
|
159
|
+
.ombutocode/buildandrun.bat # Windows
|
|
160
|
+
bash .ombutocode/buildandrun # macOS / Linux
|
|
161
|
+
|
|
162
|
+
# Or manually:
|
|
163
|
+
cd .ombutocode/src
|
|
164
|
+
npx vite build && npx electron .
|
|
165
|
+
|
|
166
|
+
# Configure coding agents in Settings → Coding Agents.
|
|
167
|
+
# See the README for more details.
|
|
168
|
+
|
|
169
|
+
Happy building!
|
|
170
|
+
`);
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-ombutocode",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Create a new Ombuto Code project — Agentic Software Engineering Workbench",
|
|
5
|
+
"author": "Francois Botha",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"bin": {
|
|
8
|
+
"create-ombutocode": "bin/create-ombutocode.js"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"ombuto",
|
|
12
|
+
"ombutocode",
|
|
13
|
+
"agentic",
|
|
14
|
+
"ai",
|
|
15
|
+
"coding",
|
|
16
|
+
"workbench",
|
|
17
|
+
"electron",
|
|
18
|
+
"vue"
|
|
19
|
+
],
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/FrancoisBotha/ombutocode.git"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"bin/",
|
|
26
|
+
"template/"
|
|
27
|
+
],
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=18"
|
|
30
|
+
}
|
|
31
|
+
}
|