@open-everywhere/create 0.1.4
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/NOTICE +21 -0
- package/README.md +69 -0
- package/bin/create-open-everywhere.js +57 -0
- package/package.json +57 -0
- package/src/cli.ts +241 -0
- package/src/deploy-probe.ts +99 -0
- package/src/engine.ts +106 -0
- package/src/env-file.ts +53 -0
- package/src/scaffold.ts +188 -0
- package/src/steps/build-deploy.ts +78 -0
- package/src/steps/database.ts +85 -0
- package/src/steps/env-checklist.ts +55 -0
- package/src/steps/index.ts +49 -0
- package/src/steps/prerequisites.ts +50 -0
- package/src/steps/repo.ts +69 -0
- package/src/steps/roster.ts +111 -0
- package/src/steps/slack.ts +74 -0
- package/src/steps/vercel.ts +40 -0
- package/src/steps/verify.ts +119 -0
- package/src/version.ts +20 -0
- package/template/.env.example +58 -0
- package/template/.mcp.json +8 -0
- package/template/AGENTS.md +62 -0
- package/template/CLAUDE.md +1 -0
- package/template/README.md +87 -0
- package/template/agent/access/access-requests.ts +69 -0
- package/template/agent/access/browser-hosts.ts +28 -0
- package/template/agent/access/bundles.ts +78 -0
- package/template/agent/access/connector-credentials.ts +74 -0
- package/template/agent/access/credential-bindings.generated.ts +17 -0
- package/template/agent/access/credential-bindings.ts +28 -0
- package/template/agent/access/grants.generated.ts +18 -0
- package/template/agent/access/grants.ts +30 -0
- package/template/agent/access/network-access.ts +32 -0
- package/template/agent/agent.ts +125 -0
- package/template/agent/blob/hosting.ts +42 -0
- package/template/agent/identity/authors.ts +79 -0
- package/template/agent/identity/groups-overlay.ts +24 -0
- package/template/agent/identity/groups.generated.ts +17 -0
- package/template/agent/identity/groups.ts +84 -0
- package/template/agent/identity/principals.ts +37 -0
- package/template/agent/identity/surfaces.ts +48 -0
- package/template/agent/instructions/access.ts +11 -0
- package/template/agent/instructions.md +295 -0
- package/template/agent/instrumentation.ts +6 -0
- package/template/agent/lib/memory-grants.ts +52 -0
- package/template/agent/lib/register-adapters.ts +286 -0
- package/template/agent/lib/register-config.ts +185 -0
- package/template/agent/memory/config/agents-overlay.ts +26 -0
- package/template/agent/memory/config/agents.generated.ts +21 -0
- package/template/agent/memory/config/domains/dm.ts +10 -0
- package/template/agent/memory/config/domains/index.ts +125 -0
- package/template/agent/memory/config/domains/org.ts +27 -0
- package/template/agent/memory/config/domains.ts +165 -0
- package/template/agent/model/models.ts +60 -0
- package/template/agent/model/policy.ts +19 -0
- package/template/agent/model/stacks.ts +75 -0
- package/template/agent/plugins/generated/index.ts +13 -0
- package/template/agent/plugins/registry.ts +16 -0
- package/template/agent/plugins/skill-content.ts +13 -0
- package/template/agent/roles/roles.ts +146 -0
- package/template/agent/routines/collectors.ts +89 -0
- package/template/agent/sandbox/backend-select.ts +16 -0
- package/template/agent/sandbox/sandbox.ts +242 -0
- package/template/agent/sandbox/workspace/.keep +6 -0
- package/template/agent/settings/settings.ts +19 -0
- package/template/agent/spend/budgets.ts +25 -0
- package/template/agent/spend/checkpoints.ts +51 -0
- package/template/agent/spend/model-pricing.ts +25 -0
- package/template/agent/webhooks/hooks-overlay.ts +34 -0
- package/template/agent/webhooks/hooks.generated.ts +17 -0
- package/template/agent/webhooks/hooks.ts +133 -0
- package/template/claude/skills/quickstart-open-everywhere/SKILL.md +167 -0
- package/template/claude/skills/upgrade-open-everywhere/SKILL.md +160 -0
- package/template/gitignore +42 -0
- package/template/package.json +62 -0
- package/template/roster.config.ts +39 -0
- package/template/roster.lock.json +182 -0
- package/template/scripts/env-pipe.mjs +74 -0
- package/template/scripts/ops-mcp.ts +35 -0
- package/template/tsconfig.json +23 -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 2026 Tommy Long
|
|
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/NOTICE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Open Everywhere
|
|
2
|
+
Copyright 2026 Tommy Long
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Built on Vercel Eve (https://github.com/vercel/eve), licensed under the
|
|
9
|
+
Apache License, Version 2.0.
|
|
10
|
+
|
|
11
|
+
@open-everywhere/core also ships a patch that modifies Vercel Eve (the file in
|
|
12
|
+
its patches/ directory), with the oe-eve-patch command that applies it to a
|
|
13
|
+
consumer's own installed copy. The patch is licensed under the Apache License,
|
|
14
|
+
Version 2.0. No modified Vercel Eve files are distributed.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
Open Everywhere is an independent, open-source project. It is NOT affiliated
|
|
19
|
+
with, endorsed by, or sponsored by Anthropic. "Claude", "Claude Code", and
|
|
20
|
+
"Claude Tag" are referenced only to describe the prior art Open Everywhere is
|
|
21
|
+
inspired by, and are trademarks of their respective owner.
|
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @open-everywhere/create
|
|
2
|
+
|
|
3
|
+
The scaffold and setup check for Open Everywhere.
|
|
4
|
+
|
|
5
|
+
Part of [Open Everywhere](https://github.com/open-everywhere/open-everywhere) — an open, self-hostable autonomous teammate you tag where your
|
|
6
|
+
team works. This package is run, not imported, and it does two things: it scaffolds a new app from
|
|
7
|
+
the quickstart template, and it reports an existing app's setup status without touching it.
|
|
8
|
+
|
|
9
|
+
**Setup itself is agent-led.** There is no interactive wizard: you open the scaffolded app in your
|
|
10
|
+
coding agent and ask it to set up Open Everywhere. The agent reads the app's `AGENTS.md`, drives the
|
|
11
|
+
`open-everywhere-ops` MCP server, and reads this command's `--check` report. Two routes are
|
|
12
|
+
supported, and the agent asks which first: **Vercel** (the `vercel` CLI plus Marketplace Neon) or
|
|
13
|
+
**Docker** (a self-hosted container that satisfies the
|
|
14
|
+
[deployment contract](https://github.com/open-everywhere/open-everywhere/blob/main/docs/deploy/contract.md)).
|
|
15
|
+
|
|
16
|
+
## Use
|
|
17
|
+
|
|
18
|
+
### Start a new app
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm create @open-everywhere my-agent
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
`npx @open-everywhere/create my-agent` does the same thing: npm maps a bare scope to
|
|
25
|
+
`@scope/create`, so both reach this package.
|
|
26
|
+
|
|
27
|
+
This scaffolds the quickstart app into `./my-agent`, prints the next steps and exits. It never
|
|
28
|
+
prompts. The directory must be new or empty. A fresh clone of an empty repository holds only `.git`,
|
|
29
|
+
and it counts as empty: run `npx @open-everywhere/create .` inside it. The scaffold refuses a
|
|
30
|
+
directory that holds anything else. The app depends on the eight `@open-everywhere/*` libraries at
|
|
31
|
+
this CLI's own version — plus this package itself, as a dev dependency, for its `check` script — and
|
|
32
|
+
on `eve` at the pin core declares; its `postinstall` applies the eve patch. Its roster mounts the launch surfaces: Slack, Notion and GitHub. The app carries `AGENTS.md`,
|
|
33
|
+
a `.mcp.json` for the `open-everywhere-ops` MCP server and the `quickstart-open-everywhere` skill,
|
|
34
|
+
so the agent you open it in can drive the setup.
|
|
35
|
+
|
|
36
|
+
### The status report
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npx @open-everywhere/create --check
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`--check` prompts for nothing, changes nothing, sends no telemetry and never scaffolds. It reports
|
|
43
|
+
each setup step with what is missing and the next command for it. Add `--json` for the same report
|
|
44
|
+
as one JSON object, which is what an agent-driven setup reads. `--route docker` judges against the
|
|
45
|
+
Docker route (the default is `vercel`), and `--host https://<host>` probes a deployment.
|
|
46
|
+
|
|
47
|
+
Run it from inside an Open Everywhere app — a scaffolded one, or a clone of the repository. From a
|
|
48
|
+
directory that is not an app, it reports an unsatisfied repo step and tells you to scaffold one.
|
|
49
|
+
|
|
50
|
+
The same step list written out for a human is
|
|
51
|
+
[Setup steps](https://github.com/open-everywhere/open-everywhere/blob/main/docs/deploy/setup-steps.md).
|
|
52
|
+
That page is generated from the step list this command reports, so the two cannot drift.
|
|
53
|
+
|
|
54
|
+
This CLI starts on Node 18 or newer. The app it scaffolds needs Node 24.
|
|
55
|
+
|
|
56
|
+
## Docs
|
|
57
|
+
|
|
58
|
+
- [Setup steps](https://github.com/open-everywhere/open-everywhere/blob/main/docs/deploy/setup-steps.md)
|
|
59
|
+
- [Setup runbook](https://github.com/open-everywhere/open-everywhere/blob/main/docs/deploy/setup-runbook.md)
|
|
60
|
+
- [Documentation index](https://github.com/open-everywhere/open-everywhere/blob/main/docs/README.md)
|
|
61
|
+
|
|
62
|
+
## Status
|
|
63
|
+
|
|
64
|
+
The 0.1 line is the first public release. It is pre-1.0: the API surface is expected to
|
|
65
|
+
change, and a minor release may break you. Pin an exact version.
|
|
66
|
+
|
|
67
|
+
## Licence
|
|
68
|
+
|
|
69
|
+
Apache 2.0. The tarball carries `LICENSE` and `NOTICE`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Plain-JS bin shim — deliberately NOT TypeScript, so it can start under whatever
|
|
3
|
+
// Node a user has BEFORE the prerequisites step has told them to upgrade. It re-execs
|
|
4
|
+
// through this package's own `tsx` dependency against the real TS entry (src/cli.ts).
|
|
5
|
+
// tsx is a real runtime dependency of THIS package, not a dev one, for exactly that
|
|
6
|
+
// reason: the package ships its `src/**` sources raw and has no compiled `dist/` of
|
|
7
|
+
// its own.
|
|
8
|
+
//
|
|
9
|
+
// THE PACKAGE IS `@open-everywhere/create`; THIS BIN IS `create-open-everywhere` (OPE-2234).
|
|
10
|
+
// The two names differ on purpose. The package sits in the npm org's scope with the other eight,
|
|
11
|
+
// and `npm create @open-everywhere` resolves it there. The bin keeps the command name a scaffolded
|
|
12
|
+
// app's `check` script already runs. One bin is declared, so `npm exec` picks it either way.
|
|
13
|
+
//
|
|
14
|
+
// WHAT IT WRITES. With a `<dir>` argument it SCAFFOLDS, and that is the only write: it copies the
|
|
15
|
+
// quickstart app (`template/`) into a new or empty `<dir>` (`src/scaffold.ts`) and prints the next
|
|
16
|
+
// steps. With `--check` it only REPORTS on the current directory — every step is a pure `check()`,
|
|
17
|
+
// so there are no prompts, no writes, no subprocesses and no telemetry. There is no wizard and no
|
|
18
|
+
// resume state since OPE-2233: setup is agent-led, and the agent drives the `open-everywhere-ops`
|
|
19
|
+
// MCP server, which owns the writes this CLI used to make.
|
|
20
|
+
|
|
21
|
+
import { spawn } from "node:child_process";
|
|
22
|
+
import { readFileSync } from "node:fs";
|
|
23
|
+
import { createRequire } from "node:module";
|
|
24
|
+
import { dirname, join } from "node:path";
|
|
25
|
+
import { fileURLToPath } from "node:url";
|
|
26
|
+
|
|
27
|
+
const require = createRequire(import.meta.url);
|
|
28
|
+
|
|
29
|
+
let tsxCli;
|
|
30
|
+
try {
|
|
31
|
+
// tsx's own "exports" map doesn't expose "./dist/cli.mjs" as a subpath, so we
|
|
32
|
+
// resolve its (exported) package.json instead and derive the bin path from
|
|
33
|
+
// its own declared "bin" field. npm allows that field in two shapes — a bare
|
|
34
|
+
// string, or a name→path map — and tsx ships the string form today (4.23.x).
|
|
35
|
+
// Read BOTH, so a tsx release that switches shape cannot silently produce
|
|
36
|
+
// `join(dir, undefined)` and a confusing MODULE_NOT_FOUND from the child.
|
|
37
|
+
const tsxPkgPath = require.resolve("tsx/package.json");
|
|
38
|
+
const tsxPkg = JSON.parse(readFileSync(tsxPkgPath, "utf8"));
|
|
39
|
+
const tsxBin = typeof tsxPkg.bin === "string" ? tsxPkg.bin : tsxPkg.bin?.tsx;
|
|
40
|
+
if (typeof tsxBin !== "string") throw new Error(`tsx@${tsxPkg.version} declares no usable "bin" entry`);
|
|
41
|
+
tsxCli = join(dirname(tsxPkgPath), tsxBin);
|
|
42
|
+
} catch (err) {
|
|
43
|
+
console.error("create-open-everywhere: could not resolve its `tsx` dependency — try `npm install` in this package first.");
|
|
44
|
+
console.error(err instanceof Error ? err.message : err);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const cliEntry = fileURLToPath(new URL("../src/cli.ts", import.meta.url));
|
|
49
|
+
const child = spawn(process.execPath, [tsxCli, cliEntry, ...process.argv.slice(2)], { stdio: "inherit" });
|
|
50
|
+
child.on("exit", (code, signal) => {
|
|
51
|
+
if (signal) process.kill(process.pid, signal);
|
|
52
|
+
else process.exit(code ?? 0);
|
|
53
|
+
});
|
|
54
|
+
child.on("error", (err) => {
|
|
55
|
+
console.error("create-open-everywhere: failed to start:", err instanceof Error ? err.message : err);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@open-everywhere/create",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "npx scaffold and setup check for Open Everywhere — one step engine, reported by --check for an agent-led setup.",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"agent",
|
|
9
|
+
"cli",
|
|
10
|
+
"installer",
|
|
11
|
+
"scaffold",
|
|
12
|
+
"slack",
|
|
13
|
+
"self-hosted",
|
|
14
|
+
"create"
|
|
15
|
+
],
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/open-everywhere/open-everywhere.git",
|
|
19
|
+
"directory": "packages/create"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18"
|
|
26
|
+
},
|
|
27
|
+
"bin": {
|
|
28
|
+
"create-open-everywhere": "./bin/create-open-everywhere.js"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin",
|
|
32
|
+
"src",
|
|
33
|
+
"template",
|
|
34
|
+
"NOTICE",
|
|
35
|
+
"LICENSE"
|
|
36
|
+
],
|
|
37
|
+
"scripts": {
|
|
38
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
39
|
+
"cli": "tsx src/cli.ts",
|
|
40
|
+
"test:engine": "tsx scripts/engine-test.ts",
|
|
41
|
+
"test:cli": "tsx scripts/cli-check-test.ts",
|
|
42
|
+
"test": "npm run test:chain",
|
|
43
|
+
"test:chain": "npm run test:engine && npm run test:scaffold && npm run test:cli && npm run test:env-pipe && npm run test:boot-free",
|
|
44
|
+
"test:boot-free": "tsx scripts/boot-free-test.ts",
|
|
45
|
+
"test:scaffold": "tsx scripts/scaffold-test.ts",
|
|
46
|
+
"test:env-pipe": "tsx scripts/env-pipe-test.ts"
|
|
47
|
+
},
|
|
48
|
+
"dependencies": {
|
|
49
|
+
"@open-everywhere/core": "0.1.4",
|
|
50
|
+
"@open-everywhere/provider-slack": "0.1.4",
|
|
51
|
+
"tsx": "^4.23.9"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/node": "latest",
|
|
55
|
+
"typescript": "latest"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/cli.ts
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
// The npx CLI frontend (`@open-everywhere/create`, whose bin is `create-open-everywhere`). Thin: the real
|
|
2
|
+
// logic lives in engine.ts plus the step modules; this file only wires argv → context → the
|
|
3
|
+
// orchestrator, and owns the one module-level concern an entry point should own: exit codes.
|
|
4
|
+
//
|
|
5
|
+
// TWO JOBS, AND NOTHING ELSE (OPE-2233):
|
|
6
|
+
// 1. `<dir>` SCAFFOLDS the quickstart app (scaffold.ts) and prints what to do next.
|
|
7
|
+
// 2. `--check [--json]` REPORTS the setup steps for the current directory. Pure `check()` calls:
|
|
8
|
+
// no prompts, no writes, no network except the `--host` deploy probe, and no telemetry.
|
|
9
|
+
//
|
|
10
|
+
// 🔴 THERE IS NO INTERACTIVE WIZARD, AND THIS CLI SENDS NO TELEMETRY. The TTY wizard is retired:
|
|
11
|
+
// setup is AGENT-LED (open the app in a coding agent, which reads AGENTS.md and drives the
|
|
12
|
+
// `open-everywhere-ops` MCP server plus this `--check` report). The wizard was also the ONLY
|
|
13
|
+
// consent surface for the `wizard.started`/`wizard.completed` events, and consent for those can
|
|
14
|
+
// only be given by a person at a keyboard — so the events, the `--decline-telemetry` flag and the
|
|
15
|
+
// resume-state file went with it. See docs/deploy/telemetry.md.
|
|
16
|
+
|
|
17
|
+
import { checkAll, isSetupRoute, SETUP_ROUTES, type SetupRoute, type StepContext } from "./engine.js";
|
|
18
|
+
import { SETUP_STEPS } from "./steps/index.js";
|
|
19
|
+
import { CLI_VERSION } from "./version.js";
|
|
20
|
+
import { initGitRepo, scaffoldApp, ScaffoldRefusal } from "./scaffold.js";
|
|
21
|
+
import { resolve } from "node:path";
|
|
22
|
+
import { pathToFileURL } from "node:url";
|
|
23
|
+
import { slackAppNameProblem } from "@open-everywhere/provider-slack/agent/app-manifest.js";
|
|
24
|
+
|
|
25
|
+
const USAGE = `create-open-everywhere [<dir>] [--check [--json]] [--route vercel|docker] [--host <url>]
|
|
26
|
+
[--app-name <name>] [--version] [--help]
|
|
27
|
+
|
|
28
|
+
<dir> Scaffold the quickstart app into <dir> (a new or empty
|
|
29
|
+
directory), then print the next steps and exit. It never
|
|
30
|
+
prompts: setup is agent-led.
|
|
31
|
+
--check Status report for the current directory. No prompts, no
|
|
32
|
+
changes, no telemetry. Exit 0 if every step is satisfied,
|
|
33
|
+
else 1. It never scaffolds.
|
|
34
|
+
--json With --check: print the report as one JSON object.
|
|
35
|
+
--route <r> The deployment route the steps judge against: 'vercel'
|
|
36
|
+
(default — the Vercel CLI and Marketplace Neon) or 'docker'
|
|
37
|
+
(self-host against the deployment contract). These are the
|
|
38
|
+
two supported routes. A local run is the development loop
|
|
39
|
+
after a deploy, never a route.
|
|
40
|
+
--host <url> The deployment's public origin. The build + deploy step
|
|
41
|
+
probes its Slack route.
|
|
42
|
+
--app-name <name>
|
|
43
|
+
The Slack app's name in the manifest the Slack step prints
|
|
44
|
+
(default "Open Everywhere"). A second install in one
|
|
45
|
+
workspace needs its own name.
|
|
46
|
+
--version Print this CLI's version.
|
|
47
|
+
--help Print this message.
|
|
48
|
+
|
|
49
|
+
Setup itself is agent-led: open the app in your coding agent and ask it to set
|
|
50
|
+
up Open Everywhere. It reads AGENTS.md, drives the open-everywhere-ops MCP
|
|
51
|
+
server, and reads this command's --check report.
|
|
52
|
+
`;
|
|
53
|
+
|
|
54
|
+
/** What to say when the command is given nothing to do. */
|
|
55
|
+
const NOTHING_TO_DO = `Nothing to do. @open-everywhere/create scaffolds an app (\`npx @open-everywhere/create <dir>\`) and reports setup status (\`npx @open-everywhere/create --check --json\`).
|
|
56
|
+
|
|
57
|
+
To set this app up, open it in your coding agent and ask it to set up Open Everywhere: it reads AGENTS.md and drives the open-everywhere-ops MCP server. \`--help\` lists every flag.`;
|
|
58
|
+
|
|
59
|
+
/** The parsed command line. Flags that take a value accept `--flag value` and `--flag=value`. */
|
|
60
|
+
export interface ParsedArgs {
|
|
61
|
+
readonly dirs: readonly string[];
|
|
62
|
+
readonly flags: ReadonlySet<string>;
|
|
63
|
+
readonly route?: SetupRoute;
|
|
64
|
+
readonly host?: string;
|
|
65
|
+
readonly appName?: string;
|
|
66
|
+
readonly errors: readonly string[];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const VALUE_FLAGS = new Set(["--route", "--host", "--app-name"]);
|
|
70
|
+
|
|
71
|
+
/** Every bare flag this CLI accepts. Anything else is a typo, and a typo is an error rather than a
|
|
72
|
+
* silently ignored word: `--goal hosted` (the retired flag) must not read as "check, with
|
|
73
|
+
* defaults". */
|
|
74
|
+
const BARE_FLAGS = new Set(["--check", "--json", "--help", "-h", "--version", "-v"]);
|
|
75
|
+
|
|
76
|
+
export function parseArgs(argv: readonly string[]): ParsedArgs {
|
|
77
|
+
const dirs: string[] = [];
|
|
78
|
+
const flags = new Set<string>();
|
|
79
|
+
const values: Record<string, string> = {};
|
|
80
|
+
const errors: string[] = [];
|
|
81
|
+
for (let i = 0; i < argv.length; i++) {
|
|
82
|
+
const arg = argv[i]!;
|
|
83
|
+
if (!arg.startsWith("-")) {
|
|
84
|
+
dirs.push(arg);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const eq = arg.indexOf("=");
|
|
88
|
+
const name = eq >= 0 ? arg.slice(0, eq) : arg;
|
|
89
|
+
if (VALUE_FLAGS.has(name)) {
|
|
90
|
+
const value = eq >= 0 ? arg.slice(eq + 1) : argv[++i];
|
|
91
|
+
if (value === undefined || value === "" || value.startsWith("--")) errors.push(`${name} needs a value`);
|
|
92
|
+
else values[name] = value;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (!BARE_FLAGS.has(name)) {
|
|
96
|
+
errors.push(
|
|
97
|
+
name === "--goal"
|
|
98
|
+
? "--goal is retired: pass --route vercel or --route docker (the local goal is gone — a local run is the development loop, not a setup route)"
|
|
99
|
+
: name === "--skip-wizard" || name === "--decline-telemetry"
|
|
100
|
+
? `${name} is retired: the interactive wizard is gone, so a scaffold never prompts and this CLI sends no telemetry`
|
|
101
|
+
: `unknown flag ${name} — run --help`,
|
|
102
|
+
);
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
flags.add(name);
|
|
106
|
+
}
|
|
107
|
+
const route = values["--route"];
|
|
108
|
+
if (route !== undefined && !isSetupRoute(route)) errors.push(`--route must be one of ${SETUP_ROUTES.join(" | ")}, got "${route}"`);
|
|
109
|
+
const appName = values["--app-name"];
|
|
110
|
+
if (appName !== undefined) {
|
|
111
|
+
const problem = slackAppNameProblem(appName);
|
|
112
|
+
if (problem !== undefined) errors.push(`--app-name: ${problem}`);
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
dirs,
|
|
116
|
+
flags,
|
|
117
|
+
...(route !== undefined && isSetupRoute(route) ? { route } : {}),
|
|
118
|
+
host: values["--host"],
|
|
119
|
+
...(appName === undefined ? {} : { appName: appName.trim() }),
|
|
120
|
+
errors,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function buildContext(args: ParsedArgs): StepContext {
|
|
125
|
+
return {
|
|
126
|
+
cwd: process.cwd(),
|
|
127
|
+
env: process.env,
|
|
128
|
+
route: args.route ?? "vercel",
|
|
129
|
+
...(args.host !== undefined ? { host: args.host } : {}),
|
|
130
|
+
...(args.appName !== undefined ? { appName: args.appName } : {}),
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function runCheckMode(json: boolean, args: ParsedArgs): Promise<number> {
|
|
135
|
+
const ctx = buildContext(args);
|
|
136
|
+
const summary = await checkAll(SETUP_STEPS, ctx);
|
|
137
|
+
if (json) {
|
|
138
|
+
// The machine-readable report a coding agent reads. One object, on stdout, and nothing else.
|
|
139
|
+
const report = {
|
|
140
|
+
version: CLI_VERSION,
|
|
141
|
+
cwd: ctx.cwd,
|
|
142
|
+
route: ctx.route,
|
|
143
|
+
satisfiedCount: summary.satisfiedCount,
|
|
144
|
+
total: summary.total,
|
|
145
|
+
allSatisfied: summary.allSatisfied,
|
|
146
|
+
steps: summary.results.map((r) => ({
|
|
147
|
+
id: r.step.id,
|
|
148
|
+
title: r.step.title,
|
|
149
|
+
satisfied: r.check.satisfied,
|
|
150
|
+
detail: r.check.detail,
|
|
151
|
+
...(r.check.next !== undefined ? { next: r.check.next } : {}),
|
|
152
|
+
})),
|
|
153
|
+
};
|
|
154
|
+
console.log(JSON.stringify(report, null, 2));
|
|
155
|
+
return summary.allSatisfied ? 0 : 1;
|
|
156
|
+
}
|
|
157
|
+
for (const r of summary.results) {
|
|
158
|
+
console.log(`${r.check.satisfied ? "✓" : "✗"} ${r.step.title}: ${r.check.detail}`);
|
|
159
|
+
if (r.check.next !== undefined) console.log(` next: ${r.check.next}`);
|
|
160
|
+
}
|
|
161
|
+
console.log(`\n${summary.satisfiedCount}/${summary.total} steps satisfied (route: ${ctx.route}).`);
|
|
162
|
+
return summary.allSatisfied ? 0 : 1;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function runScaffold(target: string): string | undefined {
|
|
166
|
+
try {
|
|
167
|
+
const result = scaffoldApp({ targetDir: target, version: CLI_VERSION });
|
|
168
|
+
console.log(`Scaffolded the Open Everywhere quickstart app (${result.files.length} files, version ${CLI_VERSION}) into ${result.dir}`);
|
|
169
|
+
console.log(`git: ${initGitRepo(result.dir).detail}`);
|
|
170
|
+
return result.dir;
|
|
171
|
+
} catch (err) {
|
|
172
|
+
if (err instanceof ScaffoldRefusal) {
|
|
173
|
+
console.error(err.message);
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
throw err;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/** What to do after a scaffold. The scaffold never prompts, so this is always printed. */
|
|
181
|
+
function nextSteps(target: string): string {
|
|
182
|
+
return [
|
|
183
|
+
"Next, from the new app:",
|
|
184
|
+
// A scaffold into `.` (a fresh clone) is already in the app, so it gets no `cd` line.
|
|
185
|
+
...(resolve(target) === process.cwd() ? [] : [` cd ${target}`]),
|
|
186
|
+
" npm install # its postinstall applies the eve patch",
|
|
187
|
+
"Then open the app in your coding agent and ask it to set up Open Everywhere. It reads",
|
|
188
|
+
"AGENTS.md, drives the open-everywhere-ops MCP server, and asks you to pick a route:",
|
|
189
|
+
"Vercel or Docker. The app's README.md is one screen; the full step list is the reference",
|
|
190
|
+
"page it links to.",
|
|
191
|
+
"",
|
|
192
|
+
" npx @open-everywhere/create --check --json # setup status, as data (--route docker for the Docker route)",
|
|
193
|
+
].join("\n");
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export async function main(argv: readonly string[]): Promise<number> {
|
|
197
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
198
|
+
console.log(USAGE);
|
|
199
|
+
return 0;
|
|
200
|
+
}
|
|
201
|
+
if (argv.includes("--version") || argv.includes("-v")) {
|
|
202
|
+
console.log(CLI_VERSION);
|
|
203
|
+
return 0;
|
|
204
|
+
}
|
|
205
|
+
const args = parseArgs(argv);
|
|
206
|
+
if (args.errors.length > 0) {
|
|
207
|
+
for (const e of args.errors) console.error(e);
|
|
208
|
+
return 2;
|
|
209
|
+
}
|
|
210
|
+
const { dirs, flags } = args;
|
|
211
|
+
if (dirs.length > 1) {
|
|
212
|
+
console.error(`create-open-everywhere takes at most one directory, got ${dirs.length}: ${dirs.join(" ")}`);
|
|
213
|
+
return 2;
|
|
214
|
+
}
|
|
215
|
+
const target = dirs[0];
|
|
216
|
+
if (target === undefined) {
|
|
217
|
+
if (flags.has("--check")) return runCheckMode(flags.has("--json"), args);
|
|
218
|
+
console.log(NOTHING_TO_DO);
|
|
219
|
+
return 0;
|
|
220
|
+
}
|
|
221
|
+
if (flags.has("--check")) {
|
|
222
|
+
console.error("--check changes nothing, so it cannot scaffold. Scaffold first, then run --check from inside the app.");
|
|
223
|
+
return 2;
|
|
224
|
+
}
|
|
225
|
+
const dir = runScaffold(target);
|
|
226
|
+
if (dir === undefined) return 1;
|
|
227
|
+
console.log(nextSteps(target));
|
|
228
|
+
return 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Only run when invoked directly (not when imported by a test).
|
|
232
|
+
const isDirectRun = process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
233
|
+
if (isDirectRun) {
|
|
234
|
+
main(process.argv.slice(2)).then(
|
|
235
|
+
(code) => process.exit(code),
|
|
236
|
+
(err) => {
|
|
237
|
+
console.error(err instanceof Error ? err.stack ?? err.message : err);
|
|
238
|
+
process.exit(1);
|
|
239
|
+
},
|
|
240
|
+
);
|
|
241
|
+
}
|