@seliseblocks/cli-os 0.2.11 → 0.2.12

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