スクラッチ組織ユーザーの作成
スクラッチ組織は 1 人の開発者が使うことを前提に設計されていますが、他のユーザーによって異なるプロファイルや権限セットをテストすることが必要になる場合もあります。
ユーザーを作成するには、org create user コマンドを使用します。ユーザーに簡易な名前を割り当て、後で CLI コマンドで参照できるようにするには、--set-alias フラグを指定します。コマンドが完了すると、新しいユーザー名とユーザー ID が出力されます。
1sf org create user --set-alias qa-user --target-org my-scratch
2Successfully created user "1690397809_test-st9thgoyyyq3@example.com" with ID 0058I002inzvQAA for org 00D80000PhAkUAK.
3
4See more details about this user by running "sf org user display -o 1690397809774_test-st9thgoyyyq3@example.com".ユーザーは、特定のスクラッチ組織に関連付けられています。スクラッチ組織のユーザー名またはエイリアスが、デフォルトとして設定されていない場合は、コマンドラインで -target-org フラグを使用して指定します。スクラッチ組織以外のユーザーを作成しようとすると、org create user コマンドは失敗します。
新規ユーザーをカスタマイズするには、定義ファイルを作成し、--definition-file フラグで指定します。
1sf org create user --set-alias qa-user --definition-file config/user-def.jsonスクラッチ組織に関連付けられているユーザーのリストを表示するには、org list users コマンドを使用します。左側の (A) は、スクラッチ組織の作成時に作成されたシステム管理者ユーザーを示します。
1sf org list users --target-org my-scratch
2=== Users in org 00D80000PhAkUAK
3
4 Default Alias Username Profile Name User Id
5 ─────── ────────── ─────────────────────────────────────────── ──────────────────── ───────────────
6 (A) my-scratch test-st9thgoyyyq3@example.com System Administrator 0058I002inzvQAA
7 qa-user 1690397809_test-st9thgoyyyq3@example.com Standard User 0058I002inzvQAAユーザーに関する詳細を表示するには、org display user コマンドを使用します。
1sf org display user --target-org qa-user
2Warning: This command exposes sensitive information <truncated for readability>
3
4=== User Description
5
6 key label
7 ──────────── ────────────────────────────────────────────────────────────────────────────────────────────────────────────────
8 Username 1690397809_test-st9thgoyyyq3@example.com
9 Profile Name Standard User
10 Id 0058I002inzvQAA
11 Org Id 00D80000PhAkUAK
12 Access Token 00D8I<truncated>
13 Instance Url https://connect-enterprise-1121-dev-ed.scratch.my.salesforce.com
14 Login Url https://connect-enterprise-1121-dev-ed.scratch.my.salesforce.com
15 Alias qa-user