@seliseblocks/cli-os 0.2.3 → 0.2.5
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/AI_USAGE_GUIDE.md +560 -560
- package/LICENSE +21 -21
- package/README.md +173 -173
- package/bin/run.js +2 -2
- package/dist/commands/auth/idp/create.d.ts +7 -0
- package/dist/commands/auth/idp/create.js +22 -3
- package/dist/commands/auth/idp/update.d.ts +7 -0
- package/dist/commands/auth/idp/update.js +22 -3
- package/dist/commands/new/web.js +4 -0
- package/dist/index.js +692 -672
- package/dist/lib/scaffold-web/app-core.js +6 -1
- package/dist/lib/scaffold-web/blocks-lib.js +36 -2
- package/dist/skills/blocks-data-gateway-configuration/SKILL.md +204 -204
- package/dist/skills/blocks-data-gateway-crud/SKILL.md +223 -223
- package/dist/skills/blocks-data-storage/SKILL.md +253 -253
- package/dist/skills/blocks-data-storage/flows/object-management.md +124 -124
- package/dist/skills/blocks-frontend-local-https/SKILL.md +100 -100
- package/dist/skills/blocks-iam-access-control/SKILL.md +49 -49
- package/dist/skills/blocks-iam-access-control/flows/feature-gating.md +38 -38
- package/dist/skills/blocks-iam-access-control/flows/manage-roles-permissions.md +110 -110
- package/dist/skills/blocks-iam-account/SKILL.md +169 -169
- package/dist/skills/blocks-iam-mfa/SKILL.md +124 -124
- package/dist/skills/blocks-iam-organizations/SKILL.md +43 -43
- package/dist/skills/blocks-iam-organizations/flows/admin-mutations.md +89 -89
- package/dist/skills/blocks-iam-organizations/flows/read-and-switch.md +57 -57
- package/dist/skills/blocks-iam-sso-oidc-configuration/SKILL.md +105 -89
- package/dist/skills/blocks-iam-sso-oidc-implementation/SKILL.md +80 -80
- package/dist/skills/blocks-iam-users/SKILL.md +131 -131
- package/dist/skills/blocks-localization-configuration/SKILL.md +149 -149
- package/dist/skills/blocks-localization-implementation/SKILL.md +63 -63
- package/dist/skills/blocks-mail/SKILL.md +95 -95
- package/dist/skills/blocks-notification/SKILL.md +69 -69
- package/dist/skills/blocks-notifier/SKILL.md +107 -107
- package/dist/skills/blocks-onboarding/SKILL.md +78 -78
- package/dist/skills/blocks-release-deployment/SKILL.md +81 -81
- package/dist/skills/blocks-secrets/SKILL.md +81 -81
- package/dist/skills/blocks-storage-configuration/SKILL.md +93 -93
- package/dist/skills/lint.mjs +168 -168
- package/package.json +47 -47
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) SELISE Blocks
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) SELISE Blocks
|
|
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,173 +1,173 @@
|
|
|
1
|
-
# Blocks CLI
|
|
2
|
-
|
|
3
|
-
CLI for SELISE Blocks Cloud.
|
|
4
|
-
|
|
5
|
-
- Package: `@seliseblocks/cli-os`
|
|
6
|
-
- Binary: `blocks`
|
|
7
|
-
|
|
8
|
-
## Setup
|
|
9
|
-
|
|
10
|
-
Install the npm package where you want to operate the CLI:
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
npm install -g @seliseblocks/cli-os@latest
|
|
14
|
-
blocks --version
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Then log in (device-code flow - prints a verification URL and code, opens
|
|
18
|
-
your browser to the verification page when possible so you only need to
|
|
19
|
-
click approve, then polls until approved):
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
blocks login
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
For source development in this repository:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
npm install
|
|
29
|
-
npm run build
|
|
30
|
-
node bin/run.js --version
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Commands
|
|
34
|
-
|
|
35
|
-
Namespaced commands accept either spaces or colons, e.g. `blocks data schema list` and
|
|
36
|
-
`blocks data:schema:list` are equivalent.
|
|
37
|
-
|
|
38
|
-
Global options available on every command:
|
|
39
|
-
|
|
40
|
-
| Option | Description |
|
|
41
|
-
|---|---|
|
|
42
|
-
| `--version` | Print CLI version. |
|
|
43
|
-
| `--json` | Print machine-readable JSON where supported. |
|
|
44
|
-
| `--api-url <url>` | Override the Blocks API URL for this command. |
|
|
45
|
-
| `--account <name>` | Use a named account profile; default is implicit. |
|
|
46
|
-
| `--project <tenantId>` | Use a project tenant for project-scoped commands. |
|
|
47
|
-
| `--dry-run` | Show planned mutation without calling the API. |
|
|
48
|
-
| `--yes` | Skip mutation confirmation after explicit approval. |
|
|
49
|
-
|
|
50
|
-
| Command | Description |
|
|
51
|
-
|---|---|
|
|
52
|
-
| `blocks init` | Create local Blocks workspace files: `blocks.json`, data schema/rules folders, and `.env.example`. |
|
|
53
|
-
| `blocks doctor [--json]` | Check Node.js, OIDC config, token cache, selected project, and config file locations. Does not mutate cloud resources. |
|
|
54
|
-
| `blocks login` | Device-code login. Prints a verification URL and user code, opens the browser to the verification page when possible so you only need to click approve, then polls until the device is authorized; stores account tokens and auto-refreshes later. |
|
|
55
|
-
| `blocks auth status [--json]` | Show only whether account/project access and refresh tokens are missing, valid, expired, or available. Does not print account config values. |
|
|
56
|
-
| `blocks auth refresh [--project] [--json]` | Force account token refresh, or project token refresh with `--project`. |
|
|
57
|
-
| `blocks auth remove <account>` | Clear cached tokens and stored local credentials for that account. The packaged default OS account is restored from package defaults. |
|
|
58
|
-
| `blocks logout` | Revoke the current refresh token when possible and remove local session data. |
|
|
59
|
-
| `blocks projects list [--json]` | List accessible Blocks projects via `/os/v4/Project/Gets` using the account token. Read-only. |
|
|
60
|
-
| `blocks projects get [tenantId] [--deployment] [--json]` | Read one project from `Project/Gets`. Uses selected project when `tenantId` is omitted. Pass `--deployment` to also include the environment, tenantGroupId, and linked repo assets that `release deploy` resolves internally. Read-only. |
|
|
61
|
-
| `blocks projects create` | **Currently disabled** (commented out, not deleted) - the dispatch entry, import, and help text were removed pending a product decision. Do not tell users this command is available. |
|
|
62
|
-
| `blocks use <tenantId>` | Save the selected project tenant globally and in `blocks.json` when present. Does not call cloud APIs. |
|
|
63
|
-
| `blocks deselect` | Clear the selected project tenant (globally and in `blocks.json`) and drop its cached impersonation token. Use this to recover when an impersonated project token has expired or failed, then run `blocks use <tenantId>` again to reselect and re-impersonate. |
|
|
64
|
-
| `blocks iam me [--json]` | Read the current user from IAM using the account token (CLI operator identity, not a project resource). |
|
|
65
|
-
| `blocks iam users *`, `iam email available`, `iam roles *`, `iam permissions *`, `iam resources *`, `iam organizations *`, `iam signup-settings *` | Full IAM admin surface for the selected project (users, roles, permissions, resource metadata, organizations and their config, signup settings). Project-scoped: requires a selected project and always uses an impersonated project token, never the account token. Mutating commands support `--dry-run`/`--yes`; rich payloads accept `--body '<json>'`/`--file <path>` on top of common convenience flags. Run `blocks --help` for the full command/flag list. |
|
|
66
|
-
| `blocks mfa config *`, `mfa totp *`, `mfa generate`, `mfa resend`, `mfa verify`, `mfa method set`, `mfa disable`, `mfa backup-codes *` | Project-scoped MFA admin and self-service surface (tenant MFA policy, TOTP enrollment, OTP challenge/verify, method switch, backup codes). Same project-selection and impersonation-only rules as IAM above. |
|
|
67
|
-
| `blocks mfa totp enable --mfa-type <n> [--code <c>]` | Composed TOTP enrollment: `totp setup` → prints the QR/secret → prompts for the code (or `--code` to skip the prompt) → `totp verify-setup` → `method set` → `backup-codes generate`, one confirmation. `--mfa-type` is required and not defaulted - the tenant-specific integer meaning "TOTP" isn't documented anywhere in this CLI. Deliberately excludes `mfa config save` (a separate, tenant-wide admin policy, not part of one user's enrollment). |
|
|
68
|
-
| `blocks auth idp *`, `auth config *`, `auth client-credentials *`, `auth oidc-clients *` | Auth admin surface: identity providers, AuthController tenant config, machine-to-machine client credentials, and OIDC client app registrations. Project-scoped, impersonated project token only. `idp delete`, `client-credentials save`/`delete`, and `oidc-clients save`/`delete`/`rotate-secret` return or handle secrets shown only once - treat CLI output as sensitive and never log it. |
|
|
69
|
-
| `blocks mail config *`, `mail template *`, `mail mailbox *` | Project-scoped mail admin surface via `/os/v4/Mail/*`: SMTP/inbound configuration upsert/delete/duplicate, mail template CRUD/clone, and mailbox message reads. Impersonated project token only. `mail config save`'s `--account-password` is redacted in `--dry-run` output only. |
|
|
70
|
-
| `blocks mail send [--to a,b] [--purpose <p>] [--language <c>] ...` / `mail sendtoany [same, plus --is-test-mail]` | Send an email via `/logic/v4/Mail/Send` / `/logic/v4/Mail/SendToAny`. Impersonated project token only; `--project-key` defaults to the selected project. |
|
|
71
|
-
| `blocks notification *` | Project-scoped notification channel configuration via `/os/v4/Notification/*` (list/get/save/delete). Impersonated project token only. `--channel`/`--type` are raw numeric enum values from the API. |
|
|
72
|
-
| `blocks notifier notify`, `notifier list`, `notifier unread`, `notifier mark-read`, `notifier mark-all-read` | Real-time/offline notification sends and inbox reads via `/logic/v4/Notifier/*` - distinct from `notification` above, which manages channel configuration, not sending. Impersonated project token only. `notify` targets `--user-ids`/`--roles`/`--subscription-filters`; `unread` sends its filter as query parameters even though swagger documents that endpoint as GET with a JSON body, which the Fetch spec forbids. |
|
|
73
|
-
| `blocks secrets get <secretKey>` / `secrets save --secret-key <key> --key-value-pairs '<json>'` | Generic tenant secret storage via `/os/v4/Secrets/*` (e.g. captcha provider config). Impersonated project token only. `save` is an upsert - omit `--item-id` to create, pass it to update. |
|
|
74
|
-
| `blocks storage config *` | Project-scoped storage backend configuration via `/os/v4/Storage/*` (list/get/save/delete). Impersonated project token only. `--secret-key`/`--access-key`/`--password`/`--connection-string` are redacted in `--dry-run` output only. |
|
|
75
|
-
| `blocks data validate [--json]` | Validate local `blocks/data/schemas/*.json` and `blocks/data/rules.json` before pushing. Local-only. |
|
|
76
|
-
| `blocks data schema list [--json]` | List project schemas via `/data/v4/schemas` using an impersonated project token. Read-only. |
|
|
77
|
-
| `blocks data schema pull [--json]` | Download project schemas into `blocks/data/schemas/*.json`. Writes local files only. |
|
|
78
|
-
| `blocks data schema push [--dry-run] [--yes] [--json]` | Create or update project schemas via `/data/v4/schemas/define`. Mutating; uses POST for create and PUT for update. |
|
|
79
|
-
| `blocks data rules pull [--json]` | Download data-access policies into `blocks/data/rules.json`. Writes local files only. |
|
|
80
|
-
| `blocks data rules deploy [--dry-run] [--yes] [--json]` | Apply schema security and data-access policies. Mutating; supports dry-run and confirmation. |
|
|
81
|
-
| `blocks data reload [--dry-run] [--yes] [--json]` | Reload Data schema configuration so staged schema/rule changes become live. Mutating; calls POST `/data/v4/schema-configurations/reload`. |
|
|
82
|
-
| `blocks data sync [--dry-run] [--yes] [--json]` | Composed flow: validate local schemas/rules → `data schema push` → `data rules deploy` → `data reload`, one confirmation. Use this instead of running the three separately - nothing else calls `data reload` automatically, so pushed changes can otherwise sit staged without going live. Prints 3 separate step outputs, not one combined document. |
|
|
83
|
-
| `blocks data config get/create/update` | Tenant data-source configuration via `/data/v4/configurations` - check `get` first, it defaults to Blocks-managed storage; `create`/`update` point the gateway at an external database. Impersonated project token only. |
|
|
84
|
-
| `blocks data schema get/get-by-name/aggregation/change-logs/delete/fields/info *` | Raw `/data/v4/schemas*` API beyond the file-oriented `list/pull/push` above: single-schema/by-name lookups, access-level aggregation, unadapted change logs, delete, and a metadata-first (`info *`) plus field-only (`fields`) alternative to `push`. Run `blocks --help` for the full flag reference. |
|
|
85
|
-
| `blocks data rules policy get/delete` | Single data-access policy read/delete via `/data/v4/data-access/policy/*`, alongside the bulk file-oriented `rules pull/deploy` above. |
|
|
86
|
-
| `blocks data validation list/get/by-schema/by-schema-field/save/delete` | Field-level validation rules via `/data/v4/data-validations*`. No file-oriented workflow exists for this yet; `save` is an upsert (omit `--item-id` to create) and requires a `validations` array via `--body`/`--file`. |
|
|
87
|
-
| `blocks data files upload --file <path> [--local-storage]` | Composed upload: cloud storage creates the file/version record and PUTs the bytes; local storage uses one multipart request. The file is immediately part of the object tree—there is no DMS registration step. |
|
|
88
|
-
| `blocks data files *` | Full storage object-tree surface: file get/upload/metadata/delete/version/copy/move/rename, directory CRUD/move, cursor-paginated list/search/shared/trash, restore/purge, and access policy/share/inheritance commands. Delete defaults to trash; pass `--permanent` explicitly to remove data. Run `blocks --help` for flags. |
|
|
89
|
-
| `blocks localization validate --module <name> --language <culture> [--file <path>] [--json]` | Validate a local i18n JSON dictionary. Supports nested JSON input and checks the flattened key/value set locally. |
|
|
90
|
-
| `blocks localization push --module <name> --language <culture> [--file <path>] [--route <route>] [--context <text>] [--dry-run] [--yes] [--json]` | Create or update Localization keys from local i18n JSON via `/localization/v4/Key/SaveKeys`. Creates the module first through `/localization/v4/Module/Save` when missing. |
|
|
91
|
-
| `blocks localization pull --module <name> --language <culture> [--out <path>] [--json]` | Download published cloud localization via `/localization/v4/Key/GetCloudUilmFile` and write a local JSON dictionary. |
|
|
92
|
-
| `blocks localization key translate-and-export --module-id <id> [--wait]` | Composed flow: `translate-all` → `generate-uilm-file` → `uilm-export`. With `--wait`, polls translation progress (via a self-generated correlation id) before generating/exporting, since translation runs asynchronously; without it, fires all 3 back to back. Prints one output block per step. |
|
|
93
|
-
| `blocks localization assistant translation-suggestion`, `localization config *`, `localization glossary *`, `localization key *`, `localization language *`, `localization module *` | Full raw `/localization/v4/*` API surface (AI translation suggestions, tenant webhook config, glossary CRUD, key CRUD/search/timeline/translate/UILM import-export/rollback, language CRUD, module CRUD/glossary tagging) alongside the file-oriented validate/push/pull commands above. Project-scoped, impersonated project token only. Run `blocks --help` for the full command/flag list. |
|
|
94
|
-
| `blocks release deploy [--domain <customDomain>] [--wait] [--poll-interval <s>] [--timeout <s>] [--dry-run] [--yes] [--json]` | Deploy the selected project's environment. No `--repo-id` needed - resolves the linked repo via `Project/GetAsset` and its connected branch via `Build/repo-details`, and aborts if that branch doesn't match the environment name. Pass `--domain` to also set the custom deployment domain first. Pass `--wait` to poll `release status` on the resulting build until it reaches a terminal state instead of returning immediately with just a build id. Mutating; no artifact upload is performed by this CLI. |
|
|
95
|
-
| `blocks release status <buildId> [--json]` | Read Release build status by build id. Read-only. |
|
|
96
|
-
| `blocks release builds list [repoId] [--repo-id <repoId>] [--json]` | List Release build details for a repository. When `repoId` is omitted, resolves it from the selected project's linked repo assets - auto-picked if there's exactly one, otherwise you're prompted to choose. Read-only. |
|
|
97
|
-
| `blocks release builds get <buildId> [--json]` | Alias for `release status`. Read-only. |
|
|
98
|
-
| `blocks new web <name> [--app-domain <domain>] [--client-id <oidcClientId>] [--x-blocks-key <tenantId>] [--blocks-api-url <url>] [--oidc-url <url>]` | Create a Vite React starter app that talks to Blocks exclusively through `@seliseblocks/client` (a single `createBlocksClient()` instance) using the SDK hosted IdP flow: `blocksClient.auth.idp.redirectToProvider()` on login click and `blocksClient.auth.idp.callback()` on `/login/callback`. Includes route guards, auto-refresh through `auth.oidc.refreshToken()`, live `auth`/`iam`/`data`/`localization` SDK examples, environment config, and safe `.gitignore` defaults. Uses the selected project (see `use`) unless `--x-blocks-key` overrides it. `--app-domain` and `--client-id` are resolved from the project record when omitted: the domain auto-picks if the project has exactly one, otherwise you're prompted to choose; the OIDC client is picked from the project's existing clients, or you can create a minimal one (display name + redirect URI) on the spot, or skip and register one later from the portal or `auth oidc-clients save`. When `--blocks-api-url` is omitted, `new web` derives it from the app domain as `https://blocksapi.<registrable-domain>`; for example `https://dqrsf.slsblx.com` becomes `https://blocksapi.slsblx.com`. Pass a different Data/IAM/Localization/OS gateway URL explicitly only if your project uses a non-default one. `--oidc-url` defaults to `https://iam.seliseblocks.com`. |
|
|
99
|
-
| `blocks skill list [--json]` / `skill show <name> [--json]` / `skill add <name> [--dir <path>]` | Local-only, no cloud calls: list/print the bundled `blocks-skills/*/SKILL.md` agent context docs, or copy a skill's entire directory (`SKILL.md` plus any supporting files) into `<dir>/<name>/` (default `./blocks-skills`) for use in a project outside this monorepo. `list`'s output and `show`/`add`'s "unknown skill" error both point at the full public skill catalog in case the bundled set is out of date. |
|
|
100
|
-
| `blocks sdk client [--app-domain <domain>] [--client-id <oidcClientId>] [--x-blocks-key <tenantId>] [--blocks-api-url <url>] [--oidc-url <url>] [--json]` | Read-only: resolves this project's `@seliseblocks/client` config and prints a ready-to-paste `createBlocksClient(...)` snippet. Unlike `new web`, the API URL defaults to `https://api.seliseblocks.com` unless `--blocks-api-url` is passed. Passing both `--app-domain` and `--client-id` skips the project lookup entirely (no login required). Writes nothing - use `new web` to scaffold a full app. |
|
|
101
|
-
|
|
102
|
-
Use `--json` on commands when AI or automation needs machine-readable output. Use `--dry-run` before mutations and `--yes` only after approval.
|
|
103
|
-
|
|
104
|
-
For agent-specific operating rules and command sequences, see [AI_USAGE_GUIDE.md](AI_USAGE_GUIDE.md).
|
|
105
|
-
|
|
106
|
-
### Scaffolded Web App Local HTTPS
|
|
107
|
-
|
|
108
|
-
For `blocks new web`, `--app-domain` should be the app's real Blocks domain/origin, for example `https://dbpdba.seliseblocks.com`. The generated app keeps that full value as `VITE_BLOCKS_APP_DOMAIN` and derives the local dev host without a scheme as `VITE_BLOCKS_DEV_HOST=dbpdba.seliseblocks.com`.
|
|
109
|
-
|
|
110
|
-
Browser login uses the hosted Blocks IAM IdP flow and secure cookies, so local testing on the project domain must run over HTTPS:
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
cd <appName>
|
|
114
|
-
npm install
|
|
115
|
-
npm run cert
|
|
116
|
-
npm run dev
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Add the generated `VITE_BLOCKS_DEV_HOST` to your hosts file, for example:
|
|
120
|
-
|
|
121
|
-
```text
|
|
122
|
-
127.0.0.1 dbpdba.seliseblocks.com
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
Then open `https://<VITE_BLOCKS_DEV_HOST>:5173`, not plain `http://`. The generated cert script uses a Node dependency, so it works from normal PowerShell after `npm install`; OpenSSL/Git Bash is not required.
|
|
126
|
-
|
|
127
|
-
OIDC account settings are saved in the OS-specific config directory. Access and refresh tokens are stored in an OS-aware secure backend when available, and are refreshed automatically before cloud commands when a refresh token is available.
|
|
128
|
-
|
|
129
|
-
OAuth tokens use an OS-aware credential backend:
|
|
130
|
-
|
|
131
|
-
| OS | Credential backend |
|
|
132
|
-
|---|---|
|
|
133
|
-
| Windows | DPAPI-encrypted value in the CLI secret metadata file, scoped to the current Windows user. |
|
|
134
|
-
| macOS | Keychain generic password for the `seliseblocks-cli` service. |
|
|
135
|
-
| Linux | Secret Service through `secret-tool` when available. |
|
|
136
|
-
| Fallback | `0600` file storage in the CLI config directory. Set `BLOCKS_SECRET_STORE=file` to force this mode for CI or minimal containers. |
|
|
137
|
-
|
|
138
|
-
Use `blocks doctor` or `blocks auth status` to see which backend is active. Tokens are never printed by CLI status commands.
|
|
139
|
-
|
|
140
|
-
If the active OS credential backend cannot decrypt old local auth state after a Windows profile change, machine migration, Keychain reset, or corrupted token cache, clear local auth state and log in again:
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
blocks auth remove <account>
|
|
144
|
-
blocks login
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
## Workspace
|
|
148
|
-
|
|
149
|
-
`blocks init` creates:
|
|
150
|
-
|
|
151
|
-
```text
|
|
152
|
-
blocks.json
|
|
153
|
-
blocks/
|
|
154
|
-
data/
|
|
155
|
-
schemas/
|
|
156
|
-
rules.json
|
|
157
|
-
.env.example
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Localization dictionaries are not created by `init` - the default path is `blocks/localization/<module>.<language>.json`, for example `blocks/localization/common.en.json`, and the `blocks/localization/` folder is created lazily the first time `blocks localization pull` writes to it. AI agents can create or update that file directly (before `push`, which only reads it), run `blocks localization validate`, then push it to the Localization service with `blocks localization push --dry-run` followed by `--yes` after approval. Gateway v4 routes do not include an `/api` segment.
|
|
161
|
-
|
|
162
|
-
`blocks use <tenantId>` updates the selected project in global CLI state and `blocks.json` when present.
|
|
163
|
-
|
|
164
|
-
`blocks release deploy` has no local config file - it needs a repo already linked to the project. Linking a repo requires GitHub OAuth, which only the Blocks portal can do; if none is linked, the command tells you so and stops.
|
|
165
|
-
|
|
166
|
-
## Boundaries
|
|
167
|
-
|
|
168
|
-
- `iam me` reads the CLI operator's own account identity; every other `iam *`, `mfa *`, `auth idp *`/`auth config *`/`auth client-credentials *`/`auth oidc-clients *`, `mail *`, `notification *`, `notifier *`, `secrets *`, and `storage config *` command is project-scoped and requires a selected project (`blocks use <tenantId>`) plus an impersonated project token - none of them ever run against the account token.
|
|
169
|
-
- Data covers tenant data-source configuration, schema/rules/reload/validate, field-level validation rules, and the storage object tree (`data files *`). Prefer the composed `data sync` and `data files upload` workflows.
|
|
170
|
-
- Localization covers dictionary validate/pull/push plus the full raw `/localization/v4/*` API surface (assistant, config, glossary, key, language, module). Prefer `localization key translate-and-export` over running translate/generate/export by hand.
|
|
171
|
-
- Release covers deploy trigger and build status/read commands only.
|
|
172
|
-
- No direct artifact upload unless Blocks Release adds a confirmed artifact upload API.
|
|
173
|
-
- `projects create` is currently disabled in this build (commented out pending a product decision) - don't reference it as available.
|
|
1
|
+
# Blocks CLI
|
|
2
|
+
|
|
3
|
+
CLI for SELISE Blocks Cloud.
|
|
4
|
+
|
|
5
|
+
- Package: `@seliseblocks/cli-os`
|
|
6
|
+
- Binary: `blocks`
|
|
7
|
+
|
|
8
|
+
## Setup
|
|
9
|
+
|
|
10
|
+
Install the npm package where you want to operate the CLI:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install -g @seliseblocks/cli-os@latest
|
|
14
|
+
blocks --version
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then log in (device-code flow - prints a verification URL and code, opens
|
|
18
|
+
your browser to the verification page when possible so you only need to
|
|
19
|
+
click approve, then polls until approved):
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
blocks login
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
For source development in this repository:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install
|
|
29
|
+
npm run build
|
|
30
|
+
node bin/run.js --version
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Commands
|
|
34
|
+
|
|
35
|
+
Namespaced commands accept either spaces or colons, e.g. `blocks data schema list` and
|
|
36
|
+
`blocks data:schema:list` are equivalent.
|
|
37
|
+
|
|
38
|
+
Global options available on every command:
|
|
39
|
+
|
|
40
|
+
| Option | Description |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `--version` | Print CLI version. |
|
|
43
|
+
| `--json` | Print machine-readable JSON where supported. |
|
|
44
|
+
| `--api-url <url>` | Override the Blocks API URL for this command. |
|
|
45
|
+
| `--account <name>` | Use a named account profile; default is implicit. |
|
|
46
|
+
| `--project <tenantId>` | Use a project tenant for project-scoped commands. |
|
|
47
|
+
| `--dry-run` | Show planned mutation without calling the API. |
|
|
48
|
+
| `--yes` | Skip mutation confirmation after explicit approval. |
|
|
49
|
+
|
|
50
|
+
| Command | Description |
|
|
51
|
+
|---|---|
|
|
52
|
+
| `blocks init` | Create local Blocks workspace files: `blocks.json`, data schema/rules folders, and `.env.example`. |
|
|
53
|
+
| `blocks doctor [--json]` | Check Node.js, OIDC config, token cache, selected project, and config file locations. Does not mutate cloud resources. |
|
|
54
|
+
| `blocks login` | Device-code login. Prints a verification URL and user code, opens the browser to the verification page when possible so you only need to click approve, then polls until the device is authorized; stores account tokens and auto-refreshes later. |
|
|
55
|
+
| `blocks auth status [--json]` | Show only whether account/project access and refresh tokens are missing, valid, expired, or available. Does not print account config values. |
|
|
56
|
+
| `blocks auth refresh [--project] [--json]` | Force account token refresh, or project token refresh with `--project`. |
|
|
57
|
+
| `blocks auth remove <account>` | Clear cached tokens and stored local credentials for that account. The packaged default OS account is restored from package defaults. |
|
|
58
|
+
| `blocks logout` | Revoke the current refresh token when possible and remove local session data. |
|
|
59
|
+
| `blocks projects list [--json]` | List accessible Blocks projects via `/os/v4/Project/Gets` using the account token. Read-only. |
|
|
60
|
+
| `blocks projects get [tenantId] [--deployment] [--json]` | Read one project from `Project/Gets`. Uses selected project when `tenantId` is omitted. Pass `--deployment` to also include the environment, tenantGroupId, and linked repo assets that `release deploy` resolves internally. Read-only. |
|
|
61
|
+
| `blocks projects create` | **Currently disabled** (commented out, not deleted) - the dispatch entry, import, and help text were removed pending a product decision. Do not tell users this command is available. |
|
|
62
|
+
| `blocks use <tenantId>` | Save the selected project tenant globally and in `blocks.json` when present. Does not call cloud APIs. |
|
|
63
|
+
| `blocks deselect` | Clear the selected project tenant (globally and in `blocks.json`) and drop its cached impersonation token. Use this to recover when an impersonated project token has expired or failed, then run `blocks use <tenantId>` again to reselect and re-impersonate. |
|
|
64
|
+
| `blocks iam me [--json]` | Read the current user from IAM using the account token (CLI operator identity, not a project resource). |
|
|
65
|
+
| `blocks iam users *`, `iam email available`, `iam roles *`, `iam permissions *`, `iam resources *`, `iam organizations *`, `iam signup-settings *` | Full IAM admin surface for the selected project (users, roles, permissions, resource metadata, organizations and their config, signup settings). Project-scoped: requires a selected project and always uses an impersonated project token, never the account token. Mutating commands support `--dry-run`/`--yes`; rich payloads accept `--body '<json>'`/`--file <path>` on top of common convenience flags. Run `blocks --help` for the full command/flag list. |
|
|
66
|
+
| `blocks mfa config *`, `mfa totp *`, `mfa generate`, `mfa resend`, `mfa verify`, `mfa method set`, `mfa disable`, `mfa backup-codes *` | Project-scoped MFA admin and self-service surface (tenant MFA policy, TOTP enrollment, OTP challenge/verify, method switch, backup codes). Same project-selection and impersonation-only rules as IAM above. |
|
|
67
|
+
| `blocks mfa totp enable --mfa-type <n> [--code <c>]` | Composed TOTP enrollment: `totp setup` → prints the QR/secret → prompts for the code (or `--code` to skip the prompt) → `totp verify-setup` → `method set` → `backup-codes generate`, one confirmation. `--mfa-type` is required and not defaulted - the tenant-specific integer meaning "TOTP" isn't documented anywhere in this CLI. Deliberately excludes `mfa config save` (a separate, tenant-wide admin policy, not part of one user's enrollment). |
|
|
68
|
+
| `blocks auth idp *`, `auth config *`, `auth client-credentials *`, `auth oidc-clients *` | Auth admin surface: identity providers, AuthController tenant config, machine-to-machine client credentials, and OIDC client app registrations. Project-scoped, impersonated project token only. `idp delete`, `client-credentials save`/`delete`, and `oidc-clients save`/`delete`/`rotate-secret` return or handle secrets shown only once - treat CLI output as sensitive and never log it. |
|
|
69
|
+
| `blocks mail config *`, `mail template *`, `mail mailbox *` | Project-scoped mail admin surface via `/os/v4/Mail/*`: SMTP/inbound configuration upsert/delete/duplicate, mail template CRUD/clone, and mailbox message reads. Impersonated project token only. `mail config save`'s `--account-password` is redacted in `--dry-run` output only. |
|
|
70
|
+
| `blocks mail send [--to a,b] [--purpose <p>] [--language <c>] ...` / `mail sendtoany [same, plus --is-test-mail]` | Send an email via `/logic/v4/Mail/Send` / `/logic/v4/Mail/SendToAny`. Impersonated project token only; `--project-key` defaults to the selected project. |
|
|
71
|
+
| `blocks notification *` | Project-scoped notification channel configuration via `/os/v4/Notification/*` (list/get/save/delete). Impersonated project token only. `--channel`/`--type` are raw numeric enum values from the API. |
|
|
72
|
+
| `blocks notifier notify`, `notifier list`, `notifier unread`, `notifier mark-read`, `notifier mark-all-read` | Real-time/offline notification sends and inbox reads via `/logic/v4/Notifier/*` - distinct from `notification` above, which manages channel configuration, not sending. Impersonated project token only. `notify` targets `--user-ids`/`--roles`/`--subscription-filters`; `unread` sends its filter as query parameters even though swagger documents that endpoint as GET with a JSON body, which the Fetch spec forbids. |
|
|
73
|
+
| `blocks secrets get <secretKey>` / `secrets save --secret-key <key> --key-value-pairs '<json>'` | Generic tenant secret storage via `/os/v4/Secrets/*` (e.g. captcha provider config). Impersonated project token only. `save` is an upsert - omit `--item-id` to create, pass it to update. |
|
|
74
|
+
| `blocks storage config *` | Project-scoped storage backend configuration via `/os/v4/Storage/*` (list/get/save/delete). Impersonated project token only. `--secret-key`/`--access-key`/`--password`/`--connection-string` are redacted in `--dry-run` output only. |
|
|
75
|
+
| `blocks data validate [--json]` | Validate local `blocks/data/schemas/*.json` and `blocks/data/rules.json` before pushing. Local-only. |
|
|
76
|
+
| `blocks data schema list [--json]` | List project schemas via `/data/v4/schemas` using an impersonated project token. Read-only. |
|
|
77
|
+
| `blocks data schema pull [--json]` | Download project schemas into `blocks/data/schemas/*.json`. Writes local files only. |
|
|
78
|
+
| `blocks data schema push [--dry-run] [--yes] [--json]` | Create or update project schemas via `/data/v4/schemas/define`. Mutating; uses POST for create and PUT for update. |
|
|
79
|
+
| `blocks data rules pull [--json]` | Download data-access policies into `blocks/data/rules.json`. Writes local files only. |
|
|
80
|
+
| `blocks data rules deploy [--dry-run] [--yes] [--json]` | Apply schema security and data-access policies. Mutating; supports dry-run and confirmation. |
|
|
81
|
+
| `blocks data reload [--dry-run] [--yes] [--json]` | Reload Data schema configuration so staged schema/rule changes become live. Mutating; calls POST `/data/v4/schema-configurations/reload`. |
|
|
82
|
+
| `blocks data sync [--dry-run] [--yes] [--json]` | Composed flow: validate local schemas/rules → `data schema push` → `data rules deploy` → `data reload`, one confirmation. Use this instead of running the three separately - nothing else calls `data reload` automatically, so pushed changes can otherwise sit staged without going live. Prints 3 separate step outputs, not one combined document. |
|
|
83
|
+
| `blocks data config get/create/update` | Tenant data-source configuration via `/data/v4/configurations` - check `get` first, it defaults to Blocks-managed storage; `create`/`update` point the gateway at an external database. Impersonated project token only. |
|
|
84
|
+
| `blocks data schema get/get-by-name/aggregation/change-logs/delete/fields/info *` | Raw `/data/v4/schemas*` API beyond the file-oriented `list/pull/push` above: single-schema/by-name lookups, access-level aggregation, unadapted change logs, delete, and a metadata-first (`info *`) plus field-only (`fields`) alternative to `push`. Run `blocks --help` for the full flag reference. |
|
|
85
|
+
| `blocks data rules policy get/delete` | Single data-access policy read/delete via `/data/v4/data-access/policy/*`, alongside the bulk file-oriented `rules pull/deploy` above. |
|
|
86
|
+
| `blocks data validation list/get/by-schema/by-schema-field/save/delete` | Field-level validation rules via `/data/v4/data-validations*`. No file-oriented workflow exists for this yet; `save` is an upsert (omit `--item-id` to create) and requires a `validations` array via `--body`/`--file`. |
|
|
87
|
+
| `blocks data files upload --file <path> [--local-storage]` | Composed upload: cloud storage creates the file/version record and PUTs the bytes; local storage uses one multipart request. The file is immediately part of the object tree—there is no DMS registration step. |
|
|
88
|
+
| `blocks data files *` | Full storage object-tree surface: file get/upload/metadata/delete/version/copy/move/rename, directory CRUD/move, cursor-paginated list/search/shared/trash, restore/purge, and access policy/share/inheritance commands. Delete defaults to trash; pass `--permanent` explicitly to remove data. Run `blocks --help` for flags. |
|
|
89
|
+
| `blocks localization validate --module <name> --language <culture> [--file <path>] [--json]` | Validate a local i18n JSON dictionary. Supports nested JSON input and checks the flattened key/value set locally. |
|
|
90
|
+
| `blocks localization push --module <name> --language <culture> [--file <path>] [--route <route>] [--context <text>] [--dry-run] [--yes] [--json]` | Create or update Localization keys from local i18n JSON via `/localization/v4/Key/SaveKeys`. Creates the module first through `/localization/v4/Module/Save` when missing. |
|
|
91
|
+
| `blocks localization pull --module <name> --language <culture> [--out <path>] [--json]` | Download published cloud localization via `/localization/v4/Key/GetCloudUilmFile` and write a local JSON dictionary. |
|
|
92
|
+
| `blocks localization key translate-and-export --module-id <id> [--wait]` | Composed flow: `translate-all` → `generate-uilm-file` → `uilm-export`. With `--wait`, polls translation progress (via a self-generated correlation id) before generating/exporting, since translation runs asynchronously; without it, fires all 3 back to back. Prints one output block per step. |
|
|
93
|
+
| `blocks localization assistant translation-suggestion`, `localization config *`, `localization glossary *`, `localization key *`, `localization language *`, `localization module *` | Full raw `/localization/v4/*` API surface (AI translation suggestions, tenant webhook config, glossary CRUD, key CRUD/search/timeline/translate/UILM import-export/rollback, language CRUD, module CRUD/glossary tagging) alongside the file-oriented validate/push/pull commands above. Project-scoped, impersonated project token only. Run `blocks --help` for the full command/flag list. |
|
|
94
|
+
| `blocks release deploy [--domain <customDomain>] [--wait] [--poll-interval <s>] [--timeout <s>] [--dry-run] [--yes] [--json]` | Deploy the selected project's environment. No `--repo-id` needed - resolves the linked repo via `Project/GetAsset` and its connected branch via `Build/repo-details`, and aborts if that branch doesn't match the environment name. Pass `--domain` to also set the custom deployment domain first. Pass `--wait` to poll `release status` on the resulting build until it reaches a terminal state instead of returning immediately with just a build id. Mutating; no artifact upload is performed by this CLI. |
|
|
95
|
+
| `blocks release status <buildId> [--json]` | Read Release build status by build id. Read-only. |
|
|
96
|
+
| `blocks release builds list [repoId] [--repo-id <repoId>] [--json]` | List Release build details for a repository. When `repoId` is omitted, resolves it from the selected project's linked repo assets - auto-picked if there's exactly one, otherwise you're prompted to choose. Read-only. |
|
|
97
|
+
| `blocks release builds get <buildId> [--json]` | Alias for `release status`. Read-only. |
|
|
98
|
+
| `blocks new web <name> [--app-domain <domain>] [--client-id <oidcClientId>] [--x-blocks-key <tenantId>] [--blocks-api-url <url>] [--oidc-url <url>]` | Create a Vite React starter app that talks to Blocks exclusively through `@seliseblocks/client` (a single `createBlocksClient()` instance) using the SDK hosted IdP flow: `blocksClient.auth.idp.redirectToProvider()` on login click and `blocksClient.auth.idp.callback()` on `/login/callback`. Includes route guards, auto-refresh through `auth.oidc.refreshToken()`, live `auth`/`iam`/`data`/`localization` SDK examples, environment config, and safe `.gitignore` defaults. Uses the selected project (see `use`) unless `--x-blocks-key` overrides it. `--app-domain` and `--client-id` are resolved from the project record when omitted: the domain auto-picks if the project has exactly one, otherwise you're prompted to choose; the OIDC client is picked from the project's existing clients, or you can create a minimal one (display name + redirect URI) on the spot, or skip and register one later from the portal or `auth oidc-clients save`. When `--blocks-api-url` is omitted, `new web` derives it from the app domain as `https://blocksapi.<registrable-domain>`; for example `https://dqrsf.slsblx.com` becomes `https://blocksapi.slsblx.com`. Pass a different Data/IAM/Localization/OS gateway URL explicitly only if your project uses a non-default one. `--oidc-url` defaults to `https://iam.seliseblocks.com`. |
|
|
99
|
+
| `blocks skill list [--json]` / `skill show <name> [--json]` / `skill add <name> [--dir <path>]` | Local-only, no cloud calls: list/print the bundled `blocks-skills/*/SKILL.md` agent context docs, or copy a skill's entire directory (`SKILL.md` plus any supporting files) into `<dir>/<name>/` (default `./blocks-skills`) for use in a project outside this monorepo. `list`'s output and `show`/`add`'s "unknown skill" error both point at the full public skill catalog in case the bundled set is out of date. |
|
|
100
|
+
| `blocks sdk client [--app-domain <domain>] [--client-id <oidcClientId>] [--x-blocks-key <tenantId>] [--blocks-api-url <url>] [--oidc-url <url>] [--json]` | Read-only: resolves this project's `@seliseblocks/client` config and prints a ready-to-paste `createBlocksClient(...)` snippet. Unlike `new web`, the API URL defaults to `https://api.seliseblocks.com` unless `--blocks-api-url` is passed. Passing both `--app-domain` and `--client-id` skips the project lookup entirely (no login required). Writes nothing - use `new web` to scaffold a full app. |
|
|
101
|
+
|
|
102
|
+
Use `--json` on commands when AI or automation needs machine-readable output. Use `--dry-run` before mutations and `--yes` only after approval.
|
|
103
|
+
|
|
104
|
+
For agent-specific operating rules and command sequences, see [AI_USAGE_GUIDE.md](AI_USAGE_GUIDE.md).
|
|
105
|
+
|
|
106
|
+
### Scaffolded Web App Local HTTPS
|
|
107
|
+
|
|
108
|
+
For `blocks new web`, `--app-domain` should be the app's real Blocks domain/origin, for example `https://dbpdba.seliseblocks.com`. The generated app keeps that full value as `VITE_BLOCKS_APP_DOMAIN` and derives the local dev host without a scheme as `VITE_BLOCKS_DEV_HOST=dbpdba.seliseblocks.com`.
|
|
109
|
+
|
|
110
|
+
Browser login uses the hosted Blocks IAM IdP flow and secure cookies, so local testing on the project domain must run over HTTPS:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
cd <appName>
|
|
114
|
+
npm install
|
|
115
|
+
npm run cert
|
|
116
|
+
npm run dev
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Add the generated `VITE_BLOCKS_DEV_HOST` to your hosts file, for example:
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
127.0.0.1 dbpdba.seliseblocks.com
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Then open `https://<VITE_BLOCKS_DEV_HOST>:5173`, not plain `http://`. The generated cert script uses a Node dependency, so it works from normal PowerShell after `npm install`; OpenSSL/Git Bash is not required.
|
|
126
|
+
|
|
127
|
+
OIDC account settings are saved in the OS-specific config directory. Access and refresh tokens are stored in an OS-aware secure backend when available, and are refreshed automatically before cloud commands when a refresh token is available.
|
|
128
|
+
|
|
129
|
+
OAuth tokens use an OS-aware credential backend:
|
|
130
|
+
|
|
131
|
+
| OS | Credential backend |
|
|
132
|
+
|---|---|
|
|
133
|
+
| Windows | DPAPI-encrypted value in the CLI secret metadata file, scoped to the current Windows user. |
|
|
134
|
+
| macOS | Keychain generic password for the `seliseblocks-cli` service. |
|
|
135
|
+
| Linux | Secret Service through `secret-tool` when available. |
|
|
136
|
+
| Fallback | `0600` file storage in the CLI config directory. Set `BLOCKS_SECRET_STORE=file` to force this mode for CI or minimal containers. |
|
|
137
|
+
|
|
138
|
+
Use `blocks doctor` or `blocks auth status` to see which backend is active. Tokens are never printed by CLI status commands.
|
|
139
|
+
|
|
140
|
+
If the active OS credential backend cannot decrypt old local auth state after a Windows profile change, machine migration, Keychain reset, or corrupted token cache, clear local auth state and log in again:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
blocks auth remove <account>
|
|
144
|
+
blocks login
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Workspace
|
|
148
|
+
|
|
149
|
+
`blocks init` creates:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
blocks.json
|
|
153
|
+
blocks/
|
|
154
|
+
data/
|
|
155
|
+
schemas/
|
|
156
|
+
rules.json
|
|
157
|
+
.env.example
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Localization dictionaries are not created by `init` - the default path is `blocks/localization/<module>.<language>.json`, for example `blocks/localization/common.en.json`, and the `blocks/localization/` folder is created lazily the first time `blocks localization pull` writes to it. AI agents can create or update that file directly (before `push`, which only reads it), run `blocks localization validate`, then push it to the Localization service with `blocks localization push --dry-run` followed by `--yes` after approval. Gateway v4 routes do not include an `/api` segment.
|
|
161
|
+
|
|
162
|
+
`blocks use <tenantId>` updates the selected project in global CLI state and `blocks.json` when present.
|
|
163
|
+
|
|
164
|
+
`blocks release deploy` has no local config file - it needs a repo already linked to the project. Linking a repo requires GitHub OAuth, which only the Blocks portal can do; if none is linked, the command tells you so and stops.
|
|
165
|
+
|
|
166
|
+
## Boundaries
|
|
167
|
+
|
|
168
|
+
- `iam me` reads the CLI operator's own account identity; every other `iam *`, `mfa *`, `auth idp *`/`auth config *`/`auth client-credentials *`/`auth oidc-clients *`, `mail *`, `notification *`, `notifier *`, `secrets *`, and `storage config *` command is project-scoped and requires a selected project (`blocks use <tenantId>`) plus an impersonated project token - none of them ever run against the account token.
|
|
169
|
+
- Data covers tenant data-source configuration, schema/rules/reload/validate, field-level validation rules, and the storage object tree (`data files *`). Prefer the composed `data sync` and `data files upload` workflows.
|
|
170
|
+
- Localization covers dictionary validate/pull/push plus the full raw `/localization/v4/*` API surface (assistant, config, glossary, key, language, module). Prefer `localization key translate-and-export` over running translate/generate/export by hand.
|
|
171
|
+
- Release covers deploy trigger and build status/read commands only.
|
|
172
|
+
- No direct artifact upload unless Blocks Release adds a confirmed artifact upload API.
|
|
173
|
+
- `projects create` is currently disabled in this build (commented out pending a product decision) - don't reference it as available.
|
package/bin/run.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
await import("../dist/index.js");
|
|
2
|
+
|
|
3
|
+
await import("../dist/index.js");
|
|
@@ -1 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The endpoint URLs are not decoration: `GET /iam/v4/idp/initiate` builds the
|
|
3
|
+
* provider authorize URL from the stored `authorizationUrl` and falls back to an
|
|
4
|
+
* empty base when it is missing, so a provider saved without it hands the browser
|
|
5
|
+
* a bare query string. Apple-only fields (teamId/keyId/privateKey/appleAudience)
|
|
6
|
+
* stay in --body/--file so no private key lands in shell history.
|
|
7
|
+
*/
|
|
1
8
|
export declare function authIdpCreate(argv: string[]): Promise<void>;
|
|
@@ -1,25 +1,44 @@
|
|
|
1
|
-
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
1
|
+
import { booleanFlag, optionalBooleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
2
|
import { blocksRequest } from "../../../lib/api.js";
|
|
3
3
|
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
4
|
import { compact, jsonBodyFlag, listFlag } from "../../../lib/json-flag.js";
|
|
5
5
|
import { writeOutput } from "../../../lib/output.js";
|
|
6
6
|
import { requestContext } from "../../../lib/request-context.js";
|
|
7
7
|
import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
8
|
+
/**
|
|
9
|
+
* The endpoint URLs are not decoration: `GET /iam/v4/idp/initiate` builds the
|
|
10
|
+
* provider authorize URL from the stored `authorizationUrl` and falls back to an
|
|
11
|
+
* empty base when it is missing, so a provider saved without it hands the browser
|
|
12
|
+
* a bare query string. Apple-only fields (teamId/keyId/privateKey/appleAudience)
|
|
13
|
+
* stay in --body/--file so no private key lands in shell history.
|
|
14
|
+
*/
|
|
8
15
|
export async function authIdpCreate(argv) {
|
|
9
16
|
const { flags } = parseCommand(argv);
|
|
10
17
|
const body = {
|
|
11
18
|
...(await jsonBodyFlag(flags)),
|
|
12
19
|
...compact({
|
|
20
|
+
authorizationUrl: stringFlag(flags, "authorization-url") || undefined,
|
|
13
21
|
clientId: stringFlag(flags, "client-id") || undefined,
|
|
14
22
|
clientSecret: stringFlag(flags, "client-secret") || undefined,
|
|
15
23
|
displayName: stringFlag(flags, "display-name") || undefined,
|
|
16
|
-
|
|
24
|
+
grantTypes: listFlag(flags, "grant-types"),
|
|
25
|
+
icon: stringFlag(flags, "icon") || undefined,
|
|
26
|
+
initialPermissions: listFlag(flags, "initial-permissions"),
|
|
27
|
+
initialRoles: listFlag(flags, "initial-roles"),
|
|
28
|
+
isActive: optionalBooleanFlag(flags, "active"),
|
|
17
29
|
issuer: stringFlag(flags, "issuer") || undefined,
|
|
30
|
+
jwksUri: stringFlag(flags, "jwks-uri") || undefined,
|
|
18
31
|
protocol: stringFlag(flags, "protocol") || undefined,
|
|
19
32
|
provider: stringFlag(flags, "provider") || undefined,
|
|
20
33
|
providerType: stringFlag(flags, "provider-type") || undefined,
|
|
21
34
|
redirectUris: listFlag(flags, "redirect-uris"),
|
|
22
|
-
|
|
35
|
+
requirePkce: optionalBooleanFlag(flags, "require-pkce"),
|
|
36
|
+
responseType: stringFlag(flags, "response-type") || undefined,
|
|
37
|
+
scope: stringFlag(flags, "scope") || undefined,
|
|
38
|
+
tokenEndpointAuthMethod: stringFlag(flags, "token-endpoint-auth-method") || undefined,
|
|
39
|
+
tokenUrl: stringFlag(flags, "token-url") || undefined,
|
|
40
|
+
userInfoUrl: stringFlag(flags, "user-info-url") || undefined,
|
|
41
|
+
wellKnownUrl: stringFlag(flags, "well-known-url") || undefined
|
|
23
42
|
})
|
|
24
43
|
};
|
|
25
44
|
if (!body.provider || !body.providerType || !body.protocol || !body.clientId) {
|
|
@@ -3,5 +3,12 @@
|
|
|
3
3
|
* IAM requires them to echo the existing value when supplied, so only pass them
|
|
4
4
|
* via --provider/--provider-type/--protocol/--client-id if you're re-sending the
|
|
5
5
|
* current configuration alongside other field changes.
|
|
6
|
+
*
|
|
7
|
+
* This is also the only endpoint that can set the OIDC endpoint URLs: the create
|
|
8
|
+
* endpoint silently drops authorizationUrl/tokenUrl/userInfoUrl, and a provider
|
|
9
|
+
* auto-registered from an OIDC client (--register-as-identity-provider) never has
|
|
10
|
+
* them. `GET /iam/v4/idp/initiate` needs authorizationUrl, so a freshly created
|
|
11
|
+
* provider has to be patched here before hosted login works. Apple-only fields
|
|
12
|
+
* stay in --body/--file so no private key lands in shell history.
|
|
6
13
|
*/
|
|
7
14
|
export declare function authIdpUpdate(argv: string[]): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { booleanFlag, stringFlag } from "../../../lib/args.js";
|
|
1
|
+
import { booleanFlag, optionalBooleanFlag, stringFlag } from "../../../lib/args.js";
|
|
2
2
|
import { blocksRequest } from "../../../lib/api.js";
|
|
3
3
|
import { confirmMutation } from "../../../lib/confirm.js";
|
|
4
4
|
import { compact, jsonBodyFlag, listFlag } from "../../../lib/json-flag.js";
|
|
@@ -10,6 +10,13 @@ import { parseCommand, selectedProject } from "../../../lib/workspace.js";
|
|
|
10
10
|
* IAM requires them to echo the existing value when supplied, so only pass them
|
|
11
11
|
* via --provider/--provider-type/--protocol/--client-id if you're re-sending the
|
|
12
12
|
* current configuration alongside other field changes.
|
|
13
|
+
*
|
|
14
|
+
* This is also the only endpoint that can set the OIDC endpoint URLs: the create
|
|
15
|
+
* endpoint silently drops authorizationUrl/tokenUrl/userInfoUrl, and a provider
|
|
16
|
+
* auto-registered from an OIDC client (--register-as-identity-provider) never has
|
|
17
|
+
* them. `GET /iam/v4/idp/initiate` needs authorizationUrl, so a freshly created
|
|
18
|
+
* provider has to be patched here before hosted login works. Apple-only fields
|
|
19
|
+
* stay in --body/--file so no private key lands in shell history.
|
|
13
20
|
*/
|
|
14
21
|
export async function authIdpUpdate(argv) {
|
|
15
22
|
const { args, flags } = parseCommand(argv);
|
|
@@ -17,15 +24,27 @@ export async function authIdpUpdate(argv) {
|
|
|
17
24
|
const body = {
|
|
18
25
|
...(await jsonBodyFlag(flags)),
|
|
19
26
|
...compact({
|
|
27
|
+
authorizationUrl: stringFlag(flags, "authorization-url") || undefined,
|
|
20
28
|
clientId: stringFlag(flags, "client-id") || undefined,
|
|
21
29
|
displayName: stringFlag(flags, "display-name") || undefined,
|
|
22
|
-
|
|
30
|
+
grantTypes: listFlag(flags, "grant-types"),
|
|
31
|
+
icon: stringFlag(flags, "icon") || undefined,
|
|
32
|
+
initialPermissions: listFlag(flags, "initial-permissions"),
|
|
33
|
+
initialRoles: listFlag(flags, "initial-roles"),
|
|
34
|
+
isActive: optionalBooleanFlag(flags, "active"),
|
|
23
35
|
issuer: stringFlag(flags, "issuer") || undefined,
|
|
36
|
+
jwksUri: stringFlag(flags, "jwks-uri") || undefined,
|
|
24
37
|
protocol: stringFlag(flags, "protocol") || undefined,
|
|
25
38
|
provider: stringFlag(flags, "provider") || undefined,
|
|
26
39
|
providerType: stringFlag(flags, "provider-type") || undefined,
|
|
27
40
|
redirectUris: listFlag(flags, "redirect-uris"),
|
|
28
|
-
|
|
41
|
+
requirePkce: optionalBooleanFlag(flags, "require-pkce"),
|
|
42
|
+
responseType: stringFlag(flags, "response-type") || undefined,
|
|
43
|
+
scope: stringFlag(flags, "scope") || undefined,
|
|
44
|
+
tokenEndpointAuthMethod: stringFlag(flags, "token-endpoint-auth-method") || undefined,
|
|
45
|
+
tokenUrl: stringFlag(flags, "token-url") || undefined,
|
|
46
|
+
userInfoUrl: stringFlag(flags, "user-info-url") || undefined,
|
|
47
|
+
wellKnownUrl: stringFlag(flags, "well-known-url") || undefined
|
|
29
48
|
})
|
|
30
49
|
};
|
|
31
50
|
if (booleanFlag(flags, "dry-run")) {
|
package/dist/commands/new/web.js
CHANGED
|
@@ -132,8 +132,12 @@ async function createOidcClientInteractively(tenantId, appDomain, appName, flags
|
|
|
132
132
|
const defaultRedirect = `https://${appDomain}/login/callback`;
|
|
133
133
|
const displayName = (await promptText(`OIDC client display name [${appName}]: `)) || appName;
|
|
134
134
|
const redirectUri = (await promptText(`Redirect URI [${defaultRedirect}]: `)) || defaultRedirect;
|
|
135
|
+
// clientType drives IAM's tokenEndpointAuthMethod: omitting it stores this browser
|
|
136
|
+
// app as confidential ("client_secret_post") and lets it request client_credentials.
|
|
137
|
+
// The scaffold only ever produces a PKCE SPA, so it is always "public".
|
|
135
138
|
const body = {
|
|
136
139
|
clientDisplayName: displayName,
|
|
140
|
+
clientType: "public",
|
|
137
141
|
isActive: true,
|
|
138
142
|
redirectUris: [redirectUri],
|
|
139
143
|
registerAsIdentityProvider: true,
|