@botlr/cli 0.0.0-stage → 0.1.1
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/CHANGELOG.md +16 -0
- package/LICENSE +21 -0
- package/README.md +53 -2
- package/dist/cli.js +715 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +218 -0
- package/dist/index.js +601 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# @botlr/cli
|
|
2
|
+
|
|
3
|
+
## 0.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @botlr/sdk@0.2.0
|
|
9
|
+
|
|
10
|
+
## 0.1.0
|
|
11
|
+
|
|
12
|
+
- First release: `botlr pull`, `botlr push`, `botlr sections list`,
|
|
13
|
+
`botlr sections status` and `botlr sections init`, against the section
|
|
14
|
+
source bridge contract.
|
|
15
|
+
- Config from `botlr.config.json`, `BOTLR_*` environment variables and
|
|
16
|
+
flags; pull state in `.botlr/sections.lock.json`.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Botlr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,54 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @botlr/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The `botlr` command pulls section source from a Botlr site into an app's
|
|
4
|
+
codebase and pushes it back as a new version. It is the client side of the
|
|
5
|
+
section source bridge; `@botlr/sdk` does the HTTP.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add -D @botlr/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Configuration
|
|
12
|
+
|
|
13
|
+
`botlr.config.json` in the app root (the CLI searches upward from the cwd):
|
|
14
|
+
|
|
15
|
+
```json
|
|
16
|
+
{
|
|
17
|
+
"baseUrl": "https://api.botlr.io",
|
|
18
|
+
"appId": "00000000-0000-0000-0000-000000000000",
|
|
19
|
+
"framework": "react-next",
|
|
20
|
+
"sectionsDir": "components/sections"
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Environment: `BOTLR_API_KEY` (site token, for pull/list/status) and
|
|
25
|
+
`BOTLR_PAT` (personal access token with `write:sections`, for push).
|
|
26
|
+
`BOTLR_BASE_URL`, `BOTLR_APP_ID`, `BOTLR_FRAMEWORK` and `BOTLR_SECTIONS_DIR`
|
|
27
|
+
override the file; `--framework` and `--dir` override both.
|
|
28
|
+
|
|
29
|
+
## Commands
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
botlr pull <name...> | --all [--framework react-next] [--dir components/sections] [--version N] [--shared] [--force]
|
|
33
|
+
botlr push <name> [-m msg] [--shared] [--create] [--force]
|
|
34
|
+
botlr sections list
|
|
35
|
+
botlr sections status [name...] [--offline]
|
|
36
|
+
botlr sections init [--force] [--dry-run]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- `pull` writes every file of the section under `sectionsDir`, plus
|
|
40
|
+
`<name>.botlr.json` (the manifest, never holding version or hash) and the
|
|
41
|
+
lock entry in `.botlr/sections.lock.json`. A section whose local files
|
|
42
|
+
changed since the last pull is skipped unless `--force`.
|
|
43
|
+
- `push` reads the manifest and its files, hashes them, and pushes with
|
|
44
|
+
`baseVersion` from the lock so a stale checkout gets a conflict instead of
|
|
45
|
+
overwriting someone's version. `--force` omits `baseVersion`. `--create`
|
|
46
|
+
adds the section definition when the dashboard does not know it yet.
|
|
47
|
+
- `sections status` compares the local content hash with the lock and the
|
|
48
|
+
server's latest: `clean`, `modified`, `behind`, `diverged`, or
|
|
49
|
+
`untracked` for a manifest with no lock entry.
|
|
50
|
+
- `sections init` derives first manifests from a satellite app's
|
|
51
|
+
`publisher-section-registry.ts` and the `XDefinition` exports next to each
|
|
52
|
+
component. Review them, then `botlr push <name> --create` per section.
|
|
53
|
+
|
|
54
|
+
Commit the manifests and the lock file; keep `BOTLR_PAT` out of the repo.
|