@oxprotocol/cli 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 +189 -0
- package/README.md +73 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +109 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/create.d.ts +6 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +212 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/dev.d.ts +2 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +191 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/doctor.d.ts +16 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +197 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/install-url.d.ts +20 -0
- package/dist/commands/install-url.d.ts.map +1 -0
- package/dist/commands/install-url.js +236 -0
- package/dist/commands/install-url.js.map +1 -0
- package/dist/commands/install.d.ts +13 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +411 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/keygen.d.ts +13 -0
- package/dist/commands/keygen.d.ts.map +1 -0
- package/dist/commands/keygen.js +40 -0
- package/dist/commands/keygen.js.map +1 -0
- package/dist/commands/login.d.ts +21 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +224 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +17 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +70 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/pack.d.ts +12 -0
- package/dist/commands/pack.d.ts.map +1 -0
- package/dist/commands/pack.js +94 -0
- package/dist/commands/pack.js.map +1 -0
- package/dist/commands/protocol-register.d.ts +29 -0
- package/dist/commands/protocol-register.d.ts.map +1 -0
- package/dist/commands/protocol-register.js +231 -0
- package/dist/commands/protocol-register.js.map +1 -0
- package/dist/commands/publish.d.ts +17 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +188 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/token.d.ts +17 -0
- package/dist/commands/token.d.ts.map +1 -0
- package/dist/commands/token.js +110 -0
- package/dist/commands/token.js.map +1 -0
- package/dist/commands/whoami.d.ts +13 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +77 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/broadcast.d.ts +41 -0
- package/dist/lib/broadcast.d.ts.map +1 -0
- package/dist/lib/broadcast.js +45 -0
- package/dist/lib/broadcast.js.map +1 -0
- package/dist/lib/host-adapter.d.ts +72 -0
- package/dist/lib/host-adapter.d.ts.map +1 -0
- package/dist/lib/host-adapter.js +193 -0
- package/dist/lib/host-adapter.js.map +1 -0
- package/dist/lib/host-detect.d.ts +60 -0
- package/dist/lib/host-detect.d.ts.map +1 -0
- package/dist/lib/host-detect.js +479 -0
- package/dist/lib/host-detect.js.map +1 -0
- package/dist/lib/oxp-url.d.ts +34 -0
- package/dist/lib/oxp-url.d.ts.map +1 -0
- package/dist/lib/oxp-url.js +74 -0
- package/dist/lib/oxp-url.js.map +1 -0
- package/dist/lib/vsx-install.d.ts +41 -0
- package/dist/lib/vsx-install.d.ts.map +1 -0
- package/dist/lib/vsx-install.js +74 -0
- package/dist/lib/vsx-install.js.map +1 -0
- package/dist/util.d.ts +10 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +64 -0
- package/dist/util.js.map +1 -0
- package/package.json +48 -0
- package/templates/hello-code/README.md +39 -0
- package/templates/hello-code/oxp.json +14 -0
- package/templates/hello-code/package.json +18 -0
- package/templates/hello-code/src/extension.ts +17 -0
- package/templates/hello-code/tsconfig.json +20 -0
- package/templates/hello-html/README.md +18 -0
- package/templates/hello-html/oxp.json +14 -0
- package/templates/hello-html/ui/index.html +43 -0
- package/templates/hello-rust/Cargo.toml +19 -0
- package/templates/hello-rust/README.md +50 -0
- package/templates/hello-rust/oxp.json +22 -0
- package/templates/hello-rust/src/lib.rs +111 -0
- package/templates/hello-rust/wit/deps/oxp-host/oxp-host.wit +136 -0
- package/templates/hello-rust/wit/extension.wit +71 -0
- package/templates/hello-tree/README.md +15 -0
- package/templates/hello-tree/oxp.json +14 -0
- package/templates/hello-tree/ui/tree.json +27 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
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 tracking or 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 describing the origin of the Work and
|
|
141
|
+
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 Support. While redistributing the Work or
|
|
166
|
+
Derivative Works thereof, You may accept and offer support, warranty,
|
|
167
|
+
indemnity, or other liability obligations consistent with this
|
|
168
|
+
License. However, in accepting such obligations, You may act only
|
|
169
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
170
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
171
|
+
defend, and hold each Contributor harmless for any liability
|
|
172
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
173
|
+
of your accepting any such warranty or support.
|
|
174
|
+
|
|
175
|
+
END OF TERMS AND CONDITIONS
|
|
176
|
+
|
|
177
|
+
Copyright 2025 OXP contributors
|
|
178
|
+
|
|
179
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
180
|
+
you may not use this file except in compliance with the License.
|
|
181
|
+
You may obtain a copy of the License at
|
|
182
|
+
|
|
183
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
184
|
+
|
|
185
|
+
Unless required by applicable law or agreed to in writing, software
|
|
186
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
187
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
188
|
+
implied. See the License for the specific language governing permissions
|
|
189
|
+
and limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @oxprotocol/cli
|
|
2
|
+
|
|
3
|
+
The official command-line tool for the [Open eXtensions Protocol](https://oxp.dev).
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Pick whichever package manager you already have. The CLI ships as a single
|
|
8
|
+
npm package — there is **no separate installer to download**.
|
|
9
|
+
|
|
10
|
+
### One-shot (no install)
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npx @oxprotocol/cli@latest create my-ext
|
|
14
|
+
pnpm dlx @oxprotocol/cli create my-ext
|
|
15
|
+
yarn dlx @oxprotocol/cli create my-ext
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Persistent install (recommended)
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
npm i -g @oxprotocol/cli # then: oxp <command>
|
|
22
|
+
pnpm add -g @oxprotocol/cli
|
|
23
|
+
yarn global add @oxprotocol/cli
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
After install, `oxp --help` lists every subcommand.
|
|
27
|
+
|
|
28
|
+
### `npm create` shortcut
|
|
29
|
+
|
|
30
|
+
For scaffolding only, the dedicated `create-oxp` wrapper plays nicely with
|
|
31
|
+
the `npm create` / `pnpm create` convention:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
npm create oxp@latest my-ext
|
|
35
|
+
pnpm create oxp my-ext
|
|
36
|
+
yarn create oxp my-ext
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## First run
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
oxp login # email + password, in the terminal (Expo-style)
|
|
43
|
+
oxp login --browser # OR authorise via the web (OAuth device flow)
|
|
44
|
+
|
|
45
|
+
oxp create my-ext # scaffold (pick a template with -t)
|
|
46
|
+
cd my-ext
|
|
47
|
+
oxp dev # watch + hot-reload against a local host
|
|
48
|
+
oxp pack # build a deterministic, signed .oxp bundle
|
|
49
|
+
oxp publish # upload to the registry
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Tokens are stored at `~/.oxp/credentials` (mode 0600). The CLI sends them
|
|
53
|
+
as `Authorization: Bearer <raw>`. Rotate any time with `oxp token rotate`.
|
|
54
|
+
|
|
55
|
+
## Environment
|
|
56
|
+
|
|
57
|
+
| Var | Default | Purpose |
|
|
58
|
+
| -------------- | ------------------------ | ----------------------------- |
|
|
59
|
+
| `OXP_REGISTRY` | `http://localhost:3000` | Registry base URL |
|
|
60
|
+
| `OXP_HOME` | `~/.oxp` | Config + credentials directory |
|
|
61
|
+
|
|
62
|
+
## Programmatic use
|
|
63
|
+
|
|
64
|
+
Subcommand functions are also exported for wrapper packages:
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import { create, pack, publish } from "@oxprotocol/cli";
|
|
68
|
+
const code = await create(["my-ext", "-t", "hello-rust"]);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `oxp` — Open eXtensions Protocol command-line tool.
|
|
4
|
+
*
|
|
5
|
+
* Subcommands:
|
|
6
|
+
* oxp create <name> scaffold a new extension from the hello-world template
|
|
7
|
+
* oxp pack [dir] build a deterministic, signed .oxp bundle from the project
|
|
8
|
+
* oxp login store an API token under ~/.oxp/credentials
|
|
9
|
+
* oxp publish [bundle] POST a .oxp + signature to the registry
|
|
10
|
+
* oxp keygen show the local Ed25519 key id (creating one if needed)
|
|
11
|
+
*
|
|
12
|
+
* No external CLI library — keeps install lean.
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `oxp` — Open eXtensions Protocol command-line tool.
|
|
4
|
+
*
|
|
5
|
+
* Subcommands:
|
|
6
|
+
* oxp create <name> scaffold a new extension from the hello-world template
|
|
7
|
+
* oxp pack [dir] build a deterministic, signed .oxp bundle from the project
|
|
8
|
+
* oxp login store an API token under ~/.oxp/credentials
|
|
9
|
+
* oxp publish [bundle] POST a .oxp + signature to the registry
|
|
10
|
+
* oxp keygen show the local Ed25519 key id (creating one if needed)
|
|
11
|
+
*
|
|
12
|
+
* No external CLI library — keeps install lean.
|
|
13
|
+
*/
|
|
14
|
+
import { create } from "./commands/create.js";
|
|
15
|
+
import { pack } from "./commands/pack.js";
|
|
16
|
+
import { dev } from "./commands/dev.js";
|
|
17
|
+
import { login } from "./commands/login.js";
|
|
18
|
+
import { logout } from "./commands/logout.js";
|
|
19
|
+
import { whoami } from "./commands/whoami.js";
|
|
20
|
+
import { publish } from "./commands/publish.js";
|
|
21
|
+
import { install } from "./commands/install.js";
|
|
22
|
+
import { installUrl } from "./commands/install-url.js";
|
|
23
|
+
import { keygen } from "./commands/keygen.js";
|
|
24
|
+
import { token } from "./commands/token.js";
|
|
25
|
+
import { protocolRegister } from "./commands/protocol-register.js";
|
|
26
|
+
import { doctor } from "./commands/doctor.js";
|
|
27
|
+
const VERSION = "0.1.0";
|
|
28
|
+
const HELP = `oxp ${VERSION} — Open eXtensions Protocol
|
|
29
|
+
|
|
30
|
+
Usage:
|
|
31
|
+
oxp create [-t TPL] <name> Scaffold a new extension in ./<name>
|
|
32
|
+
Templates: hello-html (default), hello-code, hello-tree
|
|
33
|
+
oxp dev [dir] Watch + repack + serve over ws/http (default port 7373)
|
|
34
|
+
oxp pack [dir] Build dist/<slug>-<version>.oxp from <dir> (default: cwd)
|
|
35
|
+
oxp login Sign in (email + password in terminal)
|
|
36
|
+
oxp login --browser Sign in via browser (OAuth device flow)
|
|
37
|
+
oxp logout [--local-only] Revoke local credentials (and the server token by default)
|
|
38
|
+
oxp whoami [--json] Show the identity behind the local credentials
|
|
39
|
+
oxp token rotate Mint a successor token; old token gets a 5-min grace
|
|
40
|
+
oxp publish [bundle] Upload a .oxp + signature to the registry
|
|
41
|
+
oxp publish --dry-run Validate the bundle but do not POST
|
|
42
|
+
oxp install <id> [-y] Install @publisher/slug from the registry into
|
|
43
|
+
$OXP_HOME/host-store/, auto-detect IDEs, and
|
|
44
|
+
keep their host adapters in sync.
|
|
45
|
+
oxp install --from <url> Install from an oxp:// deep link
|
|
46
|
+
oxp install-url <wasm-url> Install a raw .wasm component (https/file/http)
|
|
47
|
+
into the shared host-store. Both VS Code and
|
|
48
|
+
JetBrains hosts pick it up automatically.
|
|
49
|
+
oxp install-url --list List previously URL-installed extensions
|
|
50
|
+
oxp protocol-register Register the oxp:// URL scheme on this machine
|
|
51
|
+
oxp doctor [--json] Inspect this machine and report what OXP can see
|
|
52
|
+
oxp keygen Print the local Ed25519 publisher key id
|
|
53
|
+
oxp help Show this message
|
|
54
|
+
oxp version Print version
|
|
55
|
+
|
|
56
|
+
Environment:
|
|
57
|
+
OXP_REGISTRY Registry base URL (default http://localhost:3000)
|
|
58
|
+
OXP_HOME Config dir (default ~/.oxp)
|
|
59
|
+
`;
|
|
60
|
+
async function main(argv) {
|
|
61
|
+
const [cmd, ...rest] = argv;
|
|
62
|
+
switch (cmd) {
|
|
63
|
+
case undefined:
|
|
64
|
+
case "help":
|
|
65
|
+
case "-h":
|
|
66
|
+
case "--help":
|
|
67
|
+
process.stdout.write(HELP);
|
|
68
|
+
return 0;
|
|
69
|
+
case "version":
|
|
70
|
+
case "-v":
|
|
71
|
+
case "--version":
|
|
72
|
+
process.stdout.write(VERSION + "\n");
|
|
73
|
+
return 0;
|
|
74
|
+
case "create":
|
|
75
|
+
return create(rest);
|
|
76
|
+
case "dev":
|
|
77
|
+
return dev(rest);
|
|
78
|
+
case "pack":
|
|
79
|
+
return pack(rest);
|
|
80
|
+
case "login":
|
|
81
|
+
return login(rest);
|
|
82
|
+
case "logout":
|
|
83
|
+
return logout(rest);
|
|
84
|
+
case "whoami":
|
|
85
|
+
return whoami(rest);
|
|
86
|
+
case "token":
|
|
87
|
+
return token(rest);
|
|
88
|
+
case "publish":
|
|
89
|
+
return publish(rest);
|
|
90
|
+
case "install":
|
|
91
|
+
return install(rest);
|
|
92
|
+
case "install-url":
|
|
93
|
+
return installUrl(rest);
|
|
94
|
+
case "protocol-register":
|
|
95
|
+
return protocolRegister(rest);
|
|
96
|
+
case "doctor":
|
|
97
|
+
return doctor(rest);
|
|
98
|
+
case "keygen":
|
|
99
|
+
return keygen(rest);
|
|
100
|
+
default:
|
|
101
|
+
process.stderr.write(`oxp: unknown command '${cmd}'\n\n` + HELP);
|
|
102
|
+
return 2;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
main(process.argv.slice(2)).then((code) => process.exit(code), (err) => {
|
|
106
|
+
process.stderr.write(`oxp: ${err.message}\n`);
|
|
107
|
+
process.exit(1);
|
|
108
|
+
});
|
|
109
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,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 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AA0BA;;;GAGG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA0G5D"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { promises as fs } from "node:fs";
|
|
2
|
+
import { join, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { worldSha256 } from "@oxprotocol/wit";
|
|
5
|
+
import { fail, info, readCredentials, registryUrl } from "../util.js";
|
|
6
|
+
/**
|
|
7
|
+
* Templates shipped with the CLI. Add more by dropping a directory in
|
|
8
|
+
* packages/cli/templates/<name>/
|
|
9
|
+
* with placeholder substitutions:
|
|
10
|
+
* __PUBLISHER__ npm-style scope without the leading @
|
|
11
|
+
* __SLUG__ kebab-case project slug
|
|
12
|
+
* __SLUG_UNDERSCORED__ same with - → _ (Rust crate names)
|
|
13
|
+
* __DISPLAY_NAME__ title-cased name for UIs
|
|
14
|
+
* __WIT_SHA__ sha256 of the canonical oxp:extension WIT world
|
|
15
|
+
* this CLI was built against (component-v1 only)
|
|
16
|
+
*/
|
|
17
|
+
const TEMPLATES = [
|
|
18
|
+
"hello-html",
|
|
19
|
+
"hello-code",
|
|
20
|
+
"hello-tree",
|
|
21
|
+
"hello-rust",
|
|
22
|
+
];
|
|
23
|
+
const DEFAULT_TEMPLATE = "hello-html";
|
|
24
|
+
/**
|
|
25
|
+
* `oxp create [--template <name>] <project>` — copy a template into ./<project>,
|
|
26
|
+
* substituting placeholders. Default template: hello-html.
|
|
27
|
+
*/
|
|
28
|
+
export async function create(args) {
|
|
29
|
+
let template = DEFAULT_TEMPLATE;
|
|
30
|
+
const positional = [];
|
|
31
|
+
for (let i = 0; i < args.length; i++) {
|
|
32
|
+
const a = args[i];
|
|
33
|
+
if (a === "--template" || a === "-t") {
|
|
34
|
+
const v = args[++i];
|
|
35
|
+
if (!v)
|
|
36
|
+
fail("usage: oxp create --template <name> <project>");
|
|
37
|
+
assertTemplate(v);
|
|
38
|
+
template = v;
|
|
39
|
+
}
|
|
40
|
+
else if (a.startsWith("--template=")) {
|
|
41
|
+
const v = a.slice("--template=".length);
|
|
42
|
+
assertTemplate(v);
|
|
43
|
+
template = v;
|
|
44
|
+
}
|
|
45
|
+
else if (a === "--list-templates") {
|
|
46
|
+
process.stdout.write(TEMPLATES.join("\n") + "\n");
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
positional.push(a);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const name = positional[0];
|
|
54
|
+
if (!name)
|
|
55
|
+
fail("usage: oxp create [--template <name>] <project>\n" +
|
|
56
|
+
` templates: ${TEMPLATES.join(", ")}`);
|
|
57
|
+
const slug = name.toLowerCase();
|
|
58
|
+
if (!/^[a-z0-9-]+$/.test(slug)) {
|
|
59
|
+
fail(`'${name}' is not a valid slug (lowercase letters, digits, dashes only)`);
|
|
60
|
+
}
|
|
61
|
+
const dest = resolve(process.cwd(), name);
|
|
62
|
+
try {
|
|
63
|
+
await fs.access(dest);
|
|
64
|
+
fail(`destination '${name}' already exists`);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
// good
|
|
68
|
+
}
|
|
69
|
+
const here = fileURLToPath(import.meta.url);
|
|
70
|
+
const templateDir = await locateTemplate(here, template);
|
|
71
|
+
if (!templateDir)
|
|
72
|
+
fail(`could not find template '${template}'`);
|
|
73
|
+
const publisher = await resolvePublisher();
|
|
74
|
+
const displayName = name
|
|
75
|
+
.split(/[-_\s]+/)
|
|
76
|
+
.filter(Boolean)
|
|
77
|
+
.map((w) => w[0].toUpperCase() + w.slice(1))
|
|
78
|
+
.join(" ");
|
|
79
|
+
// Rust crate / wasm artefact names cannot contain dashes.
|
|
80
|
+
const slugUnderscored = slug.replace(/-/g, "_");
|
|
81
|
+
// Only computed for component-v1 templates that ship `wit/`. Reading
|
|
82
|
+
// the canonical world from disk is cheap (~5 KB), so unconditional.
|
|
83
|
+
const witSha = worldSha256();
|
|
84
|
+
await copyTree(templateDir, dest, (txt) => txt
|
|
85
|
+
.replaceAll("__PUBLISHER__", publisher)
|
|
86
|
+
.replaceAll("__SLUG_UNDERSCORED__", slugUnderscored)
|
|
87
|
+
.replaceAll("__SLUG__", slug)
|
|
88
|
+
.replaceAll("__DISPLAY_NAME__", displayName)
|
|
89
|
+
.replaceAll("__WIT_SHA__", witSha));
|
|
90
|
+
info(`✓ created ${name}/ from template '${template}'`);
|
|
91
|
+
info(` publisher: @${publisher}`);
|
|
92
|
+
info(` slug: ${slug}`);
|
|
93
|
+
info("");
|
|
94
|
+
if (template === "hello-rust") {
|
|
95
|
+
info(`Next steps:`);
|
|
96
|
+
info(` cd ${name}`);
|
|
97
|
+
info(` rustup target add wasm32-wasip2 # one-time`);
|
|
98
|
+
info(` oxp pack # builds + packs`);
|
|
99
|
+
info(` oxp publish # ship it`);
|
|
100
|
+
}
|
|
101
|
+
else if (template === "hello-code") {
|
|
102
|
+
info(`Next steps:`);
|
|
103
|
+
info(` cd ${name}`);
|
|
104
|
+
info(` pnpm install`);
|
|
105
|
+
info(` oxp dev # live reload in IDE`);
|
|
106
|
+
info(` oxp pack && oxp publish # ship it`);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
info(`Next steps:`);
|
|
110
|
+
info(` cd ${name}`);
|
|
111
|
+
info(` oxp dev # live reload in IDE`);
|
|
112
|
+
info(` oxp pack && oxp publish # ship it`);
|
|
113
|
+
}
|
|
114
|
+
return 0;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Resolve the publisher handle to use for the new project.
|
|
118
|
+
*
|
|
119
|
+
* Priority:
|
|
120
|
+
* 1. Logged-in registry handle (from `oxp whoami`)
|
|
121
|
+
* 2. System username ($USER / $USERNAME), normalised to [a-z0-9-]
|
|
122
|
+
*
|
|
123
|
+
* Network call is best-effort with a 3 s timeout — if anything fails we
|
|
124
|
+
* fall back silently so `oxp create` still works offline.
|
|
125
|
+
*/
|
|
126
|
+
async function resolvePublisher() {
|
|
127
|
+
const fallback = (process.env.USER ?? process.env.USERNAME ?? "you")
|
|
128
|
+
.toLowerCase()
|
|
129
|
+
.replace(/[^a-z0-9-]/g, "-");
|
|
130
|
+
const token = await readCredentials();
|
|
131
|
+
if (!token)
|
|
132
|
+
return fallback;
|
|
133
|
+
try {
|
|
134
|
+
const controller = new AbortController();
|
|
135
|
+
const timer = setTimeout(() => controller.abort(), 3_000);
|
|
136
|
+
const res = await fetch(`${registryUrl()}/api/v1/auth/whoami`, {
|
|
137
|
+
headers: { authorization: `Bearer ${token}` },
|
|
138
|
+
signal: controller.signal,
|
|
139
|
+
}).finally(() => clearTimeout(timer));
|
|
140
|
+
if (!res.ok)
|
|
141
|
+
return fallback;
|
|
142
|
+
const body = (await res.json());
|
|
143
|
+
if (body.ok && body.handle)
|
|
144
|
+
return body.handle;
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
// offline or timeout — fall back without noise
|
|
148
|
+
}
|
|
149
|
+
return fallback;
|
|
150
|
+
}
|
|
151
|
+
function assertTemplate(v) {
|
|
152
|
+
if (!TEMPLATES.includes(v)) {
|
|
153
|
+
fail(`unknown template '${v}'. available: ${TEMPLATES.join(", ")}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
async function locateTemplate(fromFile, template) {
|
|
157
|
+
let dir = fromFile;
|
|
158
|
+
for (let i = 0; i < 8; i++) {
|
|
159
|
+
dir = resolve(dir, "..");
|
|
160
|
+
const candidates = [
|
|
161
|
+
join(dir, "templates", template),
|
|
162
|
+
join(dir, "packages/cli/templates", template),
|
|
163
|
+
];
|
|
164
|
+
if (template === "hello-html") {
|
|
165
|
+
candidates.push(join(dir, "examples/hello-world/template"));
|
|
166
|
+
}
|
|
167
|
+
for (const candidate of candidates) {
|
|
168
|
+
try {
|
|
169
|
+
await fs.access(join(candidate, "oxp.json"));
|
|
170
|
+
return candidate;
|
|
171
|
+
}
|
|
172
|
+
catch {
|
|
173
|
+
// keep walking
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
const TEXT_EXT = new Set([
|
|
180
|
+
".json",
|
|
181
|
+
".html",
|
|
182
|
+
".md",
|
|
183
|
+
".txt",
|
|
184
|
+
".js",
|
|
185
|
+
".ts",
|
|
186
|
+
".css",
|
|
187
|
+
".toml",
|
|
188
|
+
".rs",
|
|
189
|
+
".wit",
|
|
190
|
+
".gitignore",
|
|
191
|
+
]);
|
|
192
|
+
async function copyTree(src, dest, transform) {
|
|
193
|
+
await fs.mkdir(dest, { recursive: true });
|
|
194
|
+
for (const entry of await fs.readdir(src, { withFileTypes: true })) {
|
|
195
|
+
const sp = join(src, entry.name);
|
|
196
|
+
const dp = join(dest, entry.name);
|
|
197
|
+
if (entry.isDirectory()) {
|
|
198
|
+
await copyTree(sp, dp, transform);
|
|
199
|
+
}
|
|
200
|
+
else if (entry.isFile()) {
|
|
201
|
+
const ext = entry.name.slice(entry.name.lastIndexOf("."));
|
|
202
|
+
if (TEXT_EXT.has(ext)) {
|
|
203
|
+
const txt = await fs.readFile(sp, "utf8");
|
|
204
|
+
await fs.writeFile(dp, transform(txt));
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
await fs.copyFile(sp, dp);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EA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