create-org-studio 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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +47 -0
  3. package/index.js +152 -0
  4. package/package.json +20 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Org Studio Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # create-org-studio
2
+
3
+ Scaffold a new [Org Studio](https://orgstudio.dev) instance — Org Design for AI Agents.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npx create-org-studio@latest
9
+ ```
10
+
11
+ Or with a custom directory name:
12
+
13
+ ```bash
14
+ npx create-org-studio@latest my-team
15
+ ```
16
+
17
+ ## What it does
18
+
19
+ 1. Clones the latest Org Studio from GitHub
20
+ 2. Generates a secure API key
21
+ 3. Creates `.env.local` with defaults
22
+ 4. Installs dependencies
23
+ 5. Builds the project
24
+
25
+ After setup, run:
26
+
27
+ ```bash
28
+ cd org-studio
29
+ npm start
30
+ ```
31
+
32
+ Open http://localhost:4501 to get started.
33
+
34
+ ## Requirements
35
+
36
+ - Node.js 18+
37
+ - git
38
+
39
+ ## Documentation
40
+
41
+ - Website: [orgstudio.dev](https://orgstudio.dev)
42
+ - GitHub: [ToomeSauce/org-studio](https://github.com/ToomeSauce/org-studio)
43
+ - Guide: [docs/guide.md](https://github.com/ToomeSauce/org-studio/blob/main/docs/guide.md)
44
+
45
+ ## License
46
+
47
+ MIT
package/index.js ADDED
@@ -0,0 +1,152 @@
1
+ #!/usr/bin/env node
2
+
3
+ // create-org-studio — scaffold a new Org Studio instance
4
+ // Usage: npx create-org-studio@latest [directory-name]
5
+
6
+ const { execSync } = require('child_process');
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+ const crypto = require('crypto');
10
+
11
+ const REPO_URL = 'https://github.com/ToomeSauce/org-studio.git';
12
+
13
+ const bold = (s) => `\x1b[1m${s}\x1b[0m`;
14
+ const green = (s) => `\x1b[32m${s}\x1b[0m`;
15
+ const cyan = (s) => `\x1b[36m${s}\x1b[0m`;
16
+ const red = (s) => `\x1b[31m${s}\x1b[0m`;
17
+ const dim = (s) => `\x1b[2m${s}\x1b[0m`;
18
+
19
+ function main() {
20
+ const args = process.argv.slice(2);
21
+ const dirName = args[0] || 'org-studio';
22
+
23
+ if (args.includes('--help') || args.includes('-h')) {
24
+ console.log(`
25
+ ${bold('create-org-studio')} — Org Design for AI Agents
26
+
27
+ ${bold('Usage:')}
28
+ npx create-org-studio@latest [directory]
29
+
30
+ ${bold('Options:')}
31
+ --help, -h Show this help message
32
+
33
+ ${bold('Examples:')}
34
+ npx create-org-studio@latest
35
+ npx create-org-studio@latest my-team
36
+ npx create-org-studio@latest ./projects/org-studio
37
+
38
+ ${bold('Docs:')} https://orgstudio.dev
39
+ ${bold('GitHub:')} https://github.com/ToomeSauce/org-studio
40
+ `);
41
+ process.exit(0);
42
+ }
43
+
44
+ const targetDir = path.resolve(process.cwd(), dirName);
45
+
46
+ console.log('');
47
+ console.log(bold('⚛️ create-org-studio'));
48
+ console.log(dim(' Org Design for AI Agents'));
49
+ console.log('');
50
+
51
+ // Check if directory already exists and is not empty
52
+ if (fs.existsSync(targetDir)) {
53
+ const files = fs.readdirSync(targetDir);
54
+ if (files.length > 0) {
55
+ console.log(red(`Error: Directory "${dirName}" already exists and is not empty.`));
56
+ console.log(dim(` Try: npx create-org-studio@latest ${dirName}-2`));
57
+ process.exit(1);
58
+ }
59
+ }
60
+
61
+ // Check git
62
+ try {
63
+ execSync('git --version', { stdio: 'ignore' });
64
+ } catch {
65
+ console.log(red('Error: git is required but not found in PATH.'));
66
+ process.exit(1);
67
+ }
68
+
69
+ // Check Node version
70
+ const nodeVersion = parseInt(process.versions.node.split('.')[0]);
71
+ if (nodeVersion < 18) {
72
+ console.log(red(`Error: Node.js 18+ required (found ${process.versions.node}).`));
73
+ process.exit(1);
74
+ }
75
+
76
+ // Clone
77
+ console.log(`${cyan('→')} Cloning Org Studio into ${bold(dirName)}...`);
78
+ try {
79
+ execSync(`git clone --depth 1 ${REPO_URL} "${targetDir}"`, { stdio: 'inherit' });
80
+ } catch {
81
+ console.log(red('Error: Failed to clone repository.'));
82
+ process.exit(1);
83
+ }
84
+
85
+ // Remove .git and start fresh
86
+ const gitDir = path.join(targetDir, '.git');
87
+ if (fs.existsSync(gitDir)) {
88
+ fs.rmSync(gitDir, { recursive: true, force: true });
89
+ }
90
+
91
+ console.log(`${cyan('→')} Initializing git repository...`);
92
+ execSync('git init', { cwd: targetDir, stdio: 'ignore' });
93
+
94
+ // Generate API key
95
+ const apiKey = crypto.randomBytes(16).toString('hex');
96
+
97
+ // Create .env.local
98
+ console.log(`${cyan('→')} Creating .env.local with generated API key...`);
99
+ const envContent = `# Org Studio Configuration
100
+
101
+ # API key for store mutations (required for agent writes)
102
+ ORG_STUDIO_API_KEY=${apiKey}
103
+
104
+ # PostgreSQL (optional — uses local file storage by default)
105
+ # DATABASE_URL=postgresql://user:pass@host:5432/org_studio_db?sslmode=require
106
+
107
+ # OpenClaw Gateway (optional — auto-detected on default port)
108
+ # GATEWAY_URL=ws://127.0.0.1:18789
109
+ # GATEWAY_TOKEN=your-gateway-token
110
+ `;
111
+ fs.writeFileSync(path.join(targetDir, '.env.local'), envContent);
112
+
113
+ // Install
114
+ console.log(`${cyan('→')} Installing dependencies...`);
115
+ try {
116
+ execSync('npm install', { cwd: targetDir, stdio: 'inherit' });
117
+ } catch {
118
+ console.log(red('Warning: npm install failed. You can retry manually.'));
119
+ }
120
+
121
+ // Build
122
+ console.log(`${cyan('→')} Building...`);
123
+ try {
124
+ execSync('npm run build', { cwd: targetDir, stdio: 'inherit' });
125
+ } catch {
126
+ console.log(red('Warning: Build failed. You can retry with `npm run build`.'));
127
+ }
128
+
129
+ // Initial commit
130
+ try {
131
+ execSync('git add -A && git commit -m "Initial Org Studio setup"', {
132
+ cwd: targetDir,
133
+ stdio: 'ignore',
134
+ });
135
+ } catch {
136
+ // Non-critical
137
+ }
138
+
139
+ // Done
140
+ console.log('');
141
+ console.log(green('✓ Org Studio is ready!'));
142
+ console.log('');
143
+ console.log(` ${cyan('cd')} ${dirName}`);
144
+ console.log(` ${cyan('npm start')} ${dim('→ http://localhost:4501')}`);
145
+ console.log('');
146
+ console.log(` ${dim('API Key:')} ${apiKey}`);
147
+ console.log(` ${dim('Docs:')} https://orgstudio.dev`);
148
+ console.log(` ${dim('GitHub:')} https://github.com/ToomeSauce/org-studio`);
149
+ console.log('');
150
+ }
151
+
152
+ main();
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "create-org-studio",
3
+ "version": "1.0.0",
4
+ "description": "Create a new Org Studio instance — org design for AI agents",
5
+ "bin": {
6
+ "create-org-studio": "./index.js"
7
+ },
8
+ "files": ["index.js", "README.md", "LICENSE"],
9
+ "keywords": ["org-studio", "ai-agents", "agent-management", "org-design", "autonomous-teams"],
10
+ "author": "ToomeSauce",
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "https://github.com/ToomeSauce/org-studio"
15
+ },
16
+ "homepage": "https://orgstudio.dev",
17
+ "engines": {
18
+ "node": ">=18"
19
+ }
20
+ }