@seliseblocks/cli-os 0.2.7 → 0.2.9

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.
Files changed (42) hide show
  1. package/AI_USAGE_GUIDE.md +560 -560
  2. package/LICENSE +21 -21
  3. package/README.md +173 -173
  4. package/bin/run.js +2 -2
  5. package/dist/commands/data/rules/deploy.js +84 -9
  6. package/dist/commands/data/rules/pull.js +13 -7
  7. package/dist/commands/data/schema/get.js +31 -0
  8. package/dist/commands/data/schema/list.js +8 -1
  9. package/dist/commands/data/schema/pull.js +22 -9
  10. package/dist/commands/data/schema/push.js +31 -9
  11. package/dist/index.js +702 -692
  12. package/dist/lib/data-files.d.ts +14 -0
  13. package/dist/lib/data-files.js +91 -0
  14. package/dist/lib/data-response.d.ts +13 -0
  15. package/dist/lib/data-response.js +26 -0
  16. package/dist/skills/blocks-data-gateway-configuration/SKILL.md +204 -204
  17. package/dist/skills/blocks-data-gateway-crud/SKILL.md +223 -223
  18. package/dist/skills/blocks-data-storage/SKILL.md +253 -253
  19. package/dist/skills/blocks-data-storage/flows/object-management.md +124 -124
  20. package/dist/skills/blocks-frontend-local-https/SKILL.md +100 -100
  21. package/dist/skills/blocks-iam-access-control/SKILL.md +49 -49
  22. package/dist/skills/blocks-iam-access-control/flows/feature-gating.md +38 -38
  23. package/dist/skills/blocks-iam-access-control/flows/manage-roles-permissions.md +110 -110
  24. package/dist/skills/blocks-iam-account/SKILL.md +169 -169
  25. package/dist/skills/blocks-iam-mfa/SKILL.md +124 -124
  26. package/dist/skills/blocks-iam-organizations/SKILL.md +43 -43
  27. package/dist/skills/blocks-iam-organizations/flows/admin-mutations.md +89 -89
  28. package/dist/skills/blocks-iam-organizations/flows/read-and-switch.md +57 -57
  29. package/dist/skills/blocks-iam-sso-oidc-configuration/SKILL.md +105 -105
  30. package/dist/skills/blocks-iam-sso-oidc-implementation/SKILL.md +80 -80
  31. package/dist/skills/blocks-iam-users/SKILL.md +131 -131
  32. package/dist/skills/blocks-localization-configuration/SKILL.md +149 -149
  33. package/dist/skills/blocks-localization-implementation/SKILL.md +63 -63
  34. package/dist/skills/blocks-mail/SKILL.md +95 -95
  35. package/dist/skills/blocks-notification/SKILL.md +69 -69
  36. package/dist/skills/blocks-notifier/SKILL.md +107 -107
  37. package/dist/skills/blocks-onboarding/SKILL.md +77 -78
  38. package/dist/skills/blocks-release-deployment/SKILL.md +81 -81
  39. package/dist/skills/blocks-secrets/SKILL.md +81 -81
  40. package/dist/skills/blocks-storage-configuration/SKILL.md +93 -93
  41. package/dist/skills/lint.mjs +168 -168
  42. package/package.json +47 -47
package/dist/index.js CHANGED
@@ -485,697 +485,707 @@ function toCliError(error) {
485
485
  return { code: "command_failed", message };
486
486
  }
487
487
  function printHelp() {
488
- console.log(`Blocks CLI
489
-
490
- Usage:
491
- blocks <command> [options]
492
-
493
- Namespaced commands use spaces, e.g. 'blocks data schema list'.
494
- ':' also works if you prefer it: 'blocks data:schema:list'.
495
-
496
- Global options:
497
- --version Print CLI version.
498
- --json Print machine-readable JSON where supported.
499
- --api-url <url> Override Blocks API URL for this command.
500
- --account <name> Use a named account profile; default is implicit.
501
- --project <tenantId> Use a project tenant for project-scoped commands.
502
- --dry-run Show planned mutation without calling the API.
503
- --yes Skip mutation confirmation after explicit approval.
504
-
505
- Setup and health:
506
- blocks init
507
- Create local Blocks workspace files: blocks.json, data schema/rules folders,
508
- and .env.example.
509
-
510
- blocks doctor [--json]
511
- Check local Node.js, OIDC config, token cache, selected project, and config
512
- file locations. Does not mutate cloud resources.
513
-
514
- Auth:
515
- blocks login
516
- Device-code login. Prints a verification URL and user code, opens the
517
- browser to the verification page when possible so you only need to click
518
- approve, then polls until the device is authorized; stores account access
519
- and refresh tokens and auto-refreshes later. If a project was previously
520
- selected, re-impersonates it automatically; otherwise lists projects and
521
- prompts you to run 'blocks use <tenantId>'.
522
-
523
- blocks auth status [--json]
524
- Show only whether account/project access and refresh tokens are missing,
525
- valid, expired, or available. Does not print account config values.
526
-
527
- blocks auth refresh [--project] [--json]
528
- Force account token refresh, or project token refresh with --project.
529
-
530
- blocks auth remove <account>
531
- Clear cached tokens and stored local credentials for that account. The
532
- packaged default OS account is restored from package defaults.
533
-
534
- blocks logout
535
- Revoke the current refresh token when possible and remove local session data.
536
-
537
- Projects:
538
- blocks projects list [--json]
539
- List accessible Blocks projects via /os/v4/Project/Gets. Uses the
540
- impersonated project session when a project is selected, otherwise the
541
- account token. Read-only.
542
-
543
- blocks projects get [tenantId] [--deployment] [--json]
544
- Read one project from Project/Gets. Uses selected project when tenantId is
545
- omitted. Pass --deployment to also include the environment, tenantGroupId,
546
- and linked repo assets (from Project/GetAsset) that 'release deploy' uses
547
- to resolve its target. Read-only.
548
-
549
- blocks use <project-tenant-id>
550
- Save the selected project tenant globally and in blocks.json when present,
551
- then immediately impersonate it. If a different project was selected,
552
- stops that impersonation first to reclaim a fresh account refresh token
553
- before starting the new one.
554
-
555
- blocks deselect
556
- Stop the active impersonation (restoring a fresh account refresh token),
557
- then clear the selected project tenant (globally and in blocks.json) and
558
- drop its cached impersonation token. Run 'blocks use <tenantId>' again to
559
- reselect and re-impersonate.
560
-
561
- IAM:
562
- blocks iam me [--json]
563
- Read the current user from IAM (bootstrapping/CLI operator identity, not
564
- a project resource). Uses the impersonated project session when a project
565
- is selected, otherwise the account token -- the server always resolves
566
- this to the root identity either way. Every other iam * command below is
567
- project-scoped: it requires a selected project and calls IAM using an
568
- impersonated project token only, never the account token.
569
-
570
- Users (/iam/v4/iam/users*):
571
- blocks iam users list [--page 1] [--page-size 20] [--email <e>] [--name <n>]
572
- [--organization-id <id>] [--sort-by <field>] [--sort-desc]
573
- [--filter '<json>'] [--json]
574
- Query users. --filter merges a raw JSON filter object over the convenience flags.
575
- blocks iam users get <id> [--organization-id <id>] [--json]
576
- blocks iam users create --email <e>|--user-name <n> [--first-name] [--last-name]
577
- [--password] [--phone-number] [--organization-id]
578
- [--roles a,b] [--permissions a,b] [--body '<json>'|--file <path>]
579
- [--dry-run] [--yes] [--json]
580
- blocks iam users update <id> [--first-name] [--last-name] [--phone-number]
581
- [--organization-id] [--roles a,b] [--permissions a,b]
582
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
583
- blocks iam users activate <userId> [--reason <text>] [--dry-run] [--yes] [--json]
584
- blocks iam users deactivate <userId> [--dry-run] [--yes] [--json]
585
- blocks iam users access grant <userId> [--roles a,b] [--permissions a,b]
586
- [--organization-id] [--dry-run] [--yes] [--json]
587
- blocks iam users access revoke <userId> [--organization-id] [--dry-run] [--yes] [--json]
588
- blocks iam users exists <email> [--json]
589
- blocks iam email available <email> [--json]
590
-
591
- Roles (/iam/v4/iam/roles*):
592
- blocks iam roles list [--page] [--page-size] [--search] [--slugs a,b]
593
- [--organization-id] [--filter '<json>'] [--json]
594
- blocks iam roles get <id> [--json]
595
- blocks iam roles create --name <n> [--slug] [--description] [--parent-role-slug]
596
- [--can-create-own] [--body '<json>'|--file <path>]
597
- [--dry-run] [--yes] [--json]
598
- blocks iam roles update <itemId> [--name] [--description] [--parent-role-slug]
599
- [--propagate-to-other-org] [--can-create-own]
600
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
601
- blocks iam roles assign-permissions <slug> [--add-permissions a,b]
602
- [--remove-permissions a,b] [--organization-id]
603
- [--dry-run] [--yes] [--json]
604
- blocks iam roles assignable [--json]
605
-
606
- Permissions (/iam/v4/iam/permissions*):
607
- blocks iam permissions list [--page] [--page-size] [--search] [--type <0-3>]
608
- [--severity <0-4>] [--resource-group] [--tags a,b]
609
- [--resources a,b] [--is-built-in] [--is-archived]
610
- [--roles a,b] [--organization-id] [--filter '<json>'] [--json]
611
- blocks iam permissions get <id> [--json]
612
- blocks iam permissions create --name <n> [--type] [--description] [--resource]
613
- [--resource-group] [--tags a,b] [--severity] [--is-built-in]
614
- [--dependent-permissions a,b] [--body '<json>'|--file <path>]
615
- [--dry-run] [--yes] [--json]
616
- blocks iam permissions update <id> [same flags as create, plus --is-archived]
617
- [--dry-run] [--yes] [--json]
618
- blocks iam permissions by-severity [--json]
619
-
620
- Resources (/iam/v4/iam/resource*):
621
- blocks iam resources groups [--json]
622
- blocks iam resources features [--search <text>] [--is-built-in] [--json]
623
-
624
- Organizations (/iam/v4/iam/organizations*):
625
- blocks iam organizations list [--page] [--page-size] [--search] [--ids a,b]
626
- [--is-disabled] [--parent-organization-id] [--json]
627
- blocks iam organizations get <id> [--json]
628
- blocks iam organizations create --name <n> [--description] [--email] [--phone-number]
629
- [--website-url] [--default-roles a,b] [--default-permissions a,b]
630
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
631
- blocks iam organizations update <id> [--name] [--description] [--email]
632
- [--phone-number] [--website-url] [--industry] [--time-zone]
633
- [--currency] [--locale] [--is-enabled]
634
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
635
- blocks iam organizations my [--json]
636
- blocks iam organizations config get [--json]
637
- blocks iam organizations config save [--allow-org-creation-from-cloud]
638
- [--allow-org-creation-from-construct] [--allow-org-creation-from-signup]
639
- [--allow-org-creation-from-portal] [--multi-org-enabled]
640
- [--consent-for-multi-org-enable] [--body '<json>'|--file <path>]
641
- [--dry-run] [--yes] [--json]
642
-
643
- Signup settings (/iam/v4/iam/signup-settings):
644
- blocks iam signup-settings get [--json]
645
- blocks iam signup-settings save [--email-password-signup] [--sso-signup]
646
- [--default-roles a,b] [--default-permissions a,b]
647
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
648
-
649
- MFA (/iam/v4/mfa*, project-scoped: requires a selected project, impersonated project token only):
650
- blocks mfa config get [--json]
651
- Read the tenant's MFA policy.
652
- blocks mfa config save [--enable] [--require-for-all-users] [--allow-user-opt-out]
653
- [--allow-backup-codes] [--backup-codes-count <n>]
654
- [--user-mfa-type 0,1] [--required-roles a,b] [--exempt-roles a,b]
655
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
656
- Save the tenant's MFA policy.
657
- blocks mfa totp setup [--json]
658
- Start TOTP enrollment for the impersonated user.
659
- blocks mfa totp verify-setup <code> [--json]
660
- Confirm TOTP enrollment.
661
- blocks mfa totp enable --mfa-type <n> [--code <c>] [--dry-run] [--yes] [--json]
662
- Composed enrollment: totp setup -> (scan the printed QR/secret, enter the code --
663
- interactively prompted if --code is omitted) -> totp verify-setup -> method set
664
- --mfa-type <n> -> backup-codes generate. One sitting, one confirmation.
665
- --mfa-type is required and not defaulted: the numeric value meaning "TOTP" is
666
- tenant-defined and undocumented here (same value plain mfa method set expects) --
667
- look it up rather than guessing.
668
- blocks mfa generate --mfa-type <n> [--send-phone-number-as-email-domain <domain>] [--json]
669
- Send an OTP challenge; returns an mfaId to pass to resend/verify.
670
- blocks mfa resend <mfaId> [--send-phone-number-as-email-domain <domain>] [--json]
671
- blocks mfa verify <mfaId> <code> --auth-type <n> [--from-token-call] [--json]
672
- blocks mfa method set --mfa-type <n> [--json]
673
- Switch the impersonated user's active MFA method.
674
- blocks mfa disable [--dry-run] [--yes] [--json]
675
- blocks mfa backup-codes list [--json]
676
- blocks mfa backup-codes generate [--dry-run] [--yes] [--json]
677
- blocks mfa backup-codes use <userId> <code> [--json]
678
-
679
- Mail (/os/v4/Mail/* — project-scoped: requires a selected project, impersonated project token only):
680
- blocks mail config list [--json]
681
- List SMTP/inbound mail configurations for the selected project.
682
- blocks mail config get <name> [--json]
683
- blocks mail config save [--configuration-id <id>] [--name <n>] [--host <h>] [--port <n>]
684
- [--enable-ssl] [--sender-name] [--sender-address] [--sender-username]
685
- [--account-password] [--inbound] [--provider <0|1>]
686
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
687
- Upsert: omit --configuration-id to create; pass it to update.
688
- blocks mail config delete <configurationId> [--dry-run] [--yes] [--json]
689
- blocks mail config duplicate <configurationId> [--dry-run] [--yes] [--json]
690
- blocks mail template list [--page-number] [--page-size] [--search] [--sort-by] [--sort-desc]
691
- [--configuration-id] [--language] [--json]
692
- blocks mail template get <itemId> [--json]
693
- blocks mail template save [--item-id <id>] [--configuration-id] [--name] [--language]
694
- [--subject] [--template-body] [--json-content] [--image-id]
695
- [--image-url] [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
696
- Upsert: omit --item-id to create; pass it to update.
697
- blocks mail template delete <itemId> [--dry-run] [--yes] [--json]
698
- blocks mail template clone <itemId> [--configuration-id] [--language] [--name] [--subject]
699
- [--dry-run] [--yes] [--json]
700
- blocks mail mailbox list [--page-number] [--page-size] [--status] [--search]
701
- [--start-date] [--end-date] [--inbound] [--json]
702
- blocks mail mailbox get <messageId> [--json]
703
- blocks mail send [--to a,b] [--cc a,b] [--bcc a,b] [--reply-to a,b] [--purpose <p>]
704
- [--language <culture>] [--subject-data-context '<json>']
705
- [--body-data-context '<json>'] [--attachments '<json>']
706
- [--send-phone-number-as-email] [--project-key <key>]
707
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
708
- Send an email through the tenant's default mail configuration
709
- (/logic/v4/Mail/Send). --project-key defaults to the selected project.
710
- blocks mail sendtoany [same flags as mail send, plus --is-test-mail]
711
- [--dry-run] [--yes] [--json]
712
- Same as mail send but via /logic/v4/Mail/SendToAny, which lets the mail
713
- provider route the send (e.g. mark it --is-test-mail).
714
-
715
- Notification (/os/v4/Notification/* — project-scoped: requires a selected project, impersonated project token only):
716
- blocks notification list [--page] [--page-size] [--sort-by] [--sort-desc] [--filter] [--json]
717
- blocks notification get <itemId> [--json]
718
- blocks notification save [--name <n>] [--channel <0|1>] [--type <0-3>] [--enable-persistence]
719
- [--notify-method] [--update] [--body '<json>'|--file <path>]
720
- [--dry-run] [--yes] [--json]
721
- Pass --update when saving over an existing notification configuration.
722
- blocks notification delete <itemId> [--dry-run] [--yes] [--json]
723
-
724
- Notifier (/logic/v4/Notifier/* — real-time/offline notification sends and inbox reads;
725
- project-scoped: requires a selected project, impersonated project token only.
726
- Distinct from 'notification' above, which manages notification channel
727
- configuration, not sending):
728
- blocks notifier notify [--user-ids a,b] [--roles a,b] [--connection-id <id>]
729
- [--subscription-filters '<json>'] [--denormalized-payload <text>]
730
- [--save-denormalized-payload-as-object] [--response-key]
731
- [--response-value] [--content-available] [--configuration-name]
732
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
733
- Push a notification to specific users/roles, or everyone matching a subscription
734
- filter. Target with at least one of --user-ids/--roles/--subscription-filters.
735
- blocks notifier list [--unread-only] [--page] [--page-size] [--sort-by] [--sort-desc]
736
- [--filter] [--json]
737
- List the signed-in user's notifications (GetNotifications). Read-only.
738
- blocks notifier unread [--user-id <id>] [--context <c>] [--action-name <a>] [--value <v>]
739
- [--order-by <1|2>] [--json]
740
- Read unread notifications matching a subscription filter. Sent as query
741
- parameters even though swagger documents this endpoint as GET with a JSON
742
- body -- the Fetch spec forbids a body on GET. Read-only.
743
- blocks notifier mark-read <id> [--dry-run] [--yes] [--json]
744
- blocks notifier mark-all-read [--dry-run] [--yes] [--json]
745
-
746
- Secrets (/os/v4/Secrets/* — project-scoped: requires a selected project, impersonated project
747
- token only; generic tenant secret storage, e.g. captcha provider config):
748
- blocks secrets get <secretKey> [--page-number 0] [--page-size 10] [--json]
749
- blocks secrets save --secret-key <key> [--item-id <id>] --key-value-pairs '<json>'
750
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
751
- Upsert: omit --item-id to create, pass it to update. --key-value-pairs is a flat
752
- JSON object of provider-specific fields, e.g.
753
- --key-value-pairs '{"isEnable":"true","provider":"recaptcha","captchaKey":"...","captchaSecret":"..."}'.
754
-
755
- Storage (/os/v4/Storage/* — project-scoped: requires a selected project, impersonated project token only):
756
- blocks storage config list [--json]
757
- blocks storage config get <name> [--json]
758
- blocks storage config save [--item-id <id>] [--name <n>] [--strategy] [--connection-string]
759
- [--secret-key] [--access-key] [--region-endpoint] [--host] [--port]
760
- [--username] [--password] [--remote-base-path] [--update]
761
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
762
- Upsert: omit --item-id to create; pass --update to update.
763
- blocks storage config delete <name> [--dry-run] [--yes] [--json]
764
-
765
- Auth Admin (/iam/v4/auth/identity-providers*, /config, /client-credentials, /oidc-clients —
766
- project-scoped: requires a selected project, impersonated project token only):
767
- blocks auth idp list [--json]
768
- blocks auth idp get <id> [--json]
769
- blocks auth idp create --provider <p> --provider-type <t> --protocol <proto>
770
- --client-id <id> [--client-secret] [--display-name] [--issuer]
771
- [--scope] [--redirect-uris a,b] [--active]
772
- [--authorization-url] [--token-url] [--user-info-url]
773
- [--jwks-uri] [--well-known-url] [--response-type]
774
- [--grant-types a,b] [--require-pkce]
775
- [--token-endpoint-auth-method] [--initial-roles a,b]
776
- [--initial-permissions a,b] [--icon]
777
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
778
- Apple-specific fields (teamId, keyId, privateKey, appleAudience) go in --body/--file
779
- so no private key lands in shell history.
780
- IAM's create endpoint stores issuer/jwksUri/wellKnownUrl but drops
781
- authorizationUrl/tokenUrl/userInfoUrl -- set those with 'idp update' afterward.
782
- blocks auth idp update <id> [same flags as create, all optional] [--dry-run] [--yes] [--json]
783
- provider/providerType/protocol/clientId are immutable: omit them, or echo the
784
- existing values exactly if you also pass --body/--file.
785
- The only endpoint that persists authorizationUrl/tokenUrl/userInfoUrl -- create accepts
786
- and drops them, and update never re-runs discovery, so values set here stick. Use it to
787
- repair a provider whose authorizationUrl came back null: '/idp/initiate' builds its
788
- redirect from that field, so hosted login goes nowhere without it. Read the endpoint
789
- values from the tenant's discovery document rather than composing them by hand.
790
- blocks auth idp delete <id> [--dry-run] [--yes] [--json]
791
- Irreversible; also deletes the related OIDC client registration.
792
- blocks auth idp status <id> --active|--active=false [--dry-run] [--yes] [--json]
793
- Enable/disable a provider without deleting its configuration.
794
- blocks auth config get [--json]
795
- blocks auth config save [--refresh-token-minutes] [--absolute-refresh-token-minutes]
796
- [--access-token-minutes] [--remember-me-refresh-token-minutes]
797
- [--wrong-attempts-to-lock] [--account-lock-duration-minutes]
798
- [--oidc-enabled] [--logout-on-password-change]
799
- [--password-strength-regex] [--body '<json>'|--file <path>]
800
- [--dry-run] [--yes] [--json]
801
- blocks auth client-credentials list [--json]
802
- clientSecret is included in list responses; treat CLI output as sensitive.
803
- blocks auth client-credentials save --name <n> [--item-id <id>] [--roles a,b]
804
- [--permissions a,b] [--access-token-valid-minutes] [--active]
805
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
806
- Omit --item-id to create; pass it to update. The response's clientSecret is
807
- shown once and is not retrievable again afterward.
808
- blocks auth client-credentials delete <id> [--dry-run] [--yes] [--json]
809
-
810
- blocks auth oidc-clients list [--json]
811
- List registered OAuth 2.0 / OIDC client applications for the tenant. client_secret
812
- is excluded from list/get responses.
813
- blocks auth oidc-clients get <clientId> [--json]
814
- blocks auth oidc-clients save [--item-id <id>] [--client-display-name] [--client-type]
815
- [--redirect-uris a,b] [--post-logout-redirect-uris a,b]
816
- [--scope] [--allowed-scopes a,b] [--allowed-response-types a,b]
817
- [--require-pkce] [--require-consent] [--require-mfa]
818
- [--allowed-mfa-methods 0,1] [--front-channel-logout-uri]
819
- [--back-channel-logout-uri] [--auto-redirect]
820
- [--external-discovery-endpoint] [--active] [--login-mode]
821
- [--client-logo-url] [--client-brand-color] [--use-tokens-cookie]
822
- [--register-as-identity-provider] [--device-flow-client]
823
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
824
- Upsert: omit --item-id to register a new client, pass it to update an existing one.
825
- The response's client_secret is shown once and is not retrievable again afterward.
826
- --client-type is not optional in practice: IAM derives tokenEndpointAuthMethod from it,
827
- so omitting it stores a browser/SPA client as confidential ("client_secret_post") and
828
- lets it request the client_credentials grant. Pass --client-type public for any
829
- PKCE/browser client.
830
- --register-as-identity-provider creates the linked identity provider in the same call.
831
- Its authorize/token/userinfo/jwks/issuer values are filled from the discovery document
832
- at --external-discovery-endpoint; with no discovery endpoint they are left null and the
833
- provider's scope is replaced with "openid profile email". Verify with 'auth idp list'.
834
- blocks auth oidc-clients delete <clientId> [--dry-run] [--yes] [--json]
835
- Irreversible; revokes all tokens issued to the client.
836
- blocks auth oidc-clients rotate-secret <clientId> [--dry-run] [--yes] [--json]
837
- Generates a new client_secret, shown once; the old secret stops working immediately.
838
-
839
- Data:
840
- blocks data validate [--json]
841
- Validate local blocks/data/schemas/*.json and blocks/data/rules.json before
842
- pushing. Local-only.
843
-
844
- blocks data schema list [--json]
845
- List project schemas via /data/v4/schemas using an impersonated project
846
- token. Read-only.
847
-
848
- blocks data schema pull [--json]
849
- Download project schemas into blocks/data/schemas/*.json. Writes local files
850
- only.
851
-
852
- blocks data schema push [--dry-run] [--yes] [--json]
853
- Create or update project schemas via /data/v4/schemas/define. Mutating;
854
- uses POST for create and PUT for update.
855
-
856
- blocks data rules pull [--json]
857
- Download data-access policies into blocks/data/rules.json. Writes local
858
- files only.
859
-
860
- blocks data rules deploy [--dry-run] [--yes] [--json]
861
- Apply schema security and data-access policies. Mutating; supports dry-run
862
- and confirmation.
863
-
864
- blocks data reload [--dry-run] [--yes] [--json]
865
- Reload Data schema configuration so staged schema/rule changes become live.
866
- Mutating; calls POST /data/v4/schema-configurations/reload.
867
-
868
- blocks data sync [--dry-run] [--yes] [--json]
869
- Composed flow: validate local schemas/rules, then data schema push ->
870
- data rules deploy -> data reload, so pushed changes actually go live in one
871
- step. Validation runs first and hard-fails before anything is sent if it
872
- finds errors. Prints 3 separate step outputs (one per underlying command),
873
- not one combined document. One confirmation covers the whole flow.
874
-
875
- Data source configuration (/data/v4/configurations) - check this first; by default a
876
- project's Data Gateway runs on Blocks-managed storage and data config get is all you need.
877
- Only create/update a configuration if you're pointing the gateway at your own database.
878
- blocks data config get [--json]
879
- blocks data config create --connection-string <cs> [--database-name <name>]
880
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
881
- blocks data config update --item-id <id> [--connection-string] [--database-name]
882
- [--collection-name-editable] [--collection-name-pattern]
883
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
884
-
885
- Raw Schema API (/data/v4/schemas* - beyond the file-oriented list/pull/push above):
886
- blocks data schema get <id> [--json]
887
- blocks data schema get-by-name <schemaName> [--json]
888
- Full field-level detail by collection name (info-by-name).
889
- blocks data schema aggregation [--keyword] [--schema-name] [--collection-name]
890
- [--schema-type <1|2>] [--page] [--page-size] [--sort-by]
891
- [--sort-desc] [--json]
892
- Schemas plus an access-level summary (Public/User/Custom x Read/Write/Edit/Delete).
893
- blocks data schema change-logs [--json]
894
- Unadapted schema change logs; data reload clears these.
895
- blocks data schema delete <id> [--dry-run] [--yes] [--json]
896
- Irreversible.
897
- blocks data schema info list [--json]
898
- Entity-type schema collections with basic info.
899
- blocks data schema info save --schema-name <n> [--collection-name] [--schema-type <1|2>]
900
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
901
- Create schema metadata only (no fields yet) - pair with data schema fields.
902
- blocks data schema info update --item-id <id> [--schema-name] [--collection-name]
903
- [--schema-type <1|2>] [--body '<json>'|--file <path>]
904
- [--dry-run] [--yes] [--json]
905
- blocks data schema fields --schema-id <schemaDefinitionItemId> [--deletable-fields a,b]
906
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
907
- Add/update field definitions; the 'fields' array (name/type/isArray/isPIIData/
908
- isUniqueData/description) goes in --body/--file, e.g.
909
- --body '{"fields":[{"name":"email","type":"string"}]}'.
910
-
911
- Data-access policies, single-item ops (beyond the file-oriented rules pull/deploy above):
912
- blocks data rules policy get <schemaName> [--json]
913
- blocks data rules policy delete <itemId> [--dry-run] [--yes] [--json]
914
-
915
- Data validation (/data/v4/data-validations* - field-level validation rules; no file-oriented
916
- workflow exists for this yet, use these directly):
917
- blocks data validation list [--schema-id] [--field-name] [--keyword] [--page]
918
- [--page-size] [--sort-by] [--sort-desc] [--json]
919
- blocks data validation get <validationId> [--json]
920
- blocks data validation by-schema <schemaId> [--json]
921
- blocks data validation by-schema-field <schemaId> <fieldName> [--json]
922
- blocks data validation save --schema-id <id> --field-name <name> [--item-id]
923
- --body '<json>' (must include a "validations" array, e.g.
924
- '{"validations":[{"type":1,"value":"^[0-9]+$","isActive":true}]}')
925
- [--dry-run] [--yes] [--json]
926
- Upsert: omit --item-id to create, pass it to update.
927
- blocks data validation delete <validationId> [--dry-run] [--yes] [--json]
928
-
929
- Storage object tree (files, directories, discovery, trash, versions, and access):
930
- blocks data files get <fileId> [--version] [--configuration-name] [--json]
931
- blocks data files get-many <fileId...>|--file-ids a,b [--configuration-name] [--json]
932
- blocks data files info [--name] [--tenant-id] [--page] [--page-size] [--sort-by]
933
- [--sort-desc] [--json]
934
- blocks data files upload --file <localPath> [--name] [--item-id] [--parent-id] [--tags]
935
- [--access-modifier Public|Private] [--content-type]
936
- [--configuration-name] [--module-name <1-11>] [--local-storage]
937
- [--dry-run] [--yes] [--json]
938
- Cloud: create file/version metadata, then PUT bytes to the returned URL. Local:
939
- one multipart request. The file appears in the object tree without registration.
940
- blocks data files presigned-upload-url --name <fileName> [--item-id] [--parent-directory-id]
941
- [--access-modifier Public|Private] [--configuration-name]
942
- [--module-name <1-11>] [--meta-data] [--tags]
943
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
944
- Mutating cloud step 1: creates metadata/version and returns uploadUrl/fileId.
945
- blocks data files upload-to-url --url <presignedUrl> --file <localPath>
946
- --content-type <type> [--blob-type BlockBlob] [--no-blob-type-header]
947
- [--dry-run] [--yes] [--json]
948
- Step 2. Provider-direct PUT - no Blocks auth headers by design.
949
- blocks data files upload-to-local-storage --file <localPath> [--name] [--item-id]
950
- [--parent-directory-id] [--tags] [--access-modifier Public|Private]
951
- [--configuration-name] [--meta-data] [--additional-properties '<json>']
952
- [--dry-run] [--yes] [--json]
953
- One-call alternative to the two commands above, for local-storage-backed projects.
954
- blocks data files update-additional-info <itemId> --additional-properties '<json>'
955
- [--dry-run] [--yes] [--json]
956
- blocks data files delete <fileId> [--configuration-name] [--event-queue-name]
957
- [--permanent]
958
- [--dry-run] [--yes] [--json]
959
- Defaults to moving the file to trash; --permanent removes bytes and metadata.
960
- blocks data files list [--parent-id] [--module-name <1-11>] [--type directory|file]
961
- [--search] [--cursor] [--limit 1-200] [--json]
962
- blocks data files search <query> [--directory-id] [--type directory|file]
963
- [--cursor] [--limit 1-200] [--json]
964
- blocks data files trash|shared [--type directory|file] [--cursor] [--limit] [--json]
965
- blocks data files restore <resourceId> [--dry-run] [--yes] [--json]
966
- blocks data files purge <resourceId> [--dry-run] [--yes] [--json]
967
- blocks data files directory-create <name> [--parent-id] [--module-name]
968
- [--description] [--allowed-extensions pdf,docx]
969
- [--dry-run] [--yes] [--json]
970
- blocks data files directory-get <directoryId> [--json]
971
- blocks data files directory-update <directoryId> [--name] [--description]
972
- [--dry-run] [--yes] [--json]
973
- blocks data files directory-delete <directoryId> [--permanent]
974
- [--dry-run] [--yes] [--json]
975
- blocks data files directory-move <directoryId> [--target-directory-id]
976
- [--dry-run] [--yes] [--json]
977
- blocks data files versions <fileId> [--cursor] [--limit 1-100] [--json]
978
- blocks data files create-version <fileId> [--configuration-name]
979
- [--dry-run] [--yes] [--json]
980
- blocks data files copy <fileId> --target-directory-id <id> [--copy-access-policies]
981
- [--dry-run] [--yes] [--json]
982
- blocks data files move <fileId> --target-directory-id <id> [--dry-run] [--yes] [--json]
983
- blocks data files rename <fileId> --name <name> [--dry-run] [--yes] [--json]
984
- blocks data files access-list|access-resolve <resourceId> [--json]
985
- blocks data files access-grant <resourceId> --resource-type Directory|File
986
- --principal-type User|Role|Everyone|Organization
987
- [--principal-id] --permission View|Download|Edit|Delete|Manage|Owner
988
- [--effect Allow|Deny] [--priority] [--expires-at]
989
- [--dry-run] [--yes] [--json]
990
- blocks data files access-update <resourceId> --policy-id <id> <same policy flags>
991
- blocks data files access-revoke <resourceId> --policy-id <id> [--dry-run] [--yes] [--json]
992
- blocks data files inheritance <resourceId> --enabled=true|false [--dry-run] [--yes] [--json]
993
- blocks data files share <resourceId> --resource-type <type> --principal-type <type>
994
- [--principal-id] --permission <permission> [--expires-at]
995
- [--dry-run] [--yes] [--json]
996
-
997
- Localization:
998
- blocks localization validate --module <name> --language <culture> [--file <path>] [--json]
999
- Validate a local i18n JSON dictionary. Supports nested JSON input and
1000
- validates the flattened key/value set locally.
1001
-
1002
- blocks localization push --module <name> --language <culture> [--file <path>] [--route <route>] [--context <text>] [--dry-run] [--yes] [--json]
1003
- Create or update Localization keys from a local i18n JSON dictionary via
1004
- /localization/v4/Key/SaveKeys. Creates the module first when it is missing.
1005
-
1006
- blocks localization pull --module <name> --language <culture> [--out <path>] [--json]
1007
- Download published cloud localization via
1008
- /localization/v4/Key/GetCloudUilmFile and write a local JSON dictionary.
1009
-
1010
- Raw API (/localization/v4/* project-scoped: requires a selected project, impersonated
1011
- project token only). These call the Localization service endpoints directly,
1012
- in addition to the file-oriented validate/push/pull commands above.
1013
-
1014
- blocks localization assistant translation-suggestion --source-text <text>
1015
- --destination-language <culture> [--current-language]
1016
- [--element-type] [--element-application-context]
1017
- [--element-detail-context] [--temperature] [--max-character-length]
1018
- [--glossary-ids a,b] [--module-id] [--destination-language-code]
1019
- [--body '<json>'|--file <path>] [--json]
1020
-
1021
- blocks localization config get-webhook [--json]
1022
- blocks localization config save-webhook --url <url> --content-type <type>
1023
- --secret <s> --header-key <k> [--item-id <id>] [--is-disabled]
1024
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
1025
-
1026
- blocks localization glossary save --name <n> [--item-id] [--language] [--type]
1027
- [--context] [--additional-note] [--is-global] [--module-ids a,b]
1028
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
1029
- blocks localization glossary list [--search] [--page-number] [--page-size]
1030
- [--is-global] [--module-id] [--json]
1031
- blocks localization glossary get <itemId> [--json]
1032
- blocks localization glossary suggested <itemId> [--max-results <n>] [--json]
1033
- blocks localization glossary delete <itemId> [--dry-run] [--yes] [--json]
1034
-
1035
- blocks localization key save --key-name <n> --module-id <id> [--item-id] [--value]
1036
- [--culture] [--routes a,b] [--glossary-ids a,b] [--context]
1037
- [--is-new-key] [--is-partially-translated] [--should-publish]
1038
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
1039
- blocks localization key list [--key-search-text] [--search-key] [--module-ids a,b]
1040
- [--page-number] [--page-size] [--sort-by] [--sort-desc]
1041
- [--is-partially-translated] [--missing-languages a,b]
1042
- [--create-date-start] [--create-date-end]
1043
- [--last-update-date-start] [--last-update-date-end]
1044
- [--glossary-id] [--body '<json>'|--file <path>] [--json]
1045
- blocks localization key get-by-names <keyName...>|--key-names a,b [--module-id] [--json]
1046
- blocks localization key get <itemId> [--json]
1047
- blocks localization key delete <itemId> [--dry-run] [--yes] [--json]
1048
- blocks localization key delete-keys <itemId...>|--item-ids a,b [--dry-run] [--yes] [--json]
1049
- blocks localization key get-timeline [--entity-id] [--user-id] [--page-number]
1050
- [--page-size] [--sort-by] [--sort-desc] [--create-date-start]
1051
- [--create-date-end] [--json]
1052
- blocks localization key get-localization-timeline [--user-id] [--log-from]
1053
- [--log-from-values a,b] [--exclude-log-from-values a,b]
1054
- [--page-number] [--page-size] [--sort-by] [--sort-desc]
1055
- [--create-date-start] [--create-date-end] [--json]
1056
- blocks localization key get-timeline-by-operation-id <operationId> [--page-number]
1057
- [--page-size] [--json]
1058
- blocks localization key get-uilm-file --module <name> --language <culture> [--json]
1059
- blocks localization key generate-uilm-file --module-id <id> [--guid]
1060
- [--dry-run] [--yes] [--json]
1061
- blocks localization key translate-all --module-id <id> [--default-language]
1062
- [--message-co-relation-id] [--dry-run] [--yes] [--json]
1063
- blocks localization key translate-key <keyId> --default-language <culture>
1064
- [--message-co-relation-id] [--dry-run] [--yes] [--json]
1065
- blocks localization key translate-keys <keyId...>|--key-ids a,b --default-language <culture>
1066
- [--message-co-relation-id] [--project-key]
1067
- [--dry-run] [--yes] [--json]
1068
- blocks localization key translate-and-export --module-id <id> [--default-language]
1069
- [--wait] [--poll-interval <seconds>] [--timeout <seconds>]
1070
- [--guid] [--output-type <0-5>] [--app-ids a,b] [--languages a,b]
1071
- [--reference-file-id] [--caller-tenant-id] [--start-date]
1072
- [--end-date] [--dry-run] [--yes] [--json]
1073
- Composed flow: translate-all -> generate-uilm-file -> uilm-export. Without --wait,
1074
- fires all 3 back to back (same as running them by hand). With --wait, polls
1075
- GetTimelineByOperationId (using a generated messageCoRelationId) between translate
1076
- and generate, since translation runs async and there's no documented explicit
1077
- "done" field to check -- it stops once the timeline entry count settles across 2
1078
- polls, or times out with a clear next-step message. Prints one output block per
1079
- step, not a single combined document.
1080
- blocks localization key uilm-import <fileId> [--message-co-relation-id]
1081
- [--dry-run] [--yes] [--json]
1082
- blocks localization key uilm-export [--output-type <0-5>] [--app-ids a,b] [--languages a,b]
1083
- [--reference-file-id] [--caller-tenant-id] [--start-date]
1084
- [--end-date] [--message-co-relation-id] [--dry-run] [--yes] [--json]
1085
- blocks localization key get-uilm-exported-files [--search] [--page-number] [--page-size]
1086
- [--create-date-start] [--create-date-end] [--json]
1087
- blocks localization key get-language-file-generation-history [--page-number]
1088
- [--page-size] [--json]
1089
- blocks localization key rollback <itemId> [--dry-run] [--yes] [--json]
1090
-
1091
- blocks localization language save --language-name <n> --language-code <c> [--item-id]
1092
- [--is-default] [--body '<json>'|--file <path>]
1093
- [--dry-run] [--yes] [--json]
1094
- blocks localization language list [--json]
1095
- blocks localization language list-for-tenant [--json]
1096
- blocks localization language delete <languageName> [--dry-run] [--yes] [--json]
1097
- blocks localization language set-default <languageName> [--dry-run] [--yes] [--json]
1098
-
1099
- blocks localization module save --module-name <n> [--item-id]
1100
- [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
1101
- blocks localization module list [--json]
1102
- blocks localization module list-for-tenant [--json]
1103
- blocks localization module tag-glossary <moduleId> --glossary-ids a,b
1104
- [--dry-run] [--yes] [--json]
1105
-
1106
- Release:
1107
- blocks release deploy [--domain <customDomain>] [--wait] [--poll-interval <seconds>]
1108
- [--timeout <seconds>] [--dry-run] [--yes] [--json]
1109
- Deploy the selected project's environment. Resolves everything from state
1110
- you already have: the repo linked to this project (Project/GetAsset) and
1111
- that repo's connected branch (Build/repo-details) -- no --repo-id needed.
1112
- Aborts if the connected branch doesn't match this environment's name.
1113
- Pass --domain to also set the custom deployment domain before deploying.
1114
- Pass --wait to poll release status on the resulting build until it reaches
1115
- a terminal state (or --timeout elapses, default 900s) instead of returning
1116
- immediately with just a build id.
1117
- Mutating; no artifact upload is performed by this CLI.
1118
-
1119
- blocks release status <buildId> [--json]
1120
- Read Release build status by build id using an impersonated project
1121
- token. Read-only.
1122
-
1123
- blocks release builds list [repoId] [--repo-id <repoId>] [--json]
1124
- List Release build details for a repository using an impersonated project
1125
- token. When repoId is omitted, resolves it from the selected project's
1126
- linked repo assets (Project/GetAsset, account token) -- auto-picked if
1127
- there's exactly one, otherwise you're prompted to choose. Read-only.
1128
-
1129
- blocks release builds get <buildId> [--json]
1130
- Alias for release status. Read-only.
1131
-
1132
- Scaffold:
1133
- blocks new web <name> [--app-domain <domain>] [--client-id <oidcClientId>]
1134
- [--x-blocks-key <tenantId>] [--blocks-api-url <url>] [--oidc-url <url>]
1135
- Create a Vite React starter app that talks to Blocks exclusively through
1136
- @seliseblocks/client (a single createBlocksClient() instance) using the SDK
1137
- hosted IdP flow: blocksClient.auth.idp.redirectToProvider() on login click
1138
- and blocksClient.auth.idp.callback() on /login/callback. Includes route
1139
- guards, auto-refresh through auth.oidc.refreshToken(), live
1140
- auth/iam/data/localization SDK examples, environment config, and safe
1141
- .gitignore defaults.
1142
- Uses the selected project (see 'use') unless --x-blocks-key overrides it.
1143
- --app-domain and --client-id are resolved from the project when omitted:
1144
- if the project has one domain it's used automatically, otherwise you're
1145
- prompted to choose; the OIDC client is picked from a list of the
1146
- project's existing clients, or you can create a minimal one (display
1147
- name + redirect URI, active, registered as a Blocks OIDC identity
1148
- provider) on the spot, or skip and register one later from the portal or
1149
- 'auth oidc-clients save'.
1150
- If --blocks-api-url is omitted, it is derived from the app domain:
1151
- https://blocksapi.<registrable-domain> (for example, app domain
1152
- https://dqrsf.slsblx.com uses https://blocksapi.slsblx.com). Pass a
1153
- different Data/IAM/Localization/OS gateway URL explicitly only if your
1154
- project uses a non-default one.
1155
- --oidc-url defaults to https://iam.seliseblocks.com.
1156
-
1157
- Skills:
1158
- blocks skill list [--json]
1159
- List bundled blocks-skills/*/SKILL.md agent context docs (name +
1160
- description). Local-only, no cloud calls.
1161
- blocks skill show <name> [--json]
1162
- Print one skill's full SKILL.md content.
1163
- blocks skill add <name> [--dir <path>]
1164
- Copy a bundled skill's SKILL.md into <path>/<name>/SKILL.md in the
1165
- current directory (default --dir is 'blocks-skills'), for use in a
1166
- project outside this monorepo. Overwrites silently, same as
1167
- 'data schema pull'.
1168
-
1169
- SDK:
1170
- blocks sdk client [--app-domain <domain>] [--client-id <oidcClientId>]
1171
- [--x-blocks-key <tenantId>] [--blocks-api-url <url>] [--oidc-url <url>] [--json]
1172
- Read-only: "I want to use the Blocks SDK -- show me the client." Resolves this
1173
- project's @seliseblocks/client config using the selected project unless
1174
- --x-blocks-key overrides it, and the project's registered domain/OIDC client
1175
- when --app-domain/--client-id are omitted. Its API URL defaults to
1176
- https://api.seliseblocks.com unless --blocks-api-url is passed.
1177
- Prints a ready-to-paste createBlocksClient(...) snippet.
1178
- Passing both --app-domain and --client-id skips the project lookup entirely
1179
- (no login required). Never writes a file; to scaffold a new app use 'new web'.
488
+ console.log(`Blocks CLI
489
+
490
+ Usage:
491
+ blocks <command> [options]
492
+
493
+ Namespaced commands use spaces, e.g. 'blocks data schema list'.
494
+ ':' also works if you prefer it: 'blocks data:schema:list'.
495
+
496
+ Global options:
497
+ --version Print CLI version.
498
+ --json Print machine-readable JSON where supported.
499
+ --api-url <url> Override Blocks API URL for this command.
500
+ --account <name> Use a named account profile; default is implicit.
501
+ --project <tenantId> Use a project tenant for project-scoped commands.
502
+ --dry-run Show planned mutation without calling the API.
503
+ --yes Skip mutation confirmation after explicit approval.
504
+
505
+ Setup and health:
506
+ blocks init
507
+ Create local Blocks workspace files: blocks.json, data schema/rules folders,
508
+ and .env.example.
509
+
510
+ blocks doctor [--json]
511
+ Check local Node.js, OIDC config, token cache, selected project, and config
512
+ file locations. Does not mutate cloud resources.
513
+
514
+ Auth:
515
+ blocks login
516
+ Device-code login. Prints a verification URL and user code, opens the
517
+ browser to the verification page when possible so you only need to click
518
+ approve, then polls until the device is authorized; stores account access
519
+ and refresh tokens and auto-refreshes later. If a project was previously
520
+ selected, re-impersonates it automatically; otherwise lists projects and
521
+ prompts you to run 'blocks use <tenantId>'.
522
+
523
+ blocks auth status [--json]
524
+ Show only whether account/project access and refresh tokens are missing,
525
+ valid, expired, or available. Does not print account config values.
526
+
527
+ blocks auth refresh [--project] [--json]
528
+ Force account token refresh, or project token refresh with --project.
529
+
530
+ blocks auth remove <account>
531
+ Clear cached tokens and stored local credentials for that account. The
532
+ packaged default OS account is restored from package defaults.
533
+
534
+ blocks logout
535
+ Revoke the current refresh token when possible and remove local session data.
536
+
537
+ Projects:
538
+ blocks projects list [--json]
539
+ List accessible Blocks projects via /os/v4/Project/Gets. Uses the
540
+ impersonated project session when a project is selected, otherwise the
541
+ account token. Read-only.
542
+
543
+ blocks projects get [tenantId] [--deployment] [--json]
544
+ Read one project from Project/Gets. Uses selected project when tenantId is
545
+ omitted. Pass --deployment to also include the environment, tenantGroupId,
546
+ and linked repo assets (from Project/GetAsset) that 'release deploy' uses
547
+ to resolve its target. Read-only.
548
+
549
+ blocks use <project-tenant-id>
550
+ Save the selected project tenant globally and in blocks.json when present,
551
+ then immediately impersonate it. If a different project was selected,
552
+ stops that impersonation first to reclaim a fresh account refresh token
553
+ before starting the new one.
554
+
555
+ blocks deselect
556
+ Stop the active impersonation (restoring a fresh account refresh token),
557
+ then clear the selected project tenant (globally and in blocks.json) and
558
+ drop its cached impersonation token. Run 'blocks use <tenantId>' again to
559
+ reselect and re-impersonate.
560
+
561
+ IAM:
562
+ blocks iam me [--json]
563
+ Read the current user from IAM (bootstrapping/CLI operator identity, not
564
+ a project resource). Uses the impersonated project session when a project
565
+ is selected, otherwise the account token -- the server always resolves
566
+ this to the root identity either way. Every other iam * command below is
567
+ project-scoped: it requires a selected project and calls IAM using an
568
+ impersonated project token only, never the account token.
569
+
570
+ Users (/iam/v4/iam/users*):
571
+ blocks iam users list [--page 1] [--page-size 20] [--email <e>] [--name <n>]
572
+ [--organization-id <id>] [--sort-by <field>] [--sort-desc]
573
+ [--filter '<json>'] [--json]
574
+ Query users. --filter merges a raw JSON filter object over the convenience flags.
575
+ blocks iam users get <id> [--organization-id <id>] [--json]
576
+ blocks iam users create --email <e>|--user-name <n> [--first-name] [--last-name]
577
+ [--password] [--phone-number] [--organization-id]
578
+ [--roles a,b] [--permissions a,b] [--body '<json>'|--file <path>]
579
+ [--dry-run] [--yes] [--json]
580
+ blocks iam users update <id> [--first-name] [--last-name] [--phone-number]
581
+ [--organization-id] [--roles a,b] [--permissions a,b]
582
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
583
+ blocks iam users activate <userId> [--reason <text>] [--dry-run] [--yes] [--json]
584
+ blocks iam users deactivate <userId> [--dry-run] [--yes] [--json]
585
+ blocks iam users access grant <userId> [--roles a,b] [--permissions a,b]
586
+ [--organization-id] [--dry-run] [--yes] [--json]
587
+ blocks iam users access revoke <userId> [--organization-id] [--dry-run] [--yes] [--json]
588
+ blocks iam users exists <email> [--json]
589
+ blocks iam email available <email> [--json]
590
+
591
+ Roles (/iam/v4/iam/roles*):
592
+ blocks iam roles list [--page] [--page-size] [--search] [--slugs a,b]
593
+ [--organization-id] [--filter '<json>'] [--json]
594
+ blocks iam roles get <id> [--json]
595
+ blocks iam roles create --name <n> [--slug] [--description] [--parent-role-slug]
596
+ [--can-create-own] [--body '<json>'|--file <path>]
597
+ [--dry-run] [--yes] [--json]
598
+ blocks iam roles update <itemId> [--name] [--description] [--parent-role-slug]
599
+ [--propagate-to-other-org] [--can-create-own]
600
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
601
+ blocks iam roles assign-permissions <slug> [--add-permissions a,b]
602
+ [--remove-permissions a,b] [--organization-id]
603
+ [--dry-run] [--yes] [--json]
604
+ blocks iam roles assignable [--json]
605
+
606
+ Permissions (/iam/v4/iam/permissions*):
607
+ blocks iam permissions list [--page] [--page-size] [--search] [--type <0-3>]
608
+ [--severity <0-4>] [--resource-group] [--tags a,b]
609
+ [--resources a,b] [--is-built-in] [--is-archived]
610
+ [--roles a,b] [--organization-id] [--filter '<json>'] [--json]
611
+ blocks iam permissions get <id> [--json]
612
+ blocks iam permissions create --name <n> [--type] [--description] [--resource]
613
+ [--resource-group] [--tags a,b] [--severity] [--is-built-in]
614
+ [--dependent-permissions a,b] [--body '<json>'|--file <path>]
615
+ [--dry-run] [--yes] [--json]
616
+ blocks iam permissions update <id> [same flags as create, plus --is-archived]
617
+ [--dry-run] [--yes] [--json]
618
+ blocks iam permissions by-severity [--json]
619
+
620
+ Resources (/iam/v4/iam/resource*):
621
+ blocks iam resources groups [--json]
622
+ blocks iam resources features [--search <text>] [--is-built-in] [--json]
623
+
624
+ Organizations (/iam/v4/iam/organizations*):
625
+ blocks iam organizations list [--page] [--page-size] [--search] [--ids a,b]
626
+ [--is-disabled] [--parent-organization-id] [--json]
627
+ blocks iam organizations get <id> [--json]
628
+ blocks iam organizations create --name <n> [--description] [--email] [--phone-number]
629
+ [--website-url] [--default-roles a,b] [--default-permissions a,b]
630
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
631
+ blocks iam organizations update <id> [--name] [--description] [--email]
632
+ [--phone-number] [--website-url] [--industry] [--time-zone]
633
+ [--currency] [--locale] [--is-enabled]
634
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
635
+ blocks iam organizations my [--json]
636
+ blocks iam organizations config get [--json]
637
+ blocks iam organizations config save [--allow-org-creation-from-cloud]
638
+ [--allow-org-creation-from-construct] [--allow-org-creation-from-signup]
639
+ [--allow-org-creation-from-portal] [--multi-org-enabled]
640
+ [--consent-for-multi-org-enable] [--body '<json>'|--file <path>]
641
+ [--dry-run] [--yes] [--json]
642
+
643
+ Signup settings (/iam/v4/iam/signup-settings):
644
+ blocks iam signup-settings get [--json]
645
+ blocks iam signup-settings save [--email-password-signup] [--sso-signup]
646
+ [--default-roles a,b] [--default-permissions a,b]
647
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
648
+
649
+ MFA (/iam/v4/mfa*, project-scoped: requires a selected project, impersonated project token only):
650
+ blocks mfa config get [--json]
651
+ Read the tenant's MFA policy.
652
+ blocks mfa config save [--enable] [--require-for-all-users] [--allow-user-opt-out]
653
+ [--allow-backup-codes] [--backup-codes-count <n>]
654
+ [--user-mfa-type 0,1] [--required-roles a,b] [--exempt-roles a,b]
655
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
656
+ Save the tenant's MFA policy.
657
+ blocks mfa totp setup [--json]
658
+ Start TOTP enrollment for the impersonated user.
659
+ blocks mfa totp verify-setup <code> [--json]
660
+ Confirm TOTP enrollment.
661
+ blocks mfa totp enable --mfa-type <n> [--code <c>] [--dry-run] [--yes] [--json]
662
+ Composed enrollment: totp setup -> (scan the printed QR/secret, enter the code --
663
+ interactively prompted if --code is omitted) -> totp verify-setup -> method set
664
+ --mfa-type <n> -> backup-codes generate. One sitting, one confirmation.
665
+ --mfa-type is required and not defaulted: the numeric value meaning "TOTP" is
666
+ tenant-defined and undocumented here (same value plain mfa method set expects) --
667
+ look it up rather than guessing.
668
+ blocks mfa generate --mfa-type <n> [--send-phone-number-as-email-domain <domain>] [--json]
669
+ Send an OTP challenge; returns an mfaId to pass to resend/verify.
670
+ blocks mfa resend <mfaId> [--send-phone-number-as-email-domain <domain>] [--json]
671
+ blocks mfa verify <mfaId> <code> --auth-type <n> [--from-token-call] [--json]
672
+ blocks mfa method set --mfa-type <n> [--json]
673
+ Switch the impersonated user's active MFA method.
674
+ blocks mfa disable [--dry-run] [--yes] [--json]
675
+ blocks mfa backup-codes list [--json]
676
+ blocks mfa backup-codes generate [--dry-run] [--yes] [--json]
677
+ blocks mfa backup-codes use <userId> <code> [--json]
678
+
679
+ Mail (/os/v4/Mail/* — project-scoped: requires a selected project, impersonated project token only):
680
+ blocks mail config list [--json]
681
+ List SMTP/inbound mail configurations for the selected project.
682
+ blocks mail config get <name> [--json]
683
+ blocks mail config save [--configuration-id <id>] [--name <n>] [--host <h>] [--port <n>]
684
+ [--enable-ssl] [--sender-name] [--sender-address] [--sender-username]
685
+ [--account-password] [--inbound] [--provider <0|1>]
686
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
687
+ Upsert: omit --configuration-id to create; pass it to update.
688
+ blocks mail config delete <configurationId> [--dry-run] [--yes] [--json]
689
+ blocks mail config duplicate <configurationId> [--dry-run] [--yes] [--json]
690
+ blocks mail template list [--page-number] [--page-size] [--search] [--sort-by] [--sort-desc]
691
+ [--configuration-id] [--language] [--json]
692
+ blocks mail template get <itemId> [--json]
693
+ blocks mail template save [--item-id <id>] [--configuration-id] [--name] [--language]
694
+ [--subject] [--template-body] [--json-content] [--image-id]
695
+ [--image-url] [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
696
+ Upsert: omit --item-id to create; pass it to update.
697
+ blocks mail template delete <itemId> [--dry-run] [--yes] [--json]
698
+ blocks mail template clone <itemId> [--configuration-id] [--language] [--name] [--subject]
699
+ [--dry-run] [--yes] [--json]
700
+ blocks mail mailbox list [--page-number] [--page-size] [--status] [--search]
701
+ [--start-date] [--end-date] [--inbound] [--json]
702
+ blocks mail mailbox get <messageId> [--json]
703
+ blocks mail send [--to a,b] [--cc a,b] [--bcc a,b] [--reply-to a,b] [--purpose <p>]
704
+ [--language <culture>] [--subject-data-context '<json>']
705
+ [--body-data-context '<json>'] [--attachments '<json>']
706
+ [--send-phone-number-as-email] [--project-key <key>]
707
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
708
+ Send an email through the tenant's default mail configuration
709
+ (/logic/v4/Mail/Send). --project-key defaults to the selected project.
710
+ blocks mail sendtoany [same flags as mail send, plus --is-test-mail]
711
+ [--dry-run] [--yes] [--json]
712
+ Same as mail send but via /logic/v4/Mail/SendToAny, which lets the mail
713
+ provider route the send (e.g. mark it --is-test-mail).
714
+
715
+ Notification (/os/v4/Notification/* — project-scoped: requires a selected project, impersonated project token only):
716
+ blocks notification list [--page] [--page-size] [--sort-by] [--sort-desc] [--filter] [--json]
717
+ blocks notification get <itemId> [--json]
718
+ blocks notification save [--name <n>] [--channel <0|1>] [--type <0-3>] [--enable-persistence]
719
+ [--notify-method] [--update] [--body '<json>'|--file <path>]
720
+ [--dry-run] [--yes] [--json]
721
+ Pass --update when saving over an existing notification configuration.
722
+ blocks notification delete <itemId> [--dry-run] [--yes] [--json]
723
+
724
+ Notifier (/logic/v4/Notifier/* — real-time/offline notification sends and inbox reads;
725
+ project-scoped: requires a selected project, impersonated project token only.
726
+ Distinct from 'notification' above, which manages notification channel
727
+ configuration, not sending):
728
+ blocks notifier notify [--user-ids a,b] [--roles a,b] [--connection-id <id>]
729
+ [--subscription-filters '<json>'] [--denormalized-payload <text>]
730
+ [--save-denormalized-payload-as-object] [--response-key]
731
+ [--response-value] [--content-available] [--configuration-name]
732
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
733
+ Push a notification to specific users/roles, or everyone matching a subscription
734
+ filter. Target with at least one of --user-ids/--roles/--subscription-filters.
735
+ blocks notifier list [--unread-only] [--page] [--page-size] [--sort-by] [--sort-desc]
736
+ [--filter] [--json]
737
+ List the signed-in user's notifications (GetNotifications). Read-only.
738
+ blocks notifier unread [--user-id <id>] [--context <c>] [--action-name <a>] [--value <v>]
739
+ [--order-by <1|2>] [--json]
740
+ Read unread notifications matching a subscription filter. Sent as query
741
+ parameters even though swagger documents this endpoint as GET with a JSON
742
+ body -- the Fetch spec forbids a body on GET. Read-only.
743
+ blocks notifier mark-read <id> [--dry-run] [--yes] [--json]
744
+ blocks notifier mark-all-read [--dry-run] [--yes] [--json]
745
+
746
+ Secrets (/os/v4/Secrets/* — project-scoped: requires a selected project, impersonated project
747
+ token only; generic tenant secret storage, e.g. captcha provider config):
748
+ blocks secrets get <secretKey> [--page-number 0] [--page-size 10] [--json]
749
+ blocks secrets save --secret-key <key> [--item-id <id>] --key-value-pairs '<json>'
750
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
751
+ Upsert: omit --item-id to create, pass it to update. --key-value-pairs is a flat
752
+ JSON object of provider-specific fields, e.g.
753
+ --key-value-pairs '{"isEnable":"true","provider":"recaptcha","captchaKey":"...","captchaSecret":"..."}'.
754
+
755
+ Storage (/os/v4/Storage/* — project-scoped: requires a selected project, impersonated project token only):
756
+ blocks storage config list [--json]
757
+ blocks storage config get <name> [--json]
758
+ blocks storage config save [--item-id <id>] [--name <n>] [--strategy] [--connection-string]
759
+ [--secret-key] [--access-key] [--region-endpoint] [--host] [--port]
760
+ [--username] [--password] [--remote-base-path] [--update]
761
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
762
+ Upsert: omit --item-id to create; pass --update to update.
763
+ blocks storage config delete <name> [--dry-run] [--yes] [--json]
764
+
765
+ Auth Admin (/iam/v4/auth/identity-providers*, /config, /client-credentials, /oidc-clients —
766
+ project-scoped: requires a selected project, impersonated project token only):
767
+ blocks auth idp list [--json]
768
+ blocks auth idp get <id> [--json]
769
+ blocks auth idp create --provider <p> --provider-type <t> --protocol <proto>
770
+ --client-id <id> [--client-secret] [--display-name] [--issuer]
771
+ [--scope] [--redirect-uris a,b] [--active]
772
+ [--authorization-url] [--token-url] [--user-info-url]
773
+ [--jwks-uri] [--well-known-url] [--response-type]
774
+ [--grant-types a,b] [--require-pkce]
775
+ [--token-endpoint-auth-method] [--initial-roles a,b]
776
+ [--initial-permissions a,b] [--icon]
777
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
778
+ Apple-specific fields (teamId, keyId, privateKey, appleAudience) go in --body/--file
779
+ so no private key lands in shell history.
780
+ IAM's create endpoint stores issuer/jwksUri/wellKnownUrl but drops
781
+ authorizationUrl/tokenUrl/userInfoUrl -- set those with 'idp update' afterward.
782
+ blocks auth idp update <id> [same flags as create, all optional] [--dry-run] [--yes] [--json]
783
+ provider/providerType/protocol/clientId are immutable: omit them, or echo the
784
+ existing values exactly if you also pass --body/--file.
785
+ The only endpoint that persists authorizationUrl/tokenUrl/userInfoUrl -- create accepts
786
+ and drops them, and update never re-runs discovery, so values set here stick. Use it to
787
+ repair a provider whose authorizationUrl came back null: '/idp/initiate' builds its
788
+ redirect from that field, so hosted login goes nowhere without it. Read the endpoint
789
+ values from the tenant's discovery document rather than composing them by hand.
790
+ blocks auth idp delete <id> [--dry-run] [--yes] [--json]
791
+ Irreversible; also deletes the related OIDC client registration.
792
+ blocks auth idp status <id> --active|--active=false [--dry-run] [--yes] [--json]
793
+ Enable/disable a provider without deleting its configuration.
794
+ blocks auth config get [--json]
795
+ blocks auth config save [--refresh-token-minutes] [--absolute-refresh-token-minutes]
796
+ [--access-token-minutes] [--remember-me-refresh-token-minutes]
797
+ [--wrong-attempts-to-lock] [--account-lock-duration-minutes]
798
+ [--oidc-enabled] [--logout-on-password-change]
799
+ [--password-strength-regex] [--body '<json>'|--file <path>]
800
+ [--dry-run] [--yes] [--json]
801
+ blocks auth client-credentials list [--json]
802
+ clientSecret is included in list responses; treat CLI output as sensitive.
803
+ blocks auth client-credentials save --name <n> [--item-id <id>] [--roles a,b]
804
+ [--permissions a,b] [--access-token-valid-minutes] [--active]
805
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
806
+ Omit --item-id to create; pass it to update. The response's clientSecret is
807
+ shown once and is not retrievable again afterward.
808
+ blocks auth client-credentials delete <id> [--dry-run] [--yes] [--json]
809
+
810
+ blocks auth oidc-clients list [--json]
811
+ List registered OAuth 2.0 / OIDC client applications for the tenant. client_secret
812
+ is excluded from list/get responses.
813
+ blocks auth oidc-clients get <clientId> [--json]
814
+ blocks auth oidc-clients save [--item-id <id>] [--client-display-name] [--client-type]
815
+ [--redirect-uris a,b] [--post-logout-redirect-uris a,b]
816
+ [--scope] [--allowed-scopes a,b] [--allowed-response-types a,b]
817
+ [--require-pkce] [--require-consent] [--require-mfa]
818
+ [--allowed-mfa-methods 0,1] [--front-channel-logout-uri]
819
+ [--back-channel-logout-uri] [--auto-redirect]
820
+ [--external-discovery-endpoint] [--active] [--login-mode]
821
+ [--client-logo-url] [--client-brand-color] [--use-tokens-cookie]
822
+ [--register-as-identity-provider] [--device-flow-client]
823
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
824
+ Upsert: omit --item-id to register a new client, pass it to update an existing one.
825
+ The response's client_secret is shown once and is not retrievable again afterward.
826
+ --client-type is not optional in practice: IAM derives tokenEndpointAuthMethod from it,
827
+ so omitting it stores a browser/SPA client as confidential ("client_secret_post") and
828
+ lets it request the client_credentials grant. Pass --client-type public for any
829
+ PKCE/browser client.
830
+ --register-as-identity-provider creates the linked identity provider in the same call.
831
+ Its authorize/token/userinfo/jwks/issuer values are filled from the discovery document
832
+ at --external-discovery-endpoint; with no discovery endpoint they are left null and the
833
+ provider's scope is replaced with "openid profile email". Verify with 'auth idp list'.
834
+ blocks auth oidc-clients delete <clientId> [--dry-run] [--yes] [--json]
835
+ Irreversible; revokes all tokens issued to the client.
836
+ blocks auth oidc-clients rotate-secret <clientId> [--dry-run] [--yes] [--json]
837
+ Generates a new client_secret, shown once; the old secret stops working immediately.
838
+
839
+ Data:
840
+ blocks data validate [--json]
841
+ Validate local blocks/data/schemas/*.json and blocks/data/rules.json before
842
+ pushing. Local-only.
843
+
844
+ blocks data schema list [--page <n>] [--page-size <n>] [--json]
845
+ List project schemas via /data/v4/schemas using an impersonated project
846
+ token. Read-only. Page defaults are 1/100; fails clearly on an unexpected
847
+ response shape instead of treating it as an empty list.
848
+
849
+ blocks data schema pull [--json]
850
+ Download every project schema (paging through all of them) into
851
+ blocks/data/schemas/*.json. Strips the API id, project identifiers, and
852
+ platform-managed fields so the file is portable and re-pushable as-is.
853
+ Writes local files only.
854
+
855
+ blocks data schema push [--dry-run] [--yes] [--json]
856
+ Create or update project schemas via /data/v4/schemas/define. Mutating.
857
+ Looks up the destination project's schema by name -- never trusts a local
858
+ id/itemId, which may belong to another project -- and uses PUT with the
859
+ destination id when found, POST otherwise. Warns when a local id is
860
+ ignored; fails clearly instead of treating an empty response as success.
861
+
862
+ blocks data rules pull [--json]
863
+ Download data-access policies into blocks/data/rules.json in the CLI's
864
+ portable format (schemaName, no itemId/schemaId). Writes local files only.
865
+
866
+ blocks data rules deploy [--dry-run] [--yes] [--json]
867
+ Apply schema security and data-access policies. Mutating; supports dry-run
868
+ and confirmation. Resolves each policy's destination schema id and any
869
+ existing policy id by name -- never reuses a source-project id.
870
+
871
+ blocks data reload [--dry-run] [--yes] [--json]
872
+ Reload Data schema configuration so staged schema/rule changes become live.
873
+ Mutating; calls POST /data/v4/schema-configurations/reload.
874
+
875
+ blocks data sync [--dry-run] [--yes] [--json]
876
+ Composed flow: validate local schemas/rules, then data schema push ->
877
+ data rules deploy -> data reload, so pushed changes actually go live in one
878
+ step. Validation runs first and hard-fails before anything is sent if it
879
+ finds errors. Prints 3 separate step outputs (one per underlying command),
880
+ not one combined document. One confirmation covers the whole flow.
881
+
882
+ Data source configuration (/data/v4/configurations) - check this first; by default a
883
+ project's Data Gateway runs on Blocks-managed storage and data config get is all you need.
884
+ Only create/update a configuration if you're pointing the gateway at your own database.
885
+ blocks data config get [--json]
886
+ blocks data config create --connection-string <cs> [--database-name <name>]
887
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
888
+ blocks data config update --item-id <id> [--connection-string] [--database-name]
889
+ [--collection-name-editable] [--collection-name-pattern]
890
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
891
+
892
+ Raw Schema API (/data/v4/schemas* - beyond the file-oriented list/pull/push above):
893
+ blocks data schema get <id> [--json]
894
+ Non-JSON output also prints the schema's exact GraphQL operation names --
895
+ generated names are naive string concatenation, not English
896
+ pluralization (e.g. Company -> getCompanys/Companys, not Companies).
897
+ blocks data schema get-by-name <schemaName> [--json]
898
+ Full field-level detail by collection name (info-by-name).
899
+ blocks data schema aggregation [--keyword] [--schema-name] [--collection-name]
900
+ [--schema-type <1|2>] [--page] [--page-size] [--sort-by]
901
+ [--sort-desc] [--json]
902
+ Schemas plus an access-level summary (Public/User/Custom x Read/Write/Edit/Delete).
903
+ blocks data schema change-logs [--json]
904
+ Unadapted schema change logs; data reload clears these.
905
+ blocks data schema delete <id> [--dry-run] [--yes] [--json]
906
+ Irreversible.
907
+ blocks data schema info list [--json]
908
+ Entity-type schema collections with basic info.
909
+ blocks data schema info save --schema-name <n> [--collection-name] [--schema-type <1|2>]
910
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
911
+ Create schema metadata only (no fields yet) - pair with data schema fields.
912
+ blocks data schema info update --item-id <id> [--schema-name] [--collection-name]
913
+ [--schema-type <1|2>] [--body '<json>'|--file <path>]
914
+ [--dry-run] [--yes] [--json]
915
+ blocks data schema fields --schema-id <schemaDefinitionItemId> [--deletable-fields a,b]
916
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
917
+ Add/update field definitions; the 'fields' array (name/type/isArray/isPIIData/
918
+ isUniqueData/description) goes in --body/--file, e.g.
919
+ --body '{"fields":[{"name":"email","type":"string"}]}'.
920
+
921
+ Data-access policies, single-item ops (beyond the file-oriented rules pull/deploy above):
922
+ blocks data rules policy get <schemaName> [--json]
923
+ blocks data rules policy delete <itemId> [--dry-run] [--yes] [--json]
924
+
925
+ Data validation (/data/v4/data-validations* - field-level validation rules; no file-oriented
926
+ workflow exists for this yet, use these directly):
927
+ blocks data validation list [--schema-id] [--field-name] [--keyword] [--page]
928
+ [--page-size] [--sort-by] [--sort-desc] [--json]
929
+ blocks data validation get <validationId> [--json]
930
+ blocks data validation by-schema <schemaId> [--json]
931
+ blocks data validation by-schema-field <schemaId> <fieldName> [--json]
932
+ blocks data validation save --schema-id <id> --field-name <name> [--item-id]
933
+ --body '<json>' (must include a "validations" array, e.g.
934
+ '{"validations":[{"type":1,"value":"^[0-9]+$","isActive":true}]}')
935
+ [--dry-run] [--yes] [--json]
936
+ Upsert: omit --item-id to create, pass it to update.
937
+ blocks data validation delete <validationId> [--dry-run] [--yes] [--json]
938
+
939
+ Storage object tree (files, directories, discovery, trash, versions, and access):
940
+ blocks data files get <fileId> [--version] [--configuration-name] [--json]
941
+ blocks data files get-many <fileId...>|--file-ids a,b [--configuration-name] [--json]
942
+ blocks data files info [--name] [--tenant-id] [--page] [--page-size] [--sort-by]
943
+ [--sort-desc] [--json]
944
+ blocks data files upload --file <localPath> [--name] [--item-id] [--parent-id] [--tags]
945
+ [--access-modifier Public|Private] [--content-type]
946
+ [--configuration-name] [--module-name <1-11>] [--local-storage]
947
+ [--dry-run] [--yes] [--json]
948
+ Cloud: create file/version metadata, then PUT bytes to the returned URL. Local:
949
+ one multipart request. The file appears in the object tree without registration.
950
+ blocks data files presigned-upload-url --name <fileName> [--item-id] [--parent-directory-id]
951
+ [--access-modifier Public|Private] [--configuration-name]
952
+ [--module-name <1-11>] [--meta-data] [--tags]
953
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
954
+ Mutating cloud step 1: creates metadata/version and returns uploadUrl/fileId.
955
+ blocks data files upload-to-url --url <presignedUrl> --file <localPath>
956
+ --content-type <type> [--blob-type BlockBlob] [--no-blob-type-header]
957
+ [--dry-run] [--yes] [--json]
958
+ Step 2. Provider-direct PUT - no Blocks auth headers by design.
959
+ blocks data files upload-to-local-storage --file <localPath> [--name] [--item-id]
960
+ [--parent-directory-id] [--tags] [--access-modifier Public|Private]
961
+ [--configuration-name] [--meta-data] [--additional-properties '<json>']
962
+ [--dry-run] [--yes] [--json]
963
+ One-call alternative to the two commands above, for local-storage-backed projects.
964
+ blocks data files update-additional-info <itemId> --additional-properties '<json>'
965
+ [--dry-run] [--yes] [--json]
966
+ blocks data files delete <fileId> [--configuration-name] [--event-queue-name]
967
+ [--permanent]
968
+ [--dry-run] [--yes] [--json]
969
+ Defaults to moving the file to trash; --permanent removes bytes and metadata.
970
+ blocks data files list [--parent-id] [--module-name <1-11>] [--type directory|file]
971
+ [--search] [--cursor] [--limit 1-200] [--json]
972
+ blocks data files search <query> [--directory-id] [--type directory|file]
973
+ [--cursor] [--limit 1-200] [--json]
974
+ blocks data files trash|shared [--type directory|file] [--cursor] [--limit] [--json]
975
+ blocks data files restore <resourceId> [--dry-run] [--yes] [--json]
976
+ blocks data files purge <resourceId> [--dry-run] [--yes] [--json]
977
+ blocks data files directory-create <name> [--parent-id] [--module-name]
978
+ [--description] [--allowed-extensions pdf,docx]
979
+ [--dry-run] [--yes] [--json]
980
+ blocks data files directory-get <directoryId> [--json]
981
+ blocks data files directory-update <directoryId> [--name] [--description]
982
+ [--dry-run] [--yes] [--json]
983
+ blocks data files directory-delete <directoryId> [--permanent]
984
+ [--dry-run] [--yes] [--json]
985
+ blocks data files directory-move <directoryId> [--target-directory-id]
986
+ [--dry-run] [--yes] [--json]
987
+ blocks data files versions <fileId> [--cursor] [--limit 1-100] [--json]
988
+ blocks data files create-version <fileId> [--configuration-name]
989
+ [--dry-run] [--yes] [--json]
990
+ blocks data files copy <fileId> --target-directory-id <id> [--copy-access-policies]
991
+ [--dry-run] [--yes] [--json]
992
+ blocks data files move <fileId> --target-directory-id <id> [--dry-run] [--yes] [--json]
993
+ blocks data files rename <fileId> --name <name> [--dry-run] [--yes] [--json]
994
+ blocks data files access-list|access-resolve <resourceId> [--json]
995
+ blocks data files access-grant <resourceId> --resource-type Directory|File
996
+ --principal-type User|Role|Everyone|Organization
997
+ [--principal-id] --permission View|Download|Edit|Delete|Manage|Owner
998
+ [--effect Allow|Deny] [--priority] [--expires-at]
999
+ [--dry-run] [--yes] [--json]
1000
+ blocks data files access-update <resourceId> --policy-id <id> <same policy flags>
1001
+ blocks data files access-revoke <resourceId> --policy-id <id> [--dry-run] [--yes] [--json]
1002
+ blocks data files inheritance <resourceId> --enabled=true|false [--dry-run] [--yes] [--json]
1003
+ blocks data files share <resourceId> --resource-type <type> --principal-type <type>
1004
+ [--principal-id] --permission <permission> [--expires-at]
1005
+ [--dry-run] [--yes] [--json]
1006
+
1007
+ Localization:
1008
+ blocks localization validate --module <name> --language <culture> [--file <path>] [--json]
1009
+ Validate a local i18n JSON dictionary. Supports nested JSON input and
1010
+ validates the flattened key/value set locally.
1011
+
1012
+ blocks localization push --module <name> --language <culture> [--file <path>] [--route <route>] [--context <text>] [--dry-run] [--yes] [--json]
1013
+ Create or update Localization keys from a local i18n JSON dictionary via
1014
+ /localization/v4/Key/SaveKeys. Creates the module first when it is missing.
1015
+
1016
+ blocks localization pull --module <name> --language <culture> [--out <path>] [--json]
1017
+ Download published cloud localization via
1018
+ /localization/v4/Key/GetCloudUilmFile and write a local JSON dictionary.
1019
+
1020
+ Raw API (/localization/v4/* — project-scoped: requires a selected project, impersonated
1021
+ project token only). These call the Localization service endpoints directly,
1022
+ in addition to the file-oriented validate/push/pull commands above.
1023
+
1024
+ blocks localization assistant translation-suggestion --source-text <text>
1025
+ --destination-language <culture> [--current-language]
1026
+ [--element-type] [--element-application-context]
1027
+ [--element-detail-context] [--temperature] [--max-character-length]
1028
+ [--glossary-ids a,b] [--module-id] [--destination-language-code]
1029
+ [--body '<json>'|--file <path>] [--json]
1030
+
1031
+ blocks localization config get-webhook [--json]
1032
+ blocks localization config save-webhook --url <url> --content-type <type>
1033
+ --secret <s> --header-key <k> [--item-id <id>] [--is-disabled]
1034
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
1035
+
1036
+ blocks localization glossary save --name <n> [--item-id] [--language] [--type]
1037
+ [--context] [--additional-note] [--is-global] [--module-ids a,b]
1038
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
1039
+ blocks localization glossary list [--search] [--page-number] [--page-size]
1040
+ [--is-global] [--module-id] [--json]
1041
+ blocks localization glossary get <itemId> [--json]
1042
+ blocks localization glossary suggested <itemId> [--max-results <n>] [--json]
1043
+ blocks localization glossary delete <itemId> [--dry-run] [--yes] [--json]
1044
+
1045
+ blocks localization key save --key-name <n> --module-id <id> [--item-id] [--value]
1046
+ [--culture] [--routes a,b] [--glossary-ids a,b] [--context]
1047
+ [--is-new-key] [--is-partially-translated] [--should-publish]
1048
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
1049
+ blocks localization key list [--key-search-text] [--search-key] [--module-ids a,b]
1050
+ [--page-number] [--page-size] [--sort-by] [--sort-desc]
1051
+ [--is-partially-translated] [--missing-languages a,b]
1052
+ [--create-date-start] [--create-date-end]
1053
+ [--last-update-date-start] [--last-update-date-end]
1054
+ [--glossary-id] [--body '<json>'|--file <path>] [--json]
1055
+ blocks localization key get-by-names <keyName...>|--key-names a,b [--module-id] [--json]
1056
+ blocks localization key get <itemId> [--json]
1057
+ blocks localization key delete <itemId> [--dry-run] [--yes] [--json]
1058
+ blocks localization key delete-keys <itemId...>|--item-ids a,b [--dry-run] [--yes] [--json]
1059
+ blocks localization key get-timeline [--entity-id] [--user-id] [--page-number]
1060
+ [--page-size] [--sort-by] [--sort-desc] [--create-date-start]
1061
+ [--create-date-end] [--json]
1062
+ blocks localization key get-localization-timeline [--user-id] [--log-from]
1063
+ [--log-from-values a,b] [--exclude-log-from-values a,b]
1064
+ [--page-number] [--page-size] [--sort-by] [--sort-desc]
1065
+ [--create-date-start] [--create-date-end] [--json]
1066
+ blocks localization key get-timeline-by-operation-id <operationId> [--page-number]
1067
+ [--page-size] [--json]
1068
+ blocks localization key get-uilm-file --module <name> --language <culture> [--json]
1069
+ blocks localization key generate-uilm-file --module-id <id> [--guid]
1070
+ [--dry-run] [--yes] [--json]
1071
+ blocks localization key translate-all --module-id <id> [--default-language]
1072
+ [--message-co-relation-id] [--dry-run] [--yes] [--json]
1073
+ blocks localization key translate-key <keyId> --default-language <culture>
1074
+ [--message-co-relation-id] [--dry-run] [--yes] [--json]
1075
+ blocks localization key translate-keys <keyId...>|--key-ids a,b --default-language <culture>
1076
+ [--message-co-relation-id] [--project-key]
1077
+ [--dry-run] [--yes] [--json]
1078
+ blocks localization key translate-and-export --module-id <id> [--default-language]
1079
+ [--wait] [--poll-interval <seconds>] [--timeout <seconds>]
1080
+ [--guid] [--output-type <0-5>] [--app-ids a,b] [--languages a,b]
1081
+ [--reference-file-id] [--caller-tenant-id] [--start-date]
1082
+ [--end-date] [--dry-run] [--yes] [--json]
1083
+ Composed flow: translate-all -> generate-uilm-file -> uilm-export. Without --wait,
1084
+ fires all 3 back to back (same as running them by hand). With --wait, polls
1085
+ GetTimelineByOperationId (using a generated messageCoRelationId) between translate
1086
+ and generate, since translation runs async and there's no documented explicit
1087
+ "done" field to check -- it stops once the timeline entry count settles across 2
1088
+ polls, or times out with a clear next-step message. Prints one output block per
1089
+ step, not a single combined document.
1090
+ blocks localization key uilm-import <fileId> [--message-co-relation-id]
1091
+ [--dry-run] [--yes] [--json]
1092
+ blocks localization key uilm-export [--output-type <0-5>] [--app-ids a,b] [--languages a,b]
1093
+ [--reference-file-id] [--caller-tenant-id] [--start-date]
1094
+ [--end-date] [--message-co-relation-id] [--dry-run] [--yes] [--json]
1095
+ blocks localization key get-uilm-exported-files [--search] [--page-number] [--page-size]
1096
+ [--create-date-start] [--create-date-end] [--json]
1097
+ blocks localization key get-language-file-generation-history [--page-number]
1098
+ [--page-size] [--json]
1099
+ blocks localization key rollback <itemId> [--dry-run] [--yes] [--json]
1100
+
1101
+ blocks localization language save --language-name <n> --language-code <c> [--item-id]
1102
+ [--is-default] [--body '<json>'|--file <path>]
1103
+ [--dry-run] [--yes] [--json]
1104
+ blocks localization language list [--json]
1105
+ blocks localization language list-for-tenant [--json]
1106
+ blocks localization language delete <languageName> [--dry-run] [--yes] [--json]
1107
+ blocks localization language set-default <languageName> [--dry-run] [--yes] [--json]
1108
+
1109
+ blocks localization module save --module-name <n> [--item-id]
1110
+ [--body '<json>'|--file <path>] [--dry-run] [--yes] [--json]
1111
+ blocks localization module list [--json]
1112
+ blocks localization module list-for-tenant [--json]
1113
+ blocks localization module tag-glossary <moduleId> --glossary-ids a,b
1114
+ [--dry-run] [--yes] [--json]
1115
+
1116
+ Release:
1117
+ blocks release deploy [--domain <customDomain>] [--wait] [--poll-interval <seconds>]
1118
+ [--timeout <seconds>] [--dry-run] [--yes] [--json]
1119
+ Deploy the selected project's environment. Resolves everything from state
1120
+ you already have: the repo linked to this project (Project/GetAsset) and
1121
+ that repo's connected branch (Build/repo-details) -- no --repo-id needed.
1122
+ Aborts if the connected branch doesn't match this environment's name.
1123
+ Pass --domain to also set the custom deployment domain before deploying.
1124
+ Pass --wait to poll release status on the resulting build until it reaches
1125
+ a terminal state (or --timeout elapses, default 900s) instead of returning
1126
+ immediately with just a build id.
1127
+ Mutating; no artifact upload is performed by this CLI.
1128
+
1129
+ blocks release status <buildId> [--json]
1130
+ Read Release build status by build id using an impersonated project
1131
+ token. Read-only.
1132
+
1133
+ blocks release builds list [repoId] [--repo-id <repoId>] [--json]
1134
+ List Release build details for a repository using an impersonated project
1135
+ token. When repoId is omitted, resolves it from the selected project's
1136
+ linked repo assets (Project/GetAsset, account token) -- auto-picked if
1137
+ there's exactly one, otherwise you're prompted to choose. Read-only.
1138
+
1139
+ blocks release builds get <buildId> [--json]
1140
+ Alias for release status. Read-only.
1141
+
1142
+ Scaffold:
1143
+ blocks new web <name> [--app-domain <domain>] [--client-id <oidcClientId>]
1144
+ [--x-blocks-key <tenantId>] [--blocks-api-url <url>] [--oidc-url <url>]
1145
+ Create a Vite React starter app that talks to Blocks exclusively through
1146
+ @seliseblocks/client (a single createBlocksClient() instance) using the SDK
1147
+ hosted IdP flow: blocksClient.auth.idp.redirectToProvider() on login click
1148
+ and blocksClient.auth.idp.callback() on /login/callback. Includes route
1149
+ guards, auto-refresh through auth.oidc.refreshToken(), live
1150
+ auth/iam/data/localization SDK examples, environment config, and safe
1151
+ .gitignore defaults.
1152
+ Uses the selected project (see 'use') unless --x-blocks-key overrides it.
1153
+ --app-domain and --client-id are resolved from the project when omitted:
1154
+ if the project has one domain it's used automatically, otherwise you're
1155
+ prompted to choose; the OIDC client is picked from a list of the
1156
+ project's existing clients, or you can create a minimal one (display
1157
+ name + redirect URI, active, registered as a Blocks OIDC identity
1158
+ provider) on the spot, or skip and register one later from the portal or
1159
+ 'auth oidc-clients save'.
1160
+ If --blocks-api-url is omitted, it is derived from the app domain:
1161
+ https://blocksapi.<registrable-domain> (for example, app domain
1162
+ https://dqrsf.slsblx.com uses https://blocksapi.slsblx.com). Pass a
1163
+ different Data/IAM/Localization/OS gateway URL explicitly only if your
1164
+ project uses a non-default one.
1165
+ --oidc-url defaults to https://iam.seliseblocks.com.
1166
+
1167
+ Skills:
1168
+ blocks skill list [--json]
1169
+ List bundled blocks-skills/*/SKILL.md agent context docs (name +
1170
+ description). Local-only, no cloud calls.
1171
+ blocks skill show <name> [--json]
1172
+ Print one skill's full SKILL.md content.
1173
+ blocks skill add <name> [--dir <path>]
1174
+ Copy a bundled skill's SKILL.md into <path>/<name>/SKILL.md in the
1175
+ current directory (default --dir is 'blocks-skills'), for use in a
1176
+ project outside this monorepo. Overwrites silently, same as
1177
+ 'data schema pull'.
1178
+
1179
+ SDK:
1180
+ blocks sdk client [--app-domain <domain>] [--client-id <oidcClientId>]
1181
+ [--x-blocks-key <tenantId>] [--blocks-api-url <url>] [--oidc-url <url>] [--json]
1182
+ Read-only: "I want to use the Blocks SDK -- show me the client." Resolves this
1183
+ project's @seliseblocks/client config using the selected project unless
1184
+ --x-blocks-key overrides it, and the project's registered domain/OIDC client
1185
+ when --app-domain/--client-id are omitted. Its API URL defaults to
1186
+ https://api.seliseblocks.com unless --blocks-api-url is passed.
1187
+ Prints a ready-to-paste createBlocksClient(...) snippet.
1188
+ Passing both --app-domain and --client-id skips the project lookup entirely
1189
+ (no login required). Never writes a file; to scaffold a new app use 'new web'.
1180
1190
  `);
1181
1191
  }