@otalan/cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/NOTICE +8 -0
- package/README.md +432 -0
- package/dist/bin.js +75 -0
- package/package.json +71 -0
- package/third-party-licenses.txt +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
https://www.apache.org/licenses/LICENSE-2.0
|
|
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
|
+
https://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
package/README.md
ADDED
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
# `@otalan/cli`
|
|
2
|
+
|
|
3
|
+
Otalan CLI for bundling and publishing OTA update releases for Capacitor and Expo / React Native apps.
|
|
4
|
+
|
|
5
|
+
Published as an npm package, but the CLI itself runs on Bun.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Bun `>= 1.3.11` installed and available on your `PATH`
|
|
10
|
+
- An Otalan **CI key**
|
|
11
|
+
|
|
12
|
+
Do not use the OTA app key in the CLI.
|
|
13
|
+
|
|
14
|
+
## Platform Support
|
|
15
|
+
|
|
16
|
+
The npm package ships a Bun-based CLI entrypoint, not standalone native binaries.
|
|
17
|
+
|
|
18
|
+
- macOS and Linux are supported when Bun `>= 1.3.11` is installed.
|
|
19
|
+
- Windows support is experimental until the CLI release flow is validated on Windows.
|
|
20
|
+
- Native compile scripts exist for macOS, Linux, and Windows maintainers, but the compiled binaries are not included in the npm package.
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
Recommended:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
bun add -g @otalan/cli
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
If you install the package with `npm`, `pnpm`, or `yarn`, `bun` still needs to be installed because the executable runs with `#!/usr/bin/env bun`.
|
|
31
|
+
|
|
32
|
+
Local development from this repo:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
bun ./src/bin.ts help
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Quick Start
|
|
39
|
+
|
|
40
|
+
### Capacitor
|
|
41
|
+
|
|
42
|
+
1. Log in with your CI key:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
otalan login --api-key otalan_ci_xxx
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
2. Link the current repo to your active Otalan app:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
otalan init --app-id com.example.app
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
3. Build your web assets with your app's normal build command.
|
|
55
|
+
|
|
56
|
+
4. Bundle the OTA payload:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
otalan bundle --target capacitor --platform ios --bundle-id 1.0.5
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
5. Publish the release:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
otalan publish --channel production
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
`otalan bundle --target capacitor` packages the built web assets from `dist/` or `www/`, so your app build must run first.
|
|
69
|
+
`otalan publish` waits for server-side validation to finish before it returns.
|
|
70
|
+
|
|
71
|
+
### Expo / React Native
|
|
72
|
+
|
|
73
|
+
1. Log in with your CI key:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
otalan login --api-key otalan_ci_xxx
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
2. Link the current repo to your active Otalan app:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
otalan init --app-id com.example.app
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
3. Bundle the OTA payload:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
otalan bundle --target expo --platform ios --bundle-id 1.0.5
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
4. Publish the release:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
otalan publish --channel production
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`otalan bundle --target expo` runs `bunx expo export`, packages the exported JS bundle and assets, and stores the resolved Expo config in the Otalan manifest for publish.
|
|
98
|
+
`otalan publish` waits for server-side validation to finish before it returns.
|
|
99
|
+
|
|
100
|
+
## CI/CD Usage
|
|
101
|
+
|
|
102
|
+
The CLI is designed to work well in CI/CD with a project-scoped Otalan CI key.
|
|
103
|
+
|
|
104
|
+
Set these secrets in your CI provider:
|
|
105
|
+
|
|
106
|
+
- `OTALAN_API_KEY`
|
|
107
|
+
- `OTALAN_APP_ID` for an active app
|
|
108
|
+
|
|
109
|
+
Optional:
|
|
110
|
+
|
|
111
|
+
- `OTALAN_API_URL`
|
|
112
|
+
|
|
113
|
+
### CI/CD Example: Capacitor
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
bun install --frozen-lockfile
|
|
117
|
+
bun run build
|
|
118
|
+
otalan login --api-key "$OTALAN_API_KEY" --api-url "${OTALAN_API_URL:-https://api.otalan.com}"
|
|
119
|
+
otalan init --app-id "$OTALAN_APP_ID"
|
|
120
|
+
otalan bundle --target capacitor --platform ios --bundle-from-package
|
|
121
|
+
otalan publish --channel production
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Use your normal app build command before `otalan bundle`. The CLI then packages the built web output from `dist/` or `www/`.
|
|
125
|
+
|
|
126
|
+
### CI/CD Example: Expo / React Native
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
bun install --frozen-lockfile
|
|
130
|
+
otalan login --api-key "$OTALAN_API_KEY" --api-url "${OTALAN_API_URL:-https://api.otalan.com}"
|
|
131
|
+
otalan init --app-id "$OTALAN_APP_ID"
|
|
132
|
+
otalan bundle --target expo --platform ios --bundle-from-package
|
|
133
|
+
otalan publish --channel production
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
This runs `bunx expo export` through the CLI, packages the exported OTA assets, and publishes the resulting bundle through Otalan's validation pipeline.
|
|
137
|
+
|
|
138
|
+
### GitHub Actions Example
|
|
139
|
+
|
|
140
|
+
```yaml
|
|
141
|
+
name: Publish OTA
|
|
142
|
+
|
|
143
|
+
on:
|
|
144
|
+
workflow_dispatch:
|
|
145
|
+
|
|
146
|
+
jobs:
|
|
147
|
+
publish-ios:
|
|
148
|
+
runs-on: ubuntu-latest
|
|
149
|
+
steps:
|
|
150
|
+
- uses: actions/checkout@v4
|
|
151
|
+
|
|
152
|
+
- uses: oven-sh/setup-bun@v2
|
|
153
|
+
with:
|
|
154
|
+
bun-version: 1.3.11
|
|
155
|
+
|
|
156
|
+
- run: bun install --frozen-lockfile
|
|
157
|
+
- run: bun add -g @otalan/cli
|
|
158
|
+
- run: bun run build
|
|
159
|
+
- run: otalan login --api-key "$OTALAN_API_KEY"
|
|
160
|
+
env:
|
|
161
|
+
OTALAN_API_KEY: ${{ secrets.OTALAN_API_KEY }}
|
|
162
|
+
- run: otalan init --app-id "$OTALAN_APP_ID"
|
|
163
|
+
env:
|
|
164
|
+
OTALAN_APP_ID: ${{ secrets.OTALAN_APP_ID }}
|
|
165
|
+
- run: otalan bundle --target capacitor --platform ios --bundle-from-package
|
|
166
|
+
- run: otalan publish --channel production
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Adjust the build step and bundle target for your app:
|
|
170
|
+
|
|
171
|
+
- Capacitor: keep your web build step and use `--target capacitor`
|
|
172
|
+
- Expo / React Native: remove the web build step if not needed and use `--target expo`
|
|
173
|
+
|
|
174
|
+
## What It Does
|
|
175
|
+
|
|
176
|
+
- logs into the Otalan API
|
|
177
|
+
- checks API connectivity and CI key context
|
|
178
|
+
- links the current repo to an Otalan app
|
|
179
|
+
- bundles Capacitor or Expo / React Native OTA output
|
|
180
|
+
- publishes a bundle with rollout metadata
|
|
181
|
+
- lists published bundles
|
|
182
|
+
- rolls back to an older bundle
|
|
183
|
+
- shows current bundle status
|
|
184
|
+
|
|
185
|
+
The CLI supports one release write path: `otalan publish`. There is no separate `upload` command.
|
|
186
|
+
|
|
187
|
+
## Config Files
|
|
188
|
+
|
|
189
|
+
Global auth config:
|
|
190
|
+
|
|
191
|
+
```text
|
|
192
|
+
~/.otalan/config.json
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Project config:
|
|
196
|
+
|
|
197
|
+
```text
|
|
198
|
+
otalan.config.json
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Example project config:
|
|
202
|
+
|
|
203
|
+
```json
|
|
204
|
+
{
|
|
205
|
+
"organizationSlug": "test-org-407b69f7",
|
|
206
|
+
"projectSlug": "test-project-ca3bcb8a",
|
|
207
|
+
"appId": "com.example.app"
|
|
208
|
+
}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
`otalan.config.json` only links the repo to an Otalan project/app. Bundle and release targeting data such as `target`, `platform`, `nativeVersion`, and `bundleId` live in `.otalan/bundle/manifest.json`.
|
|
212
|
+
|
|
213
|
+
## Command Reference
|
|
214
|
+
|
|
215
|
+
### `otalan help`
|
|
216
|
+
|
|
217
|
+
Shows the available commands.
|
|
218
|
+
|
|
219
|
+
### `otalan login`
|
|
220
|
+
|
|
221
|
+
Saves the CI key and API base URL locally.
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
otalan login --api-key otalan_ci_xxx --api-url https://api.otalan.com
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Local development:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
otalan login --api-key otalan_ci_xxx --api-url http://localhost:8787
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### `otalan doctor`
|
|
234
|
+
|
|
235
|
+
Checks API connectivity and prints the organization/project context resolved from the configured CI key.
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
otalan doctor
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
CI usage without saved local auth:
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
otalan doctor --api-key "$OTALAN_API_KEY" --api-url "${OTALAN_API_URL:-https://api.otalan.com}"
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### `otalan init`
|
|
248
|
+
|
|
249
|
+
Creates `otalan.config.json` in the current project.
|
|
250
|
+
|
|
251
|
+
`appId` is the registered app ID shown under the app name on the Apps page in Otalan. It is scoped to the current project, not globally unique across all projects. The app must be active; archived apps are treated as unavailable for CI publish, rollback, status, and bundle listing commands.
|
|
252
|
+
|
|
253
|
+
If you already ran `otalan login`, the CLI resolves `organizationSlug` and `projectSlug` automatically from the CI key and stores them as a safety check.
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
otalan init \
|
|
257
|
+
--app-id app.cryptosan.app
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### `otalan bundle`
|
|
261
|
+
|
|
262
|
+
Builds `.otalan/bundle/bundle.zip` and `.otalan/bundle/manifest.json`.
|
|
263
|
+
|
|
264
|
+
Capacitor:
|
|
265
|
+
|
|
266
|
+
```bash
|
|
267
|
+
otalan bundle --target capacitor --platform ios
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Expo / React Native:
|
|
271
|
+
|
|
272
|
+
```bash
|
|
273
|
+
otalan bundle --target expo --platform ios
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Current behavior:
|
|
277
|
+
|
|
278
|
+
- Build your Capacitor web assets before running `otalan bundle`
|
|
279
|
+
- Capacitor reads `dist/` or `www/`
|
|
280
|
+
- Expo runs `bunx expo export --platform <platform>`
|
|
281
|
+
- Expo stores the resolved Expo app config in `.otalan/bundle/manifest.json` so publish can forward it for `extra.expoClient`
|
|
282
|
+
- both outputs produce a ZIP plus `manifest.json`
|
|
283
|
+
- `--platform` is required so the CLI exports the selected platform and resolves the correct native/runtime version
|
|
284
|
+
|
|
285
|
+
Native version defaults:
|
|
286
|
+
|
|
287
|
+
- Capacitor iOS reads `CFBundleShortVersionString` from `Info.plist` and resolves `$(MARKETING_VERSION)` from the Xcode project when needed
|
|
288
|
+
- Capacitor Android reads `versionName` from `android/app/build.gradle` or `build.gradle.kts`
|
|
289
|
+
- Expo reads the selected platform version from Expo config and falls back to the top-level Expo `version`
|
|
290
|
+
- Expo runtimeVersion reads `--runtime-version`, Expo export metadata, or Expo config runtimeVersion policies/strings
|
|
291
|
+
- `--native-version` overrides auto-detection
|
|
292
|
+
|
|
293
|
+
Choose the bundle ID you want to release:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
otalan bundle --target capacitor --platform ios --bundle-id 1.0.5
|
|
297
|
+
otalan bundle --target expo --platform ios --bundle-id 1.0.5
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
`bundleId` is the customer-facing OTA release identifier for all targets. The CLI maps it to the target-specific metadata internally.
|
|
301
|
+
|
|
302
|
+
If you omit `bundleId`:
|
|
303
|
+
|
|
304
|
+
- the CLI reads `nativeVersion` from the selected native platform and adds a short hash suffix
|
|
305
|
+
- example: `1.0.0-abc123def456`
|
|
306
|
+
|
|
307
|
+
If you want to take the bundle ID from `package.json` instead:
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
otalan bundle --target capacitor --platform ios --bundle-from-package
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
### `otalan publish`
|
|
314
|
+
|
|
315
|
+
Publishes the current bundle output with rollout metadata.
|
|
316
|
+
|
|
317
|
+
`otalan publish` uses the `bundleId`, `platform`, and `nativeVersion` already stored in `.otalan/bundle/manifest.json`. To release `1.0.5`, set it when you run `otalan bundle --bundle-id 1.0.5`.
|
|
318
|
+
|
|
319
|
+
Current behavior:
|
|
320
|
+
|
|
321
|
+
- `channel` is chosen at publish time
|
|
322
|
+
- `--platform` and `--native-version` can override the manifest, but only if they match it
|
|
323
|
+
- `--output-dir` lets you publish a bundle from a non-default folder
|
|
324
|
+
- Expo publish forwards the stored Expo app config when present
|
|
325
|
+
- Otalan validates the release ZIP before the publish completes
|
|
326
|
+
|
|
327
|
+
Default flow:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
otalan publish --channel production
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
This uses `POST /v1/releases/create` and waits for `GET /v1/releases/ingests/:id` to reach `ready` before returning success.
|
|
334
|
+
|
|
335
|
+
If validation fails, `otalan publish` exits non-zero and prints the ingest failure reason when the API provides one. This makes the command safe to use directly in CI/CD pipelines.
|
|
336
|
+
|
|
337
|
+
### `otalan bundles`
|
|
338
|
+
|
|
339
|
+
Lists remote bundles for the current app so you can choose a bundle for rollback or rollout operations.
|
|
340
|
+
|
|
341
|
+
Default resolution order:
|
|
342
|
+
|
|
343
|
+
1. `--native-version`
|
|
344
|
+
2. `.otalan/bundle/manifest.json` if present and the manifest platform matches the selected platform
|
|
345
|
+
3. native version derived from the selected platform in the local app project
|
|
346
|
+
4. interactive prompt
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
otalan bundles --platform ios --channel production
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### `otalan rollback`
|
|
353
|
+
|
|
354
|
+
Reactivates an older bundle for the same tuple.
|
|
355
|
+
|
|
356
|
+
`rollback` uses the same native-version default order as `bundles`. Pass `--native-version` if you want to override the detected default.
|
|
357
|
+
|
|
358
|
+
```bash
|
|
359
|
+
otalan rollback --bundle-id 1.0.0-web.1 --platform ios --channel production
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### `otalan status`
|
|
363
|
+
|
|
364
|
+
Shows the active bundle for the selected release tuple.
|
|
365
|
+
|
|
366
|
+
`status` also uses the same native-version default order as `bundles`.
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
otalan status --platform ios --channel production
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Bundle Output
|
|
373
|
+
|
|
374
|
+
### Capacitor Manifest
|
|
375
|
+
|
|
376
|
+
```json
|
|
377
|
+
{
|
|
378
|
+
"target": "capacitor",
|
|
379
|
+
"hash": "sha256...",
|
|
380
|
+
"nativeVersion": "1.0.0",
|
|
381
|
+
"bundleId": "1.0.0-abcdef123456",
|
|
382
|
+
"createdAt": "2026-04-07T12:00:00.000Z",
|
|
383
|
+
"platform": "ios"
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
### Expo Manifest
|
|
388
|
+
|
|
389
|
+
```json
|
|
390
|
+
{
|
|
391
|
+
"target": "expo",
|
|
392
|
+
"hash": "sha256...",
|
|
393
|
+
"nativeVersion": "1.0.0",
|
|
394
|
+
"runtimeVersion": "1.0.0",
|
|
395
|
+
"bundleId": "1.0.0-abcdef123456",
|
|
396
|
+
"launchAsset": "bundles/ios-xxxxx.js",
|
|
397
|
+
"assets": [
|
|
398
|
+
"assets/asset_1.png"
|
|
399
|
+
],
|
|
400
|
+
"expoConfig": {
|
|
401
|
+
"name": "Example",
|
|
402
|
+
"slug": "example",
|
|
403
|
+
"scheme": "example"
|
|
404
|
+
},
|
|
405
|
+
"createdAt": "2026-04-07T12:00:00.000Z",
|
|
406
|
+
"platform": "ios"
|
|
407
|
+
}
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
## Maintainer Release Checklist
|
|
411
|
+
|
|
412
|
+
Before publishing a public package release:
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
bun install --frozen-lockfile
|
|
416
|
+
bun test
|
|
417
|
+
bun run check
|
|
418
|
+
bun run lint
|
|
419
|
+
bun run build
|
|
420
|
+
bun pm pack --dry-run
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
`prepublishOnly` reruns tests, TypeScript, and ESLint. The scoped npm package is configured for public publishing through `publishConfig.access`.
|
|
424
|
+
|
|
425
|
+
## Notes
|
|
426
|
+
|
|
427
|
+
- This is a Bun-based CLI published on npm.
|
|
428
|
+
- Expo / React Native bundling uses `bunx expo ...`.
|
|
429
|
+
- Default API URL is `https://api.otalan.com`.
|
|
430
|
+
- Local development API URL is `http://localhost:8787`.
|
|
431
|
+
- Publishing, rollback, status, and `bundles` expect a CI key and an active app.
|
|
432
|
+
- Run `bun run build` after changing CLI source if you want `dist/bin.js` updated locally.
|