@1mancompany/onemancompany 0.1.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/LICENSE +201 -0
- package/README.md +412 -0
- package/bin/cli.js +435 -0
- package/package.json +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="img/omc.png" alt="OneManCompany" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<h1 align="center">OneManCompany</h1>
|
|
8
|
+
|
|
9
|
+
<p align="center"><b>The AI Operating System for One-Person Companies</b></p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="README_zh.md">中文文档</a> · <a href="https://carbonkites.com">Talent Market</a> · <a href="https://github.com/1mancompany/OneManCompany/issues">Issues</a>
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
> Others use AI to write code. You use AI to run a company.
|
|
16
|
+
>
|
|
17
|
+
> Linux runs servers. OneManCompany runs companies.
|
|
18
|
+
>
|
|
19
|
+
> Not building a company — building any company.
|
|
20
|
+
|
|
21
|
+
OneManCompany is an open-source OS that lets anyone build and run a complete AI-powered company from their browser.
|
|
22
|
+
|
|
23
|
+
**You are the CEO — the only human.** Everyone else — HR, COO, engineers, designers — are AI employees that think, collaborate, and deliver real work autonomously. (*No slacking, no sick days, no raise requests — just the occasional need for a pep talk.*)
|
|
24
|
+
|
|
25
|
+
🏢 **Real company, not a chatbot**: *Interview, review, promote the few — fire the ones who haven't got a clue.* Yes, your AI employees get nervous.
|
|
26
|
+
|
|
27
|
+
📈 **Gets smarter with use**: *Your team forgets nothing — even the AI employees it forgets.* Every retrospective and 1-on-1 becomes lasting experience. Tell them once, they learn. Tell them twice, they remember. Still no good? Replace them — the next one already heard what happened to the last one.
|
|
28
|
+
|
|
29
|
+
🛡️ **No more hallucination roulette**: *Download counts and real reviews don't lie — trust the community.* Tired of AI that talks big and delivers nothing? We ship with a **[Talent Market](https://carbonkites.com)** of community-verified AI employees.
|
|
30
|
+
|
|
31
|
+
⚙️ **An OS, not just a product**: *Swap the plan, swap the clan — brand new company in your hand.* One runtime abstracts away AI differences. Skills install like phone apps.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx @carbonkite/onemancompany
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
> One command. A full AI company in your browser. No Python, no Docker, no config — just run it.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Features
|
|
42
|
+
|
|
43
|
+
<table>
|
|
44
|
+
<tr>
|
|
45
|
+
<td width="33%">
|
|
46
|
+
<h3>🏢 Pixel-Art Office</h3>
|
|
47
|
+
Open your browser to a retro office. Your AI employees sit at their desks, work on tasks, and hold meetings — all visualized in real time.
|
|
48
|
+
</td>
|
|
49
|
+
<td width="33%">
|
|
50
|
+
<h3>🤝 Multi-Agent Meetings</h3>
|
|
51
|
+
Employees pull each other into meetings to align — no babysitting needed. Want to micromanage? Join the meeting and steer it yourself.
|
|
52
|
+
</td>
|
|
53
|
+
<td width="33%">
|
|
54
|
+
<h3>🔍 Your Level of Control</h3>
|
|
55
|
+
Hands-off? Just review the final result. Hands-on? Join discussions, review every diff, coach employees mid-task. You choose the granularity — from "just show me results" to full micromanagement.
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
<tr>
|
|
59
|
+
<td>
|
|
60
|
+
<h3>🏪 Talent Market</h3>
|
|
61
|
+
Not another "bring your own agent" framework. HR searches a community-verified marketplace, interviews candidates, and onboards them — you just say "I need a designer."
|
|
62
|
+
</td>
|
|
63
|
+
<td>
|
|
64
|
+
<h3>🧠 1-on-1 Coaching</h3>
|
|
65
|
+
Not a one-off prompt tweak. Sit down with an employee, explain what you want — it becomes permanent work experience. Next task, they already know your standards.
|
|
66
|
+
</td>
|
|
67
|
+
<td>
|
|
68
|
+
<h3>📊 Performance Reviews</h3>
|
|
69
|
+
Quarterly evaluations with real consequences. Probation, PIP, promotion — or termination. Your AI employees know the stakes. Yes, they get nervous.
|
|
70
|
+
</td>
|
|
71
|
+
</tr>
|
|
72
|
+
<tr>
|
|
73
|
+
<td>
|
|
74
|
+
<h3>🔁 Iteration Management</h3>
|
|
75
|
+
V1 → V2 → V3 → "actually, let's go back to V1." Sound familiar? Every project has structured version control with full history. Your team iterates until you're happy — or until you realize the first draft was right all along.
|
|
76
|
+
</td>
|
|
77
|
+
<td>
|
|
78
|
+
<h3>👔 Hire & Fire</h3>
|
|
79
|
+
One click to hire from the Talent Market. Not performing? Coach them, PIP them, or fire them — the next one will be better.
|
|
80
|
+
</td>
|
|
81
|
+
<td>
|
|
82
|
+
<h3>🔄 Self-Evolution</h3>
|
|
83
|
+
Employees grow through coaching, sharpen through retrospectives, and become legends through project after project. The org evolves too — repeated tasks auto-distill into workflows that only get smoother.
|
|
84
|
+
</td>
|
|
85
|
+
</tr>
|
|
86
|
+
</table>
|
|
87
|
+
|
|
88
|
+
<p align="center">
|
|
89
|
+
<img src="img/task_tree.jpg" alt="OneManCompany — Task Tree" width="80%" />
|
|
90
|
+
<br><i>Hierarchical task breakdown — CEO delegates, AI employees execute.</i>
|
|
91
|
+
</p>
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## How It Works
|
|
96
|
+
|
|
97
|
+
You open a browser. You see a pixel-art office. Your AI employees are at their desks, pretending to look busy.
|
|
98
|
+
|
|
99
|
+
You type: *"Build a puzzle game for mobile"*
|
|
100
|
+
|
|
101
|
+
1. Your **EA** receives the task and routes it
|
|
102
|
+
2. Your **COO** breaks it down and dispatches subtasks
|
|
103
|
+
3. Engineers, designers, and QA **work autonomously**
|
|
104
|
+
4. They hold **meetings** to align when needed
|
|
105
|
+
5. Work goes through **review, iteration, and quality gates**
|
|
106
|
+
6. You get notified and approve the final result
|
|
107
|
+
|
|
108
|
+
**You manage. AI executes.**
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
CEO (You, the only human who gets coffee breaks)
|
|
112
|
+
└── EA ── routes tasks, quality gate
|
|
113
|
+
├── HR ── hiring, performance reviews, promotions
|
|
114
|
+
├── COO ── operations, task dispatch, acceptance
|
|
115
|
+
│ ├── Engineer (AI) ← hired from Talent Market
|
|
116
|
+
│ ├── Designer (AI) ← hired from Talent Market
|
|
117
|
+
│ └── QA (AI) ← hired from Talent Market
|
|
118
|
+
└── CSO ── sales, client relations
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Founding team (EA, HR, COO, CSO)** comes built-in. Need more people? HR searches the **Talent Market** — a community-verified marketplace of AI employees.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## What You Can Build
|
|
126
|
+
|
|
127
|
+
| AI Company | What It Delivers |
|
|
128
|
+
| -------------------- | ----------------------------------------------------------------- |
|
|
129
|
+
| 🎮 AI Game Studio | Production-grade games with full playtesting and iteration cycles |
|
|
130
|
+
| 📖 AI Manga Studio | Serialized comic stories with consistent art and narrative |
|
|
131
|
+
| 💻 AI Dev Agency | Ship software products end-to-end |
|
|
132
|
+
| 🎨 AI Content Studio | Marketing campaigns, branded content, and media production |
|
|
133
|
+
| 🔬 AI Research Lab | Literature review, data analysis, and report generation |
|
|
134
|
+
|
|
135
|
+
These aren't toy demos — each AI company produces **product-level deliverables** through a full team of collaborating AI agents.
|
|
136
|
+
|
|
137
|
+
### How We're Different
|
|
138
|
+
|
|
139
|
+
| | Typical Agent Orchestrators | OneManCompany |
|
|
140
|
+
| ------------------------------ | ------------------------------------ | ---------------------------------------------------------------------- |
|
|
141
|
+
| **Agent architecture** | Flat task runners, BYOA | Vessel + Talent separation — modular architecture with Harness protocols |
|
|
142
|
+
| **Where do agents come from?** | You find and configure them yourself | **C-suite built-in on Day 1** + HR hires from a verified Talent Market |
|
|
143
|
+
| **Execution model** | Heartbeat polling / loop | Event-driven, zero-idle, on-demand dispatch |
|
|
144
|
+
| **Organization** | Simple task queues | Full company simulation — org chart, reviews, coaching, meetings |
|
|
145
|
+
| **Deliverables** | Single-point task outputs | Multi-iteration project delivery with quality gates |
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Quick Start
|
|
150
|
+
|
|
151
|
+
You only need **Node.js 16+** and **Git**. Everything else is installed automatically.
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
npx @carbonkite/onemancompany
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
<details>
|
|
158
|
+
<summary><b>macOS</b></summary>
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# Install Git (if not already installed)
|
|
162
|
+
xcode-select --install
|
|
163
|
+
|
|
164
|
+
# Launch (auto-installs UV + Python 3.12 + dependencies)
|
|
165
|
+
npx @carbonkite/onemancompany
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
</details>
|
|
169
|
+
|
|
170
|
+
<details>
|
|
171
|
+
<summary><b>Windows</b></summary>
|
|
172
|
+
|
|
173
|
+
```powershell
|
|
174
|
+
# Install Git: https://git-scm.com/download/win
|
|
175
|
+
# Install Node.js: https://nodejs.org/
|
|
176
|
+
|
|
177
|
+
# Launch (auto-installs UV + Python 3.12 + dependencies)
|
|
178
|
+
npx @carbonkite/onemancompany
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
</details>
|
|
182
|
+
|
|
183
|
+
<details>
|
|
184
|
+
<summary><b>Linux (Ubuntu/Debian)</b></summary>
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Install prerequisites
|
|
188
|
+
sudo apt update && sudo apt install -y git nodejs npm
|
|
189
|
+
|
|
190
|
+
# Launch (auto-installs UV + Python 3.12 + dependencies)
|
|
191
|
+
npx @carbonkite/onemancompany
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
</details>
|
|
195
|
+
|
|
196
|
+
First run automatically:
|
|
197
|
+
|
|
198
|
+
1. Installs **UV** (fast Python package manager)
|
|
199
|
+
2. Installs **Python 3.12** via UV (isolated, no system changes)
|
|
200
|
+
3. Clones the repository
|
|
201
|
+
4. Creates venv and installs dependencies
|
|
202
|
+
5. Launches the setup wizard (API keys, Talent Market config)
|
|
203
|
+
|
|
204
|
+
Then open `http://localhost:8000`. Congratulations, you're a CEO now.
|
|
205
|
+
|
|
206
|
+
### Execution Modes
|
|
207
|
+
|
|
208
|
+
Founding employees (EA, HR, COO, CSO) support three execution modes, switchable in settings:
|
|
209
|
+
|
|
210
|
+
| Mode | Description | Requirements |
|
|
211
|
+
| --- | --- | --- |
|
|
212
|
+
| **Company Hosted Agent** | OMC's built-in agent, calls LLMs via OpenRouter | OpenRouter API Key (configured in setup wizard) |
|
|
213
|
+
| **Claude Code** | More capable, lower token cost | Install [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) + [Claude Pro/Max subscription](https://claude.ai) |
|
|
214
|
+
| **OpenClaw** | Open-source alternative, multiple LLM backends | Install [OpenClaw CLI](https://github.com/anthropics/openclaw) + compatible LLM API Key |
|
|
215
|
+
|
|
216
|
+
Defaults to Company Hosted Agent — no extra subscription needed to get started. See [Execution Modes docs](https://carbonkite.github.io/OneManCompany/docs/guide/execution-modes/) for details.
|
|
217
|
+
|
|
218
|
+
### Manage Your Service
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
# Restart / auto-update
|
|
222
|
+
npx @carbonkite/onemancompany
|
|
223
|
+
|
|
224
|
+
# Debug mode (foreground with logs, Ctrl+C to stop)
|
|
225
|
+
npx @carbonkite/onemancompany --debug
|
|
226
|
+
|
|
227
|
+
# Stop background service
|
|
228
|
+
npx @carbonkite/onemancompany stop
|
|
229
|
+
|
|
230
|
+
# Re-run setup wizard (change API keys, etc.)
|
|
231
|
+
npx @carbonkite/onemancompany init
|
|
232
|
+
|
|
233
|
+
# Custom port
|
|
234
|
+
npx @carbonkite/onemancompany --port 8080
|
|
235
|
+
|
|
236
|
+
# Uninstall (stops service + deletes installation)
|
|
237
|
+
npx @carbonkite/onemancompany uninstall
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Manual Install (Dev Mode)
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# 1. Clone
|
|
244
|
+
git clone https://github.com/1mancompany/OneManCompany.git
|
|
245
|
+
cd OneManCompany
|
|
246
|
+
|
|
247
|
+
# 2. Start (auto-installs UV + Python if needed)
|
|
248
|
+
bash start.sh
|
|
249
|
+
|
|
250
|
+
# 3. Open browser
|
|
251
|
+
open http://localhost:8000
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Configuration Files
|
|
255
|
+
|
|
256
|
+
| File | Purpose |
|
|
257
|
+
| ---------------------------- | -------------------------------------- |
|
|
258
|
+
| `.onemancompany/.env` | API keys (OpenRouter, Anthropic, etc.) |
|
|
259
|
+
| `.onemancompany/config.yaml` | App config (Talent Market URL, etc.) |
|
|
260
|
+
| Browser Settings panel | Frontend preferences |
|
|
261
|
+
|
|
262
|
+
---
|
|
263
|
+
|
|
264
|
+
## Under the Hood
|
|
265
|
+
|
|
266
|
+
### Why It's an OS, Not Just a Company
|
|
267
|
+
|
|
268
|
+
A company is a team with specific goals. An operating system is the infrastructure that gives your team scalability, flexibility, and the ability to evolve. Three traits make OneManCompany an OS:
|
|
269
|
+
|
|
270
|
+
1. **Unified Runtime** — Abstracts away AI differences. You don't need to know if your employee runs on Claude Code or OpenClaw — the Vessel layer handles scheduling, retries, and communication uniformly.
|
|
271
|
+
2. **Install Employees Like Apps** — Phone OS has an app store; we have a Talent Market. Need a designer? HR hires one, plug and play. Not performing? Fire them — the next one will be better.
|
|
272
|
+
3. **Same System, Different Company** — Swap the Direction, Culture, and Talents, and you have an entirely different company. A game studio today, a dev agency tomorrow.
|
|
273
|
+
|
|
274
|
+
### Built Like a Real Company
|
|
275
|
+
|
|
276
|
+
We faithfully modeled how Fortune 500 companies actually operate:
|
|
277
|
+
|
|
278
|
+
- **Org chart & reporting lines** — hierarchical management, department-based structure
|
|
279
|
+
- **Hiring & onboarding** — HR searches Talent Market, CEO interviews, automated onboarding flow
|
|
280
|
+
- **Firing & offboarding** — yes, you can fire underperformers (with proper cleanup, not just `kill -9`)
|
|
281
|
+
- **Performance reviews** — quarterly scoring, probation, PIP, promotion tracks
|
|
282
|
+
- **Task delegation & approval chains** — CEO → executives → employees, with quality gates at every level
|
|
283
|
+
- **Meeting rooms** — multi-agent synchronous discussions with meeting reports
|
|
284
|
+
- **Knowledge base & SOPs** — company culture, direction docs, workflow definitions
|
|
285
|
+
- **File change approvals** — employees propose edits, CEO reviews diffs and approves in batch
|
|
286
|
+
- **Cost accounting** — per-project LLM token usage and USD cost tracking
|
|
287
|
+
- **1-on-1 coaching** — CEO guidance sessions that permanently shape employee behavior
|
|
288
|
+
- **Hot reload & graceful restart** — zero-downtime deployments for AI companies
|
|
289
|
+
|
|
290
|
+
Something missing? [Open an issue](https://github.com/1mancompany/OneManCompany/issues) or build it yourself — that's the beauty of open source.
|
|
291
|
+
|
|
292
|
+
### Why We Deliver Product-Grade Output
|
|
293
|
+
|
|
294
|
+
Scattered AI tools stop at draft-quality output. OneManCompany replicates full business processes to minimize human intervention:
|
|
295
|
+
|
|
296
|
+
- **Enterprise-style task orchestration** — Automatically breaks complex projects into specialized phases (requirements → design → development → testing → deployment), assigns owners, and coordinates like a real team.
|
|
297
|
+
- **Smart talent matching** — The recruiting agent matches the right AI employee to every role, ensuring skills align precisely with task demands.
|
|
298
|
+
- **Closed-loop evolution** — After delivery, the system runs retrospectives, captures lessons learned, and optimizes workflows. Every project makes the entire organization better.
|
|
299
|
+
|
|
300
|
+
### The Vessel + Talent System
|
|
301
|
+
|
|
302
|
+
Think of it like **EVA or Gundam** — a powerful mech that comes alive when a pilot is plugged in.
|
|
303
|
+
|
|
304
|
+
- **Vessel** (the mech) = execution container. Defines how an employee runs: retry logic, timeouts, tool access, communication protocols.
|
|
305
|
+
- **Talent** (the pilot) = capability package. Brings skills, knowledge, personality, and specialized tools.
|
|
306
|
+
- **Employee** = Vessel + Talent. Hire from the Talent Market, and the system handles the rest.
|
|
307
|
+
|
|
308
|
+
> For a deep dive into the Vessel architecture, see [docs/vessel-system.md](docs/vessel-system.md).
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Open Ecosystem
|
|
313
|
+
|
|
314
|
+
OneManCompany goes beyond built-in capabilities — it's open to the global agent community.
|
|
315
|
+
|
|
316
|
+
**If you're an AI builder**, your agents can be packaged as AI employees (game developers, comic artists, full-stack engineers) and published to the Talent Market, empowering thousands of users and turning your work into scalable value.
|
|
317
|
+
|
|
318
|
+
**If you're a CEO user**, you can load powerful agents built by others and make them your employees, bringing stronger delivery capabilities to your company. Each agent's core abilities are packaged as modular Skills (e.g., "React component development", "2D character design") that can be freely combined for any project.
|
|
319
|
+
|
|
320
|
+
You're not just using AI — you're leading a continuously growing, dynamically expanding organization that delivers professional-grade results at a fraction of the cost of a real team.
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
## Vision & Roadmap
|
|
325
|
+
|
|
326
|
+
**Near-term:** Enable 100 AI one-person companies within one year.
|
|
327
|
+
|
|
328
|
+
**Long-term:** Redefine the relationship between AI, humans, and organizations.
|
|
329
|
+
|
|
330
|
+
| Tier | Focus | Examples |
|
|
331
|
+
| --------------------------- | ------------------------------------- | ------------------------------------------------------------------------ |
|
|
332
|
+
| 🔧 **Stronger AI Agents** | Make each employee more capable | Enhanced sandbox, better tool usage, improved code execution |
|
|
333
|
+
| 🏢 **Smarter Organization** | Make the company run more efficiently | CEO experience, advanced task scheduling, multi-agent collaboration |
|
|
334
|
+
| 🌐 **AI-Native Ecosystem** | Build a thriving open ecosystem | Talent Market expansion, third-party tools/APIs, community contributions |
|
|
335
|
+
|
|
336
|
+
### TODO
|
|
337
|
+
|
|
338
|
+
- [ ] More built-in tools (Kanban board, progress visualization, Gantt chart, etc.)
|
|
339
|
+
- [ ] Selectable frontend themes (futuristic, cyberpunk, minimalist, pixel-art, etc.)
|
|
340
|
+
- [ ] More LLM provider options (Ollama local, Azure OpenAI, AWS Bedrock, etc.)
|
|
341
|
+
- [ ] More efficient AI collaboration (multi-agent handoff, parallel execution, conflict resolution)
|
|
342
|
+
- [ ] More efficient company-hosted agent Vessel logic (smarter retry, context carryover, cost-aware scheduling)
|
|
343
|
+
|
|
344
|
+
Contributions welcome — we encourage vibe-coding. AI contributors please follow the [vibe-coding-guide](vibe-coding-guide.md).
|
|
345
|
+
|
|
346
|
+
This is a living plan — [request a feature](https://github.com/1mancompany/OneManCompany/issues) or [contribute directly](https://github.com/1mancompany/OneManCompany/pulls).
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Documentation
|
|
351
|
+
|
|
352
|
+
**[Full Documentation Site](https://carbonkite.github.io/OneManCompany/docs/)** — Feature guides, usage instructions, and technical reference.
|
|
353
|
+
|
|
354
|
+
| Guide | Description |
|
|
355
|
+
| --- | --- |
|
|
356
|
+
| [Getting Started](https://carbonkite.github.io/OneManCompany/docs/guide/getting-started/) | First-time setup and your first task |
|
|
357
|
+
| [Execution Modes](https://carbonkite.github.io/OneManCompany/docs/guide/execution-modes/) | Company Hosted Agent vs Claude Code |
|
|
358
|
+
| [Task Management](https://carbonkite.github.io/OneManCompany/docs/guide/task-management/) | Create, delegate, review, and approve tasks |
|
|
359
|
+
| [Hiring & Talent Market](https://carbonkite.github.io/OneManCompany/docs/guide/hiring/) | Find and hire AI employees |
|
|
360
|
+
| [1-on-1 Coaching](https://carbonkite.github.io/OneManCompany/docs/guide/coaching/) | Shape employee behavior permanently |
|
|
361
|
+
| [Performance Reviews](https://carbonkite.github.io/OneManCompany/docs/guide/performance/) | Evaluate, promote, or fire employees |
|
|
362
|
+
|
|
363
|
+
| Technical Reference | Description |
|
|
364
|
+
| --- | --- |
|
|
365
|
+
| [Architecture](docs/architecture.md) | System architecture, diagrams, module index, design philosophy |
|
|
366
|
+
| [Vessel System](docs/vessel-system.md) | Vessel + Talent deep dive, Harness protocols |
|
|
367
|
+
| [Task System](docs/task-system.md) | Task status state machine |
|
|
368
|
+
| [Coding Guide](vibe-coding-guide.md) | Coding guidelines, testing rules, code style |
|
|
369
|
+
| [Changelog](CHANGELOG.md) | Release history |
|
|
370
|
+
|
|
371
|
+
---
|
|
372
|
+
|
|
373
|
+
## Community & Contributing
|
|
374
|
+
|
|
375
|
+
- **Build Talents** — Create new AI employee types for the Talent Market
|
|
376
|
+
- **Build Tools** — Add integrations (APIs, services, platforms)
|
|
377
|
+
- **Add Company Features** — Performance dashboards, OKR tracking, employee training...
|
|
378
|
+
- **Improve the OS** — Core engine, frontend, documentation
|
|
379
|
+
- **Share Demos** — Show what your AI company can build
|
|
380
|
+
- **Report Issues** — Help us find and fix bugs
|
|
381
|
+
|
|
382
|
+
See [vibe-coding-guide.md](vibe-coding-guide.md) for coding guidelines.
|
|
383
|
+
|
|
384
|
+
---
|
|
385
|
+
|
|
386
|
+
## Citation
|
|
387
|
+
|
|
388
|
+
If you use OneManCompany in your research or project, please cite it:
|
|
389
|
+
|
|
390
|
+
```bibtex
|
|
391
|
+
@software{onemancompany2025,
|
|
392
|
+
title = {OneManCompany: The AI Operating System for One-Person Companies},
|
|
393
|
+
author = {Zhengxu Yu, Fu Yu, Zhiyuan He, Yuxuan Huang, Weilin Luo, Jun Wang},
|
|
394
|
+
url = {https://github.com/1mancompany/OneManCompany},
|
|
395
|
+
year = {2025},
|
|
396
|
+
license = {Apache-2.0}
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## Links
|
|
403
|
+
|
|
404
|
+
**[Talent Market](https://carbonkites.com)** — Community-verified AI employee marketplace (Trained a 🦞 but not sure what to do with it? List it on the market!)
|
|
405
|
+
|
|
406
|
+
**[Talent Template](https://github.com/1mancompany/talent-template)** — Template repo for building your own Talents
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
## License
|
|
411
|
+
|
|
412
|
+
[Apache License 2.0](LICENSE) — Free for commercial use and modification, with attribution required.
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OneManCompany CLI — npx @carbonkite/onemancompany
|
|
5
|
+
*
|
|
6
|
+
* Zero-prerequisites launcher. Automatically installs UV and Python if needed.
|
|
7
|
+
* Works on Windows, macOS, and Linux.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const { execSync, spawn, spawnSync } = require("child_process");
|
|
11
|
+
const readline = require("readline");
|
|
12
|
+
const path = require("path");
|
|
13
|
+
const fs = require("fs");
|
|
14
|
+
const os = require("os");
|
|
15
|
+
|
|
16
|
+
// ── Config ──────────────────────────────────────────────────────────────────
|
|
17
|
+
const REPO_URL = "https://github.com/1mancompany/OneManCompany.git";
|
|
18
|
+
const DIR_NAME = "OneManCompany";
|
|
19
|
+
const PYTHON_VERSION = "3.12";
|
|
20
|
+
|
|
21
|
+
// ── Colors ──────────────────────────────────────────────────────────────────
|
|
22
|
+
const cyan = (s) => `\x1b[1;36m${s}\x1b[0m`;
|
|
23
|
+
const yellow = (s) => `\x1b[1;33m${s}\x1b[0m`;
|
|
24
|
+
const red = (s) => `\x1b[1;31m${s}\x1b[0m`;
|
|
25
|
+
const green = (s) => `\x1b[1;32m${s}\x1b[0m`;
|
|
26
|
+
const dim = (s) => `\x1b[2m${s}\x1b[0m`;
|
|
27
|
+
|
|
28
|
+
const info = (msg) => console.log(cyan(`▸ ${msg}`));
|
|
29
|
+
const warn = (msg) => console.log(yellow(`⚠ ${msg}`));
|
|
30
|
+
const fail = (msg) => {
|
|
31
|
+
console.error(red(`✖ ${msg}`));
|
|
32
|
+
process.exit(1);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const isWindows = os.platform() === "win32";
|
|
36
|
+
const PID_FILE = ".onemancompany.pid";
|
|
37
|
+
|
|
38
|
+
// ── Helpers ─────────────────────────────────────────────────────────────────
|
|
39
|
+
|
|
40
|
+
function ask(question) {
|
|
41
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
42
|
+
return new Promise((resolve) => {
|
|
43
|
+
rl.question(question, (answer) => {
|
|
44
|
+
rl.close();
|
|
45
|
+
resolve(answer.trim().toLowerCase());
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function findInstallDir() {
|
|
51
|
+
const dirFromArgs = (() => {
|
|
52
|
+
const args = process.argv.slice(2);
|
|
53
|
+
for (let i = 0; i < args.length; i++) {
|
|
54
|
+
if (args[i] === "--dir" && args[i + 1]) return path.resolve(args[i + 1]);
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
})();
|
|
58
|
+
return dirFromArgs || path.resolve(process.cwd(), DIR_NAME);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function writePidFile(installDir, pid) {
|
|
62
|
+
fs.writeFileSync(path.join(installDir, PID_FILE), String(pid));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function readPidFile(installDir) {
|
|
66
|
+
const pidPath = path.join(installDir, PID_FILE);
|
|
67
|
+
if (!fs.existsSync(pidPath)) return null;
|
|
68
|
+
const pid = parseInt(fs.readFileSync(pidPath, "utf-8").trim(), 10);
|
|
69
|
+
return isNaN(pid) ? null : pid;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function removePidFile(installDir) {
|
|
73
|
+
const pidPath = path.join(installDir, PID_FILE);
|
|
74
|
+
if (fs.existsSync(pidPath)) fs.unlinkSync(pidPath);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function isProcessRunning(pid) {
|
|
78
|
+
try {
|
|
79
|
+
process.kill(pid, 0);
|
|
80
|
+
return true;
|
|
81
|
+
} catch {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function stopService(installDir) {
|
|
87
|
+
const pid = readPidFile(installDir);
|
|
88
|
+
if (pid && isProcessRunning(pid)) {
|
|
89
|
+
info(`Stopping OneManCompany service (PID ${pid})...`);
|
|
90
|
+
try {
|
|
91
|
+
process.kill(pid, "SIGTERM");
|
|
92
|
+
// Wait up to 5s for graceful shutdown
|
|
93
|
+
for (let i = 0; i < 50; i++) {
|
|
94
|
+
if (!isProcessRunning(pid)) break;
|
|
95
|
+
spawnSync("sleep", ["0.1"]);
|
|
96
|
+
}
|
|
97
|
+
if (isProcessRunning(pid)) {
|
|
98
|
+
process.kill(pid, "SIGKILL");
|
|
99
|
+
}
|
|
100
|
+
info("Service stopped");
|
|
101
|
+
} catch {
|
|
102
|
+
warn("Could not stop service — it may have already exited");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
removePidFile(installDir);
|
|
106
|
+
}
|
|
107
|
+
function commandExists(cmd) {
|
|
108
|
+
try {
|
|
109
|
+
if (isWindows) {
|
|
110
|
+
execSync(`where ${cmd}`, { stdio: "ignore" });
|
|
111
|
+
} else {
|
|
112
|
+
execSync(`command -v ${cmd}`, { stdio: "ignore" });
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
} catch {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function run(cmd, opts = {}) {
|
|
121
|
+
return execSync(cmd, { stdio: "inherit", ...opts });
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function runShell(cmd, opts = {}) {
|
|
125
|
+
return execSync(cmd, { stdio: "inherit", shell: true, ...opts });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// ── UV installer ────────────────────────────────────────────────────────────
|
|
129
|
+
function ensureUV() {
|
|
130
|
+
if (commandExists("uv")) {
|
|
131
|
+
const ver = execSync("uv --version").toString().trim();
|
|
132
|
+
info(`Found ${ver}`);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
info("Installing UV (fast Python package manager)...");
|
|
137
|
+
|
|
138
|
+
try {
|
|
139
|
+
if (isWindows) {
|
|
140
|
+
runShell("powershell -ExecutionPolicy ByPass -c \"irm https://astral.sh/uv/install.ps1 | iex\"");
|
|
141
|
+
} else {
|
|
142
|
+
runShell("curl -LsSf https://astral.sh/uv/install.sh | sh");
|
|
143
|
+
}
|
|
144
|
+
} catch (e) {
|
|
145
|
+
fail(
|
|
146
|
+
"Failed to install UV automatically.\n" +
|
|
147
|
+
"Please install it manually: https://docs.astral.sh/uv/getting-started/installation/\n" +
|
|
148
|
+
`Error: ${e.message}`
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Add UV to PATH for the current session
|
|
153
|
+
const home = os.homedir();
|
|
154
|
+
const uvBinPaths = isWindows
|
|
155
|
+
? [path.join(home, ".cargo", "bin")]
|
|
156
|
+
: [path.join(home, ".local", "bin"), path.join(home, ".cargo", "bin")];
|
|
157
|
+
|
|
158
|
+
for (const p of uvBinPaths) {
|
|
159
|
+
if (fs.existsSync(path.join(p, isWindows ? "uv.exe" : "uv"))) {
|
|
160
|
+
process.env.PATH = `${p}${path.delimiter}${process.env.PATH}`;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (!commandExists("uv")) {
|
|
166
|
+
fail(
|
|
167
|
+
"UV was installed but not found in PATH.\n" +
|
|
168
|
+
"Please restart your terminal and try again, or add UV to your PATH manually."
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
info(`Installed ${execSync("uv --version").toString().trim()}`);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// ── Python via UV ───────────────────────────────────────────────────────────
|
|
176
|
+
function ensurePython() {
|
|
177
|
+
// Check if UV-managed Python exists
|
|
178
|
+
try {
|
|
179
|
+
const ver = execSync(`uv python find ${PYTHON_VERSION} 2>&1`).toString().trim();
|
|
180
|
+
if (ver) {
|
|
181
|
+
info(`Found Python at ${ver}`);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
} catch {}
|
|
185
|
+
|
|
186
|
+
info(`Installing Python ${PYTHON_VERSION} via UV...`);
|
|
187
|
+
try {
|
|
188
|
+
runShell(`uv python install ${PYTHON_VERSION}`);
|
|
189
|
+
info(`Python ${PYTHON_VERSION} installed`);
|
|
190
|
+
} catch (e) {
|
|
191
|
+
fail(`Failed to install Python ${PYTHON_VERSION}: ${e.message}`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// ── Main ────────────────────────────────────────────────────────────────────
|
|
196
|
+
async function main() {
|
|
197
|
+
const args = process.argv.slice(2);
|
|
198
|
+
|
|
199
|
+
// Help
|
|
200
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
201
|
+
console.log(`
|
|
202
|
+
${cyan("OneManCompany")} — The AI Operating System for One-Person Companies
|
|
203
|
+
|
|
204
|
+
${green("Usage:")}
|
|
205
|
+
npx @carbonkite/onemancompany Start (runs in background)
|
|
206
|
+
npx @carbonkite/onemancompany --debug Start with logs (Ctrl+C to stop)
|
|
207
|
+
npx @carbonkite/onemancompany stop Stop background service
|
|
208
|
+
npx @carbonkite/onemancompany init Re-run setup wizard
|
|
209
|
+
npx @carbonkite/onemancompany uninstall Stop service and remove installation
|
|
210
|
+
npx @carbonkite/onemancompany --port 8080 Custom port
|
|
211
|
+
npx @carbonkite/onemancompany --dir ./my Custom install directory
|
|
212
|
+
|
|
213
|
+
${green("Options:")}
|
|
214
|
+
--dir <path> Install directory (default: ./OneManCompany)
|
|
215
|
+
--port <port> Server port (default: 8000)
|
|
216
|
+
--debug Run in foreground with logs (default: background)
|
|
217
|
+
--help, -h Show this help
|
|
218
|
+
|
|
219
|
+
${green("What gets installed automatically:")}
|
|
220
|
+
1. UV — Fast Python package manager ${dim("(https://astral.sh/uv)")}
|
|
221
|
+
2. Python — ${PYTHON_VERSION}+ via UV ${dim("(managed, no system changes)")}
|
|
222
|
+
3. Project — Cloned from GitHub ${dim("(into current directory)")}
|
|
223
|
+
`);
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// ── Uninstall ─────────────────────────────────────────────────────────
|
|
228
|
+
if (args[0] === "uninstall") {
|
|
229
|
+
const installDir = findInstallDir();
|
|
230
|
+
if (!fs.existsSync(installDir)) {
|
|
231
|
+
warn(`No installation found at ${installDir}`);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const answer = await ask(
|
|
236
|
+
yellow("⚠") + ` This will stop the service and delete ${installDir}\n` +
|
|
237
|
+
" Are you sure? [y/N] "
|
|
238
|
+
);
|
|
239
|
+
if (answer !== "y" && answer !== "yes") {
|
|
240
|
+
console.log(" Aborted.");
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
stopService(installDir);
|
|
245
|
+
|
|
246
|
+
info(`Removing ${installDir}...`);
|
|
247
|
+
fs.rmSync(installDir, { recursive: true, force: true });
|
|
248
|
+
info("OneManCompany has been uninstalled.");
|
|
249
|
+
console.log(dim(` To reinstall: npx @carbonkite/onemancompany`));
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// ── Stop ────────────────────────────────────────────────────────────
|
|
254
|
+
if (args[0] === "stop") {
|
|
255
|
+
const installDir = findInstallDir();
|
|
256
|
+
const pid = readPidFile(installDir);
|
|
257
|
+
if (pid && isProcessRunning(pid)) {
|
|
258
|
+
stopService(installDir);
|
|
259
|
+
console.log(green(" ✓ OneManCompany stopped."));
|
|
260
|
+
} else {
|
|
261
|
+
warn("No running OneManCompany service found.");
|
|
262
|
+
removePidFile(installDir);
|
|
263
|
+
}
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
console.log();
|
|
268
|
+
console.log(cyan("╔═══════════════════════════════════════════════╗"));
|
|
269
|
+
console.log(cyan("║ OneManCompany — AI Company OS ║"));
|
|
270
|
+
console.log(cyan("╚═══════════════════════════════════════════════╝"));
|
|
271
|
+
console.log();
|
|
272
|
+
|
|
273
|
+
// ── Check git ─────────────────────────────────────────────────────────
|
|
274
|
+
if (!commandExists("git")) {
|
|
275
|
+
fail(
|
|
276
|
+
"Git is required but not found.\n" +
|
|
277
|
+
(isWindows
|
|
278
|
+
? "Install from https://git-scm.com/download/win"
|
|
279
|
+
: os.platform() === "darwin"
|
|
280
|
+
? "Run: xcode-select --install"
|
|
281
|
+
: "Run: sudo apt install git (or your distro's equivalent)")
|
|
282
|
+
);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// ── Install UV + Python ───────────────────────────────────────────────
|
|
286
|
+
ensureUV();
|
|
287
|
+
ensurePython();
|
|
288
|
+
|
|
289
|
+
// ── Parse args ────────────────────────────────────────────────────────
|
|
290
|
+
let installDir = path.resolve(process.cwd(), DIR_NAME);
|
|
291
|
+
const passthrough = [];
|
|
292
|
+
|
|
293
|
+
for (let i = 0; i < args.length; i++) {
|
|
294
|
+
if (args[i] === "--dir" && args[i + 1]) {
|
|
295
|
+
installDir = path.resolve(args[++i]);
|
|
296
|
+
} else {
|
|
297
|
+
passthrough.push(args[i]);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// ── Clone or update ───────────────────────────────────────────────────
|
|
302
|
+
if (fs.existsSync(path.join(installDir, ".git"))) {
|
|
303
|
+
info(`Updating existing installation at ${installDir}`);
|
|
304
|
+
try {
|
|
305
|
+
run("git pull --ff-only", { cwd: installDir });
|
|
306
|
+
} catch {
|
|
307
|
+
warn("git pull failed — continuing with current version");
|
|
308
|
+
}
|
|
309
|
+
} else if (fs.existsSync(installDir)) {
|
|
310
|
+
info(`Directory ${installDir} exists (not a git repo) — using as-is`);
|
|
311
|
+
} else {
|
|
312
|
+
info(`Cloning OneManCompany into ${installDir}...`);
|
|
313
|
+
run(`git clone --depth 1 ${REPO_URL} "${installDir}"`);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// ── Check if already running ─────────────────────────────────────────
|
|
317
|
+
const existingPid = readPidFile(installDir);
|
|
318
|
+
if (existingPid && isProcessRunning(existingPid)) {
|
|
319
|
+
warn("OneManCompany is already running.");
|
|
320
|
+
const answer = await ask(
|
|
321
|
+
" Stop the service and re-setup? [y/N] "
|
|
322
|
+
);
|
|
323
|
+
if (answer === "y" || answer === "yes") {
|
|
324
|
+
stopService(installDir);
|
|
325
|
+
info("Re-running setup wizard...\n");
|
|
326
|
+
const pythonBinCheck = isWindows
|
|
327
|
+
? path.join(installDir, ".venv", "Scripts", "python.exe")
|
|
328
|
+
: path.join(installDir, ".venv", "bin", "python");
|
|
329
|
+
if (fs.existsSync(pythonBinCheck)) {
|
|
330
|
+
const initResult = spawnSync(pythonBinCheck, ["-m", "onemancompany.onboard"], {
|
|
331
|
+
cwd: installDir,
|
|
332
|
+
stdio: "inherit",
|
|
333
|
+
});
|
|
334
|
+
if (initResult.status !== 0) fail("Setup wizard failed");
|
|
335
|
+
}
|
|
336
|
+
} else {
|
|
337
|
+
console.log(" Continuing with existing service.");
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// ── Setup venv + deps via UV ──────────────────────────────────────────
|
|
343
|
+
const venvDir = path.join(installDir, ".venv");
|
|
344
|
+
if (!fs.existsSync(venvDir)) {
|
|
345
|
+
info("Creating virtual environment...");
|
|
346
|
+
runShell(`uv venv --python ${PYTHON_VERSION}`, { cwd: installDir });
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
info("Installing dependencies...");
|
|
350
|
+
runShell("uv pip install -e .", { cwd: installDir });
|
|
351
|
+
|
|
352
|
+
// ── Launch (directly via Python, all platforms) ────────────────────────
|
|
353
|
+
const pythonBin = isWindows
|
|
354
|
+
? path.join(venvDir, "Scripts", "python.exe")
|
|
355
|
+
: path.join(venvDir, "bin", "python");
|
|
356
|
+
|
|
357
|
+
if (!fs.existsSync(pythonBin)) {
|
|
358
|
+
fail(`Python not found at ${pythonBin}. Try deleting .venv and running again.`);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const initComplete = fs.existsSync(path.join(installDir, ".onemancompany", ".env"))
|
|
362
|
+
&& fs.existsSync(path.join(installDir, ".onemancompany", "company", "human_resource", "employees"));
|
|
363
|
+
|
|
364
|
+
// Run setup wizard if needed
|
|
365
|
+
if (passthrough[0] === "init" || !initComplete) {
|
|
366
|
+
info("Running setup wizard...\n");
|
|
367
|
+
const initResult = spawnSync(pythonBin, ["-m", "onemancompany.onboard"], {
|
|
368
|
+
cwd: installDir,
|
|
369
|
+
stdio: "inherit",
|
|
370
|
+
});
|
|
371
|
+
if (initResult.status !== 0) fail("Setup wizard failed");
|
|
372
|
+
if (passthrough[0] === "init") passthrough.shift();
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
// Start server
|
|
376
|
+
const debugMode = passthrough.includes("--debug");
|
|
377
|
+
const launchArgs = passthrough.filter((a) => a !== "--debug");
|
|
378
|
+
|
|
379
|
+
if (debugMode) {
|
|
380
|
+
// ── Foreground mode: show logs, Ctrl+C to kill ──────────────────
|
|
381
|
+
info("Starting OneManCompany in debug mode (Ctrl+C to stop)...\n");
|
|
382
|
+
const child = spawn(pythonBin, ["-m", "onemancompany.main", ...launchArgs], {
|
|
383
|
+
cwd: installDir,
|
|
384
|
+
stdio: "inherit",
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
writePidFile(installDir, child.pid);
|
|
388
|
+
|
|
389
|
+
const cleanup = () => { removePidFile(installDir); };
|
|
390
|
+
child.on("close", (code) => { cleanup(); process.exit(code ?? 0); });
|
|
391
|
+
child.on("error", (err) => { cleanup(); fail(`Failed to start: ${err.message}`); });
|
|
392
|
+
process.on("SIGINT", () => { child.kill("SIGTERM"); });
|
|
393
|
+
process.on("SIGTERM", () => { child.kill("SIGTERM"); });
|
|
394
|
+
} else {
|
|
395
|
+
// ── Background mode: detach and exit CLI ────────────────────────
|
|
396
|
+
info("Starting OneManCompany in background...");
|
|
397
|
+
const logFile = path.join(installDir, ".onemancompany", "server.log");
|
|
398
|
+
// Ensure log directory exists
|
|
399
|
+
const logDir = path.dirname(logFile);
|
|
400
|
+
if (!fs.existsSync(logDir)) fs.mkdirSync(logDir, { recursive: true });
|
|
401
|
+
|
|
402
|
+
const out = fs.openSync(logFile, "a");
|
|
403
|
+
const err = fs.openSync(logFile, "a");
|
|
404
|
+
|
|
405
|
+
const child = spawn(pythonBin, ["-m", "onemancompany.main", ...launchArgs], {
|
|
406
|
+
cwd: installDir,
|
|
407
|
+
stdio: ["ignore", out, err],
|
|
408
|
+
detached: true,
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
writePidFile(installDir, child.pid);
|
|
412
|
+
child.unref();
|
|
413
|
+
|
|
414
|
+
// Wait a moment to check it didn't crash immediately
|
|
415
|
+
await new Promise((r) => setTimeout(r, 1500));
|
|
416
|
+
if (isProcessRunning(child.pid)) {
|
|
417
|
+
console.log();
|
|
418
|
+
console.log(green(" ✓ OneManCompany is running!"));
|
|
419
|
+
console.log();
|
|
420
|
+
console.log(` ${cyan("→")} Open ${cyan("http://localhost:8000")} in your browser`);
|
|
421
|
+
console.log(` ${dim(" Logs:")} ${logFile}`);
|
|
422
|
+
console.log(` ${dim(" Stop:")} npx @carbonkite/onemancompany stop`);
|
|
423
|
+
console.log(` ${dim(" Debug:")} npx @carbonkite/onemancompany --debug`);
|
|
424
|
+
console.log();
|
|
425
|
+
} else {
|
|
426
|
+
removePidFile(installDir);
|
|
427
|
+
fail("Server exited unexpectedly. Run with --debug to see logs.");
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
main().catch((err) => {
|
|
433
|
+
console.error(red(`✖ ${err.message}`));
|
|
434
|
+
process.exit(1);
|
|
435
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@1mancompany/onemancompany",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The AI Operating System for One-Person Companies",
|
|
5
|
+
"bin": {
|
|
6
|
+
"onemancompany": "bin/cli.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/cli.js"
|
|
10
|
+
],
|
|
11
|
+
"keywords": [
|
|
12
|
+
"ai",
|
|
13
|
+
"agent",
|
|
14
|
+
"multi-agent",
|
|
15
|
+
"langchain",
|
|
16
|
+
"company",
|
|
17
|
+
"one-man-company",
|
|
18
|
+
"ai-native",
|
|
19
|
+
"autonomous-agent"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/1mancompany/OneManCompany.git"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/1mancompany/OneManCompany",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/1mancompany/OneManCompany/issues"
|
|
28
|
+
},
|
|
29
|
+
"author": "1mancompany",
|
|
30
|
+
"license": "Apache-2.0",
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=16"
|
|
33
|
+
}
|
|
34
|
+
}
|