From 372456abe5c4c1ddf1dacf3d35c740b0b14edc7a Mon Sep 17 00:00:00 2001 From: Karolis Zukauskas Date: Tue, 25 Mar 2025 13:21:54 +0200 Subject: [PATCH 1/2] Added examples from /docs to command help menus. --- docs/imodel/populate.md | 2 +- docs/user/info.md | 2 +- src/commands/access-control/group/create.ts | 4 +++ src/commands/access-control/group/delete.ts | 4 +++ src/commands/access-control/group/info.ts | 4 +++ src/commands/access-control/group/list.ts | 4 +++ src/commands/access-control/group/update.ts | 11 ++++++++ .../access-control/member/group/add.ts | 8 +++--- .../access-control/member/group/delete.ts | 6 ++++- .../access-control/member/group/info.ts | 6 ++++- .../access-control/member/group/list.ts | 4 +++ .../access-control/member/group/update.ts | 4 +++ .../access-control/member/invitations.ts | 6 ++++- .../access-control/member/owner/add.ts | 4 +++ .../access-control/member/owner/delete.ts | 4 +++ .../access-control/member/owner/list.ts | 6 ++++- .../access-control/member/user/add.ts | 8 +++--- .../access-control/member/user/delete.ts | 4 +++ .../access-control/member/user/info.ts | 4 +++ .../access-control/member/user/list.ts | 4 +++ .../access-control/member/user/update.ts | 6 ++++- .../access-control/permissions/all.ts | 4 +++ src/commands/access-control/permissions/me.ts | 6 ++++- src/commands/access-control/role/create.ts | 6 ++++- src/commands/access-control/role/delete.ts | 6 ++++- src/commands/access-control/role/info.ts | 6 ++++- src/commands/access-control/role/list.ts | 6 ++++- src/commands/access-control/role/update.ts | 13 +++++++++- src/commands/auth/login.ts | 2 ++ src/commands/changed-elements/changesets.ts | 17 ++++++++++++- src/commands/changed-elements/comparison.ts | 13 +++++++++- src/commands/changed-elements/disable.ts | 6 ++++- src/commands/changed-elements/enable.ts | 6 ++++- src/commands/changed-elements/info.ts | 6 ++++- src/commands/imodel/changeset/info.ts | 6 ++++- src/commands/imodel/changeset/list.ts | 21 +++++++++++++++- src/commands/imodel/connection/auth.ts | 4 +++ src/commands/imodel/connection/create.ts | 11 ++++++++ src/commands/imodel/connection/delete.ts | 6 ++++- src/commands/imodel/connection/info.ts | 6 ++++- src/commands/imodel/connection/list.ts | 17 ++++++++++++- src/commands/imodel/connection/run/create.ts | 9 ++++++- src/commands/imodel/connection/run/info.ts | 6 ++++- src/commands/imodel/connection/run/list.ts | 17 ++++++++++++- .../imodel/connection/sourcefile/add.ts | 9 ++++++- .../imodel/connection/sourcefile/delete.ts | 6 ++++- .../imodel/connection/sourcefile/info.ts | 6 ++++- .../imodel/connection/sourcefile/list.ts | 17 ++++++++++++- .../imodel/connection/sourcefile/update.ts | 6 ++++- src/commands/imodel/connection/update.ts | 13 +++++++++- src/commands/imodel/create.ts | 13 +++++++++- src/commands/imodel/delete.ts | 4 +++ src/commands/imodel/info.ts | 4 +++ src/commands/imodel/list.ts | 21 +++++++++++++++- src/commands/imodel/named-version/create.ts | 17 ++++++++++++- src/commands/imodel/named-version/info.ts | 6 ++++- src/commands/imodel/named-version/list.ts | 21 +++++++++++++++- src/commands/imodel/populate.ts | 21 +++++++++++++--- src/commands/imodel/update.ts | 6 ++++- src/commands/imodel/view/cesium-sandcastle.ts | 13 +++++++++- src/commands/itwin/create.ts | 17 ++++++++++++- src/commands/itwin/delete.ts | 6 ++++- src/commands/itwin/info.ts | 6 ++++- src/commands/itwin/list.ts | 25 ++++++++++++++++++- src/commands/itwin/repository/create.ts | 17 ++++++++++++- src/commands/itwin/repository/delete.ts | 6 ++++- src/commands/itwin/repository/list.ts | 17 ++++++++++++- src/commands/itwin/update.ts | 17 ++++++++++++- src/commands/storage/file/create.ts | 13 +++++++++- src/commands/storage/file/delete.ts | 6 ++++- src/commands/storage/file/info.ts | 6 ++++- src/commands/storage/file/list.ts | 13 +++++++++- src/commands/storage/file/update-complete.ts | 9 ++++++- src/commands/storage/file/update-content.ts | 9 ++++++- src/commands/storage/file/update.ts | 13 +++++++++- src/commands/storage/file/upload.ts | 13 +++++++++- src/commands/storage/folder/create.ts | 14 ++++++++++- src/commands/storage/folder/delete.ts | 6 ++++- src/commands/storage/folder/info.ts | 6 ++++- src/commands/storage/folder/list.ts | 13 +++++++++- src/commands/storage/folder/update.ts | 13 +++++++++- src/commands/storage/root-folder.ts | 4 +++ src/commands/user/info.ts | 9 ++++++- src/commands/user/search.ts | 13 +++++++++- 84 files changed, 686 insertions(+), 73 deletions(-) diff --git a/docs/imodel/populate.md b/docs/imodel/populate.md index 4c5a7824..c27f833b 100644 --- a/docs/imodel/populate.md +++ b/docs/imodel/populate.md @@ -33,7 +33,7 @@ itp imodel populate --imodel-id c2d3e4f5-6789-01ab-cdef-2345678901bc --file site # Example 3: Synchronizing CSV and IFC Files itp imodel populate --imodel-id d3e4f5g6-7890-12ab-cdef-3456789012cd --file data1.csv --file data2.csv --file model.ifc -# Example: Synchronizing Revit and DGN Files +# Example 4: Synchronizing Revit and DGN Files itp imodel populate --imodel-id i9j0k1l2-3456-78ab-cdef-9012345678ij --file model.rvt --file design.dgn ``` diff --git a/docs/user/info.md b/docs/user/info.md index 7a7c2965..04db4142 100644 --- a/docs/user/info.md +++ b/docs/user/info.md @@ -11,7 +11,7 @@ Retrieve information about specific users based on their user IDs. ## Examples ```bash -# Example: Retrieve information about specific users by their user IDs +# Example 1: Retrieve information about specific users by their user IDs itp user info --user-id user1-id --user-id user2-id --user-id user3-id ``` diff --git a/src/commands/access-control/group/create.ts b/src/commands/access-control/group/create.ts index c9607a6b..84c121c1 100644 --- a/src/commands/access-control/group/create.ts +++ b/src/commands/access-control/group/create.ts @@ -10,6 +10,10 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class CreateAccessControlGroup extends BaseCommand { static description = 'Create a new group for an iTwin.'; + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Engineering Team" --description "Group handling engineering tasks"` + ]; + static flags = { description: Flags.string({ char: 'd', diff --git a/src/commands/access-control/group/delete.ts b/src/commands/access-control/group/delete.ts index 03a78fce..eaae5595 100644 --- a/src/commands/access-control/group/delete.ts +++ b/src/commands/access-control/group/delete.ts @@ -10,6 +10,10 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class DeleteAccessControlGroup extends BaseCommand { static description = 'Delete an existing group from an iTwin.'; + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + ]; + static flags = { "group-id": Flags.string({ char: 'g', diff --git a/src/commands/access-control/group/info.ts b/src/commands/access-control/group/info.ts index 6e115ede..dde398c6 100644 --- a/src/commands/access-control/group/info.ts +++ b/src/commands/access-control/group/info.ts @@ -10,6 +10,10 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class AccessControlGroupInfo extends BaseCommand { static description = 'Retrieve details about a specific group in an iTwin.'; + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + ]; + static flags = { "group-id": Flags.string({ char: 'g', diff --git a/src/commands/access-control/group/list.ts b/src/commands/access-control/group/list.ts index 12183663..ead3f6f0 100644 --- a/src/commands/access-control/group/list.ts +++ b/src/commands/access-control/group/list.ts @@ -10,6 +10,10 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ListAccessControlGroups extends BaseCommand { static description = 'List all groups for a specific iTwin.'; + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/group/update.ts b/src/commands/access-control/group/update.ts index 6373ec6f..91a815e6 100644 --- a/src/commands/access-control/group/update.ts +++ b/src/commands/access-control/group/update.ts @@ -10,6 +10,17 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class UpdateAccessControlGroup extends BaseCommand { static description = 'Update the details of an existing group in an iTwin.'; + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --name "Updated Engineering Team" --description "Updated description"`, + description: 'Example 1: Update group name and description' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --members john.doe@example.com --members jane.doe@example.com --imsGroups "Sample IMS Group" --imsGroups "Sample IMS Group"`, + description: 'Example 2: Update group members and IMS groups' + } + ]; + static flags = { description: Flags.string({ char: 'd', diff --git a/src/commands/access-control/member/group/add.ts b/src/commands/access-control/member/group/add.ts index 1ab71db5..8f8d045d 100644 --- a/src/commands/access-control/member/group/add.ts +++ b/src/commands/access-control/member/group/add.ts @@ -3,7 +3,7 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import { Command, Flags } from "@oclif/core"; +import { Flags } from "@oclif/core"; import BaseCommand from "../../../../extensions/base-command.js"; import { GroupMember } from "../../../../services/access-control-client/models/group.js"; @@ -11,10 +11,10 @@ import { GroupMember } from "../../../../services/access-control-client/models/g export default class AddGroupMembers extends BaseCommand { static description = 'Add one or more groups as members to an iTwin.'; - static examples: Command.Example[] = [ + static examples = [ { - command: 'itp access-control member group add --itwin-id "ad0ba809-9241-48ad-9eb0-c8038c1a1d51" --groups \'[{"groupId": "group1-id", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1", "83ee0d80-dea3-495a-b6c0-7bb102ebbcc3"]}, {"groupId": "group2-id", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1"]}]\',', - description: 'Add one or more groups as members to an iTwin.' + command: `<%= config.bin %> <%= command.id %> --itwin-id "ad0ba809-9241-48ad-9eb0-c8038c1a1d51" --groups '[{"groupId": "group1-id", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1", "83ee0d80-dea3-495a-b6c0-7bb102ebbcc3"]}, {"groupId": "group2-id", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1"]}]',`, + description: 'Example 1: Add one or more groups as members to an iTwin.' } ]; diff --git a/src/commands/access-control/member/group/delete.ts b/src/commands/access-control/member/group/delete.ts index 1f43ce30..6fcec94f 100644 --- a/src/commands/access-control/member/group/delete.ts +++ b/src/commands/access-control/member/group/delete.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class DeleteGroupMember extends BaseCommand { static description = 'Remove a group from an iTwin.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id` + ]; + static flags = { "group-id": Flags.string({ char: 'g', diff --git a/src/commands/access-control/member/group/info.ts b/src/commands/access-control/member/group/info.ts index 259bad8d..2ddadb6d 100644 --- a/src/commands/access-control/member/group/info.ts +++ b/src/commands/access-control/member/group/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class InfoGroupMember extends BaseCommand { static description = 'Retrieve details about a specific group member in an iTwin.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id` + ]; + static flags = { "group-id": Flags.string({ char: 'g', diff --git a/src/commands/access-control/member/group/list.ts b/src/commands/access-control/member/group/list.ts index 67fd7b29..f7b130e3 100644 --- a/src/commands/access-control/member/group/list.ts +++ b/src/commands/access-control/member/group/list.ts @@ -9,6 +9,10 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class ListGroupMembers extends BaseCommand { static description = 'List all group members of an iTwin.'; + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + ]; static flags = { "itwin-id": Flags.string({ diff --git a/src/commands/access-control/member/group/update.ts b/src/commands/access-control/member/group/update.ts index a124fbd7..17e2428f 100644 --- a/src/commands/access-control/member/group/update.ts +++ b/src/commands/access-control/member/group/update.ts @@ -9,6 +9,10 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class UpdateGroupMember extends BaseCommand { static description = 'Update the role assignments for a group in an iTwin.'; + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id --role-ids role1-id --role-ids role2-id` + ]; static flags = { "group-id": Flags.string({ diff --git a/src/commands/access-control/member/invitations.ts b/src/commands/access-control/member/invitations.ts index 3f289d17..1b12a5b2 100644 --- a/src/commands/access-control/member/invitations.ts +++ b/src/commands/access-control/member/invitations.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class AccessControlMemberInvitations extends BaseCommand { static description = "Retrieve the list of pending invitations for an iTwin's members."; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/member/owner/add.ts b/src/commands/access-control/member/owner/add.ts index bb9fec92..9bea328a 100644 --- a/src/commands/access-control/member/owner/add.ts +++ b/src/commands/access-control/member/owner/add.ts @@ -9,6 +9,10 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class AddOwner extends BaseCommand { static description = 'Add a new owner to an iTwin by email.'; + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --email john.owner@example.com` + ]; static flags = { email: Flags.string({ diff --git a/src/commands/access-control/member/owner/delete.ts b/src/commands/access-control/member/owner/delete.ts index f27fa0ac..1dcfb38e 100644 --- a/src/commands/access-control/member/owner/delete.ts +++ b/src/commands/access-control/member/owner/delete.ts @@ -9,6 +9,10 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class DeleteOwner extends BaseCommand { static description = 'Remove an owner from an iTwin by their member ID.'; + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id` + ]; static flags = { "itwin-id": Flags.string({ diff --git a/src/commands/access-control/member/owner/list.ts b/src/commands/access-control/member/owner/list.ts index 43d8966f..47b41171 100644 --- a/src/commands/access-control/member/owner/list.ts +++ b/src/commands/access-control/member/owner/list.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class ListOwners extends BaseCommand { static description = 'List all owners of a specific iTwin.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/member/user/add.ts b/src/commands/access-control/member/user/add.ts index f6892dec..c8048361 100644 --- a/src/commands/access-control/member/user/add.ts +++ b/src/commands/access-control/member/user/add.ts @@ -3,7 +3,7 @@ * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ -import { Command, Flags } from "@oclif/core"; +import { Flags } from "@oclif/core"; import BaseCommand from "../../../../extensions/base-command.js"; import { addMember } from "../../../../services/access-control-client/models/members.js"; @@ -11,10 +11,10 @@ import { addMember } from "../../../../services/access-control-client/models/mem export default class AddUserMembers extends BaseCommand { static description = 'Add one or more user members to an iTwin.'; - static examples: Command.Example[] = [ + static examples = [ { - command: 'itp access-control member user add --itwin-id "ad0ba809-9241-48ad-9eb0-c8038c1a1d51" --members \'[{"email": "user1@example.com", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1", "83ee0d80-dea3-495a-b6c0-7bb102ebbcc3"]}, {"email": "user2@example.com", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1"]}]\',', - description: 'Add one or more user members to an iTwin.' + command: `<%= config.bin %> <%= command.id %> --itwin-id "ad0ba809-9241-48ad-9eb0-c8038c1a1d51" --members '[{"email": "user1@example.com", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1", "83ee0d80-dea3-495a-b6c0-7bb102ebbcc3"]}, {"email": "user2@example.com", "roleIds": ["5abbfcef-0eab-472a-b5f5-5c5a43df34b1"]}]'`, + description: 'Example 1: Add one or more user members to an iTwin.' } ]; diff --git a/src/commands/access-control/member/user/delete.ts b/src/commands/access-control/member/user/delete.ts index b35971ce..7369b451 100644 --- a/src/commands/access-control/member/user/delete.ts +++ b/src/commands/access-control/member/user/delete.ts @@ -9,6 +9,10 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class DeleteUserMember extends BaseCommand { static description = 'Remove a user from an iTwin.'; + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id` + ]; static flags = { "itwin-id": Flags.string({ diff --git a/src/commands/access-control/member/user/info.ts b/src/commands/access-control/member/user/info.ts index 42e66e1e..44a5f433 100644 --- a/src/commands/access-control/member/user/info.ts +++ b/src/commands/access-control/member/user/info.ts @@ -9,6 +9,10 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class InfoUserMember extends BaseCommand { static description = 'Retrieve details about a specific user member in an iTwin.'; + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id` + ]; static flags = { "itwin-id": Flags.string({ diff --git a/src/commands/access-control/member/user/list.ts b/src/commands/access-control/member/user/list.ts index fb6bfcc6..9aa3d8ec 100644 --- a/src/commands/access-control/member/user/list.ts +++ b/src/commands/access-control/member/user/list.ts @@ -9,6 +9,10 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class ListUserMembers extends BaseCommand { static description = 'Retrieve details about a specific user member in an iTwin.'; + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + ]; static flags = { "itwin-id": Flags.string({ diff --git a/src/commands/access-control/member/user/update.ts b/src/commands/access-control/member/user/update.ts index cbc6dcf4..28f665d1 100644 --- a/src/commands/access-control/member/user/update.ts +++ b/src/commands/access-control/member/user/update.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class UpdateUserMember extends BaseCommand { static description = 'Update the role assignments for a user in an iTwin.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id --role-ids role1-id --role-ids role2-id` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/permissions/all.ts b/src/commands/access-control/permissions/all.ts index 6151a0f7..a89740f7 100644 --- a/src/commands/access-control/permissions/all.ts +++ b/src/commands/access-control/permissions/all.ts @@ -7,6 +7,10 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ListAllPermissions extends BaseCommand { static description = 'List all iTwin permissions.'; + + static examples = [ + `<%= config.bin %> <%= command.id %>` + ]; async run() { await this.parse(ListAllPermissions); diff --git a/src/commands/access-control/permissions/me.ts b/src/commands/access-control/permissions/me.ts index 9ab4a9c2..d3e4b690 100644 --- a/src/commands/access-control/permissions/me.ts +++ b/src/commands/access-control/permissions/me.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class MyPermissions extends BaseCommand { static description = 'Retrieve a list of your permissions on a specified iTwin.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %>` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/role/create.ts b/src/commands/access-control/role/create.ts index d048fe6f..6bf15a89 100644 --- a/src/commands/access-control/role/create.ts +++ b/src/commands/access-control/role/create.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class CreateRole extends BaseCommand { static description = 'Create a new role for an iTwin. To assign permissions after creation, use itp access-control role update.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Project Manager" --description "Manages all aspects of the project"` + ]; + static flags = { description: Flags.string({ char: 'd', diff --git a/src/commands/access-control/role/delete.ts b/src/commands/access-control/role/delete.ts index c01feb21..2b7400ab 100644 --- a/src/commands/access-control/role/delete.ts +++ b/src/commands/access-control/role/delete.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class DeleteRole extends BaseCommand { static description = 'Delete an existing role from an iTwin.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --role-id role1-id` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/role/info.ts b/src/commands/access-control/role/info.ts index 57aa9135..1f4a2e39 100644 --- a/src/commands/access-control/role/info.ts +++ b/src/commands/access-control/role/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class InfoRole extends BaseCommand { static description = 'Retrieve details about a specific role in an iTwin.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --role-id role1-id` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/role/list.ts b/src/commands/access-control/role/list.ts index 801556e1..3007f350 100644 --- a/src/commands/access-control/role/list.ts +++ b/src/commands/access-control/role/list.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ListRoles extends BaseCommand { static description = 'List all roles for a specific iTwin.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/role/update.ts b/src/commands/access-control/role/update.ts index a9087bd3..fc12c2d4 100644 --- a/src/commands/access-control/role/update.ts +++ b/src/commands/access-control/role/update.ts @@ -9,7 +9,18 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class UpdateRole extends BaseCommand { static description = 'Update the details of an existing role in an iTwin.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --role-id role1-id --name "Lead Engineer" --description "Oversees engineering tasks"`, + description: 'Example 1: Update role name and description' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --role-id role1-id --name "Admin Role" --permissions Permission1 --permissions Permission2 --permissions Permission3`, + description: 'Example 2: Update role permissions along with the name' + } + ]; + static flags = { description: Flags.string({ char: 'd', diff --git a/src/commands/auth/login.ts b/src/commands/auth/login.ts index 7aa8deac..1f360f89 100644 --- a/src/commands/auth/login.ts +++ b/src/commands/auth/login.ts @@ -14,6 +14,8 @@ export default class Login extends BaseCommand { static examples = [ `<%= config.bin %> <%= command.id %>`, + `<%= config.bin %> <%= command.id %> --client-id native-a1254s86d4a5s4d`, + `<%= config.bin %> <%= command.id %> --client-id service-a1254s86d4a5s4d --client-secret a456a7s89da46s5f4a6f16a5sdf3as2d1f65a4sdf13`, ] static flags = { diff --git a/src/commands/changed-elements/changesets.ts b/src/commands/changed-elements/changesets.ts index e3c15a7f..77090a4e 100644 --- a/src/commands/changed-elements/changesets.ts +++ b/src/commands/changed-elements/changesets.ts @@ -9,7 +9,22 @@ import BaseCommand from "../../extensions/base-command.js"; export default class GetChangesetStatus extends BaseCommand { static description = 'Get the processing status of changesets in an iModel to see which are ready for comparison.'; - + + static examples = [ + { + command: '<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --top 10', + description: 'Example 1: Retrieve the processing status of the first 10 changesets for a specific iModel' + }, + { + command: '<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --skip 5 --top 10', + description: 'Example 2: Skip the first 5 changesets and return the next set' + }, + { + command: '<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51', + description: 'Example 3: Retrieve all changesets for a specific iModel' + } + ]; + static flags = { "imodel-id": Flags.string({ char: 'm', description: 'The ID of the iModel.', required: true }), "itwin-id": Flags.string({ char: 'i', description: 'The ID of the iTwin.', required: true }), diff --git a/src/commands/changed-elements/comparison.ts b/src/commands/changed-elements/comparison.ts index 9749ae50..be2e6697 100644 --- a/src/commands/changed-elements/comparison.ts +++ b/src/commands/changed-elements/comparison.ts @@ -9,7 +9,18 @@ import BaseCommand from "../../extensions/base-command.js"; export default class ChangedElementsComparison extends BaseCommand { static description = 'Compare changes between two changesets in an iModel.'; - + + static examples = [ + { + command: '<%= config.bin %> <%= command.id %> --itwin-id 89337c07-ab59-4080-81cc-5e237be55369 --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id1 2f3b4a8c92d747d5c8a8b2f9cde6742e5d74b3b5 --changeset-id2 4b8a5d9e8d534a71b02894f2a2b4e91d', + description: 'Example 1: Compare two changesets in an iModel' + }, + { + command: '<%= config.bin %> <%= command.id %> --itwin-id 89337c07-ab59-4080-81cc-5e237be55369 --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id1 5d9e8b2f6744a71b02894f1a2b4e91d7 --changeset-id2 6b8e4f7a7348a81b93754c2d5d8f7e12', + description: 'Example 2: Comparing another set of changesets in the same iModel' + } + ]; + static flags = { "changeset-id1": Flags.string({ description: 'The ID of the first changeset to compare.', required: true }), "changeset-id2": Flags.string({ description: 'The ID of the second changeset to compare.', required: true }), diff --git a/src/commands/changed-elements/disable.ts b/src/commands/changed-elements/disable.ts index ae951136..4134881b 100644 --- a/src/commands/changed-elements/disable.ts +++ b/src/commands/changed-elements/disable.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../extensions/base-command.js"; export default class ChangedElementsDisable extends BaseCommand { static description = "Disable change tracking for a specified iModel."; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + ]; + static flags = { "imodel-id": Flags.string({ char: 'm', description: "The ID of the iModel where change tracking should be disabled.", required: true }), "itwin-id": Flags.string({ char: 'i', description: "The ID of the iTwin associated with the iModel.", required: true }), diff --git a/src/commands/changed-elements/enable.ts b/src/commands/changed-elements/enable.ts index 9b01d235..3dd3d813 100644 --- a/src/commands/changed-elements/enable.ts +++ b/src/commands/changed-elements/enable.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../extensions/base-command.js"; export default class ChangedElementsEnable extends BaseCommand { static description = "Enable change tracking for a specified iModel."; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + ]; + static flags = { "imodel-id": Flags.string({ char: 'm', description: "The ID of the iModel where change tracking should be enabled.", required: true }), "itwin-id": Flags.string({ char: 'i', description: "The ID of the iTwin associated with the iModel.", required: true }), diff --git a/src/commands/changed-elements/info.ts b/src/commands/changed-elements/info.ts index a865317b..634dfd41 100644 --- a/src/commands/changed-elements/info.ts +++ b/src/commands/changed-elements/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../extensions/base-command.js"; export default class ChangedElementsInfo extends BaseCommand { static description = "Retrieve change tracking information for a specified iModel."; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + ]; + static flags = { "imodel-id": Flags.string({ char: 'm', description: "The ID of the iModel to retrieve tracking information for.", required: true }), "itwin-id": Flags.string({ char: 'i', description: "The ID of the iTwin associated with the iModel.", required: true }), diff --git a/src/commands/imodel/changeset/info.ts b/src/commands/imodel/changeset/info.ts index 8d392cc0..17d9f858 100644 --- a/src/commands/imodel/changeset/info.ts +++ b/src/commands/imodel/changeset/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ChangesetInfo extends BaseCommand { static description = 'Retrieve details about a specific changeset of an iModel.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id 2f3b4a8c92d747d5c8a8b2f9cde6742e5d74b3b5` + ]; + static flags = { "changeset-id": Flags.string({ description: 'The ID of the changeset.', diff --git a/src/commands/imodel/changeset/list.ts b/src/commands/imodel/changeset/list.ts index 8d18aa6f..6a9538b3 100644 --- a/src/commands/imodel/changeset/list.ts +++ b/src/commands/imodel/changeset/list.ts @@ -10,7 +10,26 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ListChangesets extends BaseCommand { static description = 'List all changesets for a specific iModel.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --top 10`, + description: 'Example 1: List the first 10 changesets for a specific iModel' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --skip 5 --top 10`, + description: 'Example 2: Skip the first 5 changesets and return the next 10' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --after-index 100 --order-by asc`, + description: 'Example 3: List all changesets after a specific index in ascending order' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --last-index 200 --order-by desc`, + description: 'Example 4: List all changesets up to a specific index in descending order' + } + ]; + static flags = { "after-index": Flags.integer({ description: 'List changesets after a specific index (exclusive).', diff --git a/src/commands/imodel/connection/auth.ts b/src/commands/imodel/connection/auth.ts index 84736212..db4b0c83 100644 --- a/src/commands/imodel/connection/auth.ts +++ b/src/commands/imodel/connection/auth.ts @@ -13,6 +13,10 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ConnectionAuth extends BaseCommand { static description = 'Authenticate connector for user'; + static examples = [ + `<%= config.bin %> <%= command.id %>` + ]; + async run() { await this.parse(ConnectionAuth); diff --git a/src/commands/imodel/connection/create.ts b/src/commands/imodel/connection/create.ts index febaa45b..42a24a36 100644 --- a/src/commands/imodel/connection/create.ts +++ b/src/commands/imodel/connection/create.ts @@ -13,6 +13,17 @@ import { storageFileCreate } from "../../../services/synchronizationClient/model export default class CreateConnection extends BaseCommand { static description = 'Create a new connector.'; + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --file-id t5bDFuN4qUa9ojVw1E5FGtldp8BgSbNCiJ2XMdiT-cA --connector-type MSTN`, + description: 'Example 1: Minimal example with only required options' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Engineering Files" --authentication-type Service --file-id t5bDFuN4qUa9ojVw1E5FGtldp8BgSbNCiJ2XMdiT-cA --connector-type MSTN --file-id g4ec1dc8c4f6173004f9f881914a57c5511a336d --connector-type DWG`, + description: 'Example 2: Creating a connection with Service authentication' + } + ]; + static flags = { "authentication-type": Flags.string({ description: 'The authorization workflow type.', diff --git a/src/commands/imodel/connection/delete.ts b/src/commands/imodel/connection/delete.ts index 6c633846..e9998c33 100644 --- a/src/commands/imodel/connection/delete.ts +++ b/src/commands/imodel/connection/delete.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class DeleteConnection extends BaseCommand { static description = 'Delete a storage connection from an iModel.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + ]; + static flags = { "connection-id": Flags.string({ char: 'c', diff --git a/src/commands/imodel/connection/info.ts b/src/commands/imodel/connection/info.ts index ab4b79fa..0ba1f48c 100644 --- a/src/commands/imodel/connection/info.ts +++ b/src/commands/imodel/connection/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ConnectionInfo extends BaseCommand { static description = 'Get connector info.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + ]; + static flags = { "connection-id": Flags.string({ char: 'c', description: 'The id of the connection.', required: true }), }; diff --git a/src/commands/imodel/connection/list.ts b/src/commands/imodel/connection/list.ts index 3db3dc43..ad56dfe7 100644 --- a/src/commands/imodel/connection/list.ts +++ b/src/commands/imodel/connection/list.ts @@ -9,7 +9,22 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ListConnections extends BaseCommand { static description = 'List all storage connections for a specific iModel.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1: Listing all connections for an iModel' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --top 5`, + description: 'Example 2: Listing the first 5 connections for an iModel' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --top 5 --skip 15`, + description: 'Example 3: Listing the 5 connections after the first 15 connections are skipped for an iModel' + } + ]; + static flags = { "imodel-id": Flags.string({ char: 'm', diff --git a/src/commands/imodel/connection/run/create.ts b/src/commands/imodel/connection/run/create.ts index fc1e4963..e19a73ce 100644 --- a/src/commands/imodel/connection/run/create.ts +++ b/src/commands/imodel/connection/run/create.ts @@ -9,7 +9,14 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class CreateConnectionRun extends BaseCommand { static description = 'Create a new connector run.'; - + + static examples = [ + { + command: '<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42', + description: 'Example 1: Running a storage connection for an iModel' + } + ]; + static flags = { "connection-id": Flags.string({ char: 'c', description: 'The id of the connection.', required: true }), }; diff --git a/src/commands/imodel/connection/run/info.ts b/src/commands/imodel/connection/run/info.ts index 3d674dd7..73dc7ee4 100644 --- a/src/commands/imodel/connection/run/info.ts +++ b/src/commands/imodel/connection/run/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class ConnectionRunInfo extends BaseCommand { static description = 'Get connector run info.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --connection-id abc12345-6789-4321-abcd-9876543210ef --connection-run-id run98765-4321-abcd-1234-567890abcdef` + ]; + static flags = { "connection-id": Flags.string({ char: 'c', description: 'The id of the connection.', required: true }), "connection-run-id": Flags.string({ description: 'The id of the connection run.', required: true }), diff --git a/src/commands/imodel/connection/run/list.ts b/src/commands/imodel/connection/run/list.ts index 54ae88de..e4d9e493 100644 --- a/src/commands/imodel/connection/run/list.ts +++ b/src/commands/imodel/connection/run/list.ts @@ -9,7 +9,22 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class ConnectionRunsListed extends BaseCommand { static description = "List all runs for a specific storage connection of an iModel."; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1: List all runs for a specific connection' + }, + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --top 10`, + description: 'Example 2: Limit the results to 10 runs' + }, + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --skip 5`, + description: 'Example 3: Skip the first 5 runs and return the next set' + } + ]; + static flags = { "connection-id": Flags.string({ char: 'c', description: "The ID of the storage connection.", required: true }), }; diff --git a/src/commands/imodel/connection/sourcefile/add.ts b/src/commands/imodel/connection/sourcefile/add.ts index 94e5975f..623e3cd7 100644 --- a/src/commands/imodel/connection/sourcefile/add.ts +++ b/src/commands/imodel/connection/sourcefile/add.ts @@ -10,7 +10,14 @@ import { connectorType } from "../../../../services/synchronizationClient/models export default class CreateConnectionSourceFile extends BaseCommand { static description = 'Add a source file to an existing storage connection of an iModel.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --storage-file-id t5bDFuN4qUa9ojVw1E5FGtldp8BgSbNCiJ2XMdiT-cA --connector-type MSTN`, + description: 'Example 1: Add a source file to a storage connection' + } + ]; + static flags = { "connection-id": Flags.string({ char: 'c', diff --git a/src/commands/imodel/connection/sourcefile/delete.ts b/src/commands/imodel/connection/sourcefile/delete.ts index 268020d7..68e6a7a3 100644 --- a/src/commands/imodel/connection/sourcefile/delete.ts +++ b/src/commands/imodel/connection/sourcefile/delete.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class ConnectionSourceFileDelete extends BaseCommand { static description = 'Remove a source file from a storage connection of an iModel.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --source-file-id 297c8ab9-53a3-4fe5-adf8-79b4c1a95cbb` + ]; + static flags = { "connection-id": Flags.string({ char: 'c', diff --git a/src/commands/imodel/connection/sourcefile/info.ts b/src/commands/imodel/connection/sourcefile/info.ts index aa7ad1fc..6d394a2e 100644 --- a/src/commands/imodel/connection/sourcefile/info.ts +++ b/src/commands/imodel/connection/sourcefile/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class ConnectionSourceFileInfo extends BaseCommand { static description = 'Retrieve details about a specific source file in a storage connection of an iModel.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --source-file-id 297c8ab9-53a3-4fe5-adf8-79b4c1a95cbb` + ]; + static flags = { "connection-id": Flags.string({ char: 'c', diff --git a/src/commands/imodel/connection/sourcefile/list.ts b/src/commands/imodel/connection/sourcefile/list.ts index c3c317ef..b3ce79c0 100644 --- a/src/commands/imodel/connection/sourcefile/list.ts +++ b/src/commands/imodel/connection/sourcefile/list.ts @@ -9,7 +9,22 @@ import BaseCommand from "../../../../extensions/base-command.js"; export default class ListSourceFiles extends BaseCommand { static description = 'Retrieve details about a specific source file in a storage connection of an iModel.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1: List all source files in a specific storage connection' + }, + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --top 10`, + description: 'Example 2: Limit the results to 10 source files' + }, + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --skip 5`, + description: 'Example 3: Skip the first 5 source files and return the next set' + } + ]; + static flags = { "connection-id": Flags.string({ char: 'c', description: 'The ID of the storage connection.', required: true }), }; diff --git a/src/commands/imodel/connection/sourcefile/update.ts b/src/commands/imodel/connection/sourcefile/update.ts index 6168fd07..eeee355d 100644 --- a/src/commands/imodel/connection/sourcefile/update.ts +++ b/src/commands/imodel/connection/sourcefile/update.ts @@ -10,7 +10,11 @@ import { connectorType } from "../../../../services/synchronizationClient/models export default class ConnectionSourceFileUpdate extends BaseCommand { static description = 'Update an existing source file in a storage connection of an iModel.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --source-file-id 297c8ab9-53a3-4fe5-adf8-79b4c1a95cbb --connector-type DWG` + ]; + static flags = { "connection-id": Flags.string({ char: 'c', diff --git a/src/commands/imodel/connection/update.ts b/src/commands/imodel/connection/update.ts index 9f217f8f..532e6c17 100644 --- a/src/commands/imodel/connection/update.ts +++ b/src/commands/imodel/connection/update.ts @@ -10,7 +10,18 @@ import { authenticationType } from "../../../services/synchronizationClient/mode export default class UpdateStorageConnection extends BaseCommand { static description = 'Update an existing storage connection for an iModel.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --name "Updated Project Files"`, + description: 'Example 1: Updating a connection with a new display name' + }, + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --authentication-type Service`, + description: 'Example 2: Changing authentication type for a connection' + } + ]; + static flags = { "authentication-type": Flags.string({ description: 'The authorization workflow type.', diff --git a/src/commands/imodel/create.ts b/src/commands/imodel/create.ts index af3f7b5f..f7c65cca 100644 --- a/src/commands/imodel/create.ts +++ b/src/commands/imodel/create.ts @@ -10,7 +10,18 @@ import BaseCommand from "../../extensions/base-command.js"; export default class CreateIModel extends BaseCommand { static description = 'Creates an iModel in an iTwin'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Basic iModel"`, + description: 'Example 1: Creating an iModel with minimal options' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Sun City Renewable-energy Plant" --description "Overall model of wind and solar farms in Sun City" --extent '{ "southWest": { "latitude": 46.13267702834806, "longitude": 7.672120009938448 }, "northEast": { "latitude": 46.302763954781234, "longitude": 7.835541640797823 }}'`, + description: 'Example 2: Creating an iModel with all options, including extent and description' + } + ]; + static flags = { description: Flags.string({ char: 'd', diff --git a/src/commands/imodel/delete.ts b/src/commands/imodel/delete.ts index 1b25db0b..bc4b99c0 100644 --- a/src/commands/imodel/delete.ts +++ b/src/commands/imodel/delete.ts @@ -10,6 +10,10 @@ import BaseCommand from "../../extensions/base-command.js"; export default class DeleteIModel extends BaseCommand { static description = 'Delete an existing iModel.'; + static examples = [ + `<%= config.bin %> <%= command.id %> --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee7d` + ]; + static flags = { "imodel-id": Flags.string({ char: 'm', diff --git a/src/commands/imodel/info.ts b/src/commands/imodel/info.ts index d7a1237b..d544b13c 100644 --- a/src/commands/imodel/info.ts +++ b/src/commands/imodel/info.ts @@ -10,6 +10,10 @@ import BaseCommand from "../../extensions/base-command.js"; export class IModelInfo extends BaseCommand { static description = 'Retrieve metadata for the specified Model'; + static examples = [ + `<%= config.bin %> <%= command.id %> --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee7d` + ]; + static flags = { "imodel-id": Flags.string({ char: 'm', diff --git a/src/commands/imodel/list.ts b/src/commands/imodel/list.ts index 2852ece1..dde46a0c 100644 --- a/src/commands/imodel/list.ts +++ b/src/commands/imodel/list.ts @@ -10,7 +10,26 @@ import BaseCommand from "../../extensions/base-command.js"; export default class ListIModels extends BaseCommand { static description = 'Retrieve a list of iModels'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1: List all iModels for a specific iTwin' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --top 10 --order-by "name desc"`, + description: 'Example 2: List the first 10 iModels, ordered by name in descending order' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --search "Sun City"`, + description: 'Example 3: Search for iModels with "Sun City" in their name or description' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --state initialized`, + description: 'Example 4: List only initialized iModels' + } + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/imodel/named-version/create.ts b/src/commands/imodel/named-version/create.ts index 998cafd5..b6bc7aa6 100644 --- a/src/commands/imodel/named-version/create.ts +++ b/src/commands/imodel/named-version/create.ts @@ -9,7 +9,22 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class CreateNamedVersion extends BaseCommand { static description = 'Create a new named version for a specific changeset in an iModel.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id 2f3b4a8c92d747d5c8a8b2f9cde6742e5d74b3b5 --name "Version 1.0" --description "Initial release"`, + description: 'Example 1: Creating a named version with a description' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Version 2.0"`, + description: 'Example 2: Creating a named version without specifying changesetId (uses the latest changeset)' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id 4b8a5d9e8d534a71b02894f2a2b4e91d --name "Version 3.0"`, + description: 'Example 3: Creating a named version without a description' + } + ]; + static flags = { "changeset-id": Flags.string({ description: 'The ID of the changeset for the named version.', diff --git a/src/commands/imodel/named-version/info.ts b/src/commands/imodel/named-version/info.ts index 647521dd..b63478b4 100644 --- a/src/commands/imodel/named-version/info.ts +++ b/src/commands/imodel/named-version/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class NamedVersionInfo extends BaseCommand { static description = 'Retrieve details about a specific named version in an iModel.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --named-version-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + ]; + static flags = { "imodel-id": Flags.string({ char: 'm', diff --git a/src/commands/imodel/named-version/list.ts b/src/commands/imodel/named-version/list.ts index ddceb1cf..20b483f1 100644 --- a/src/commands/imodel/named-version/list.ts +++ b/src/commands/imodel/named-version/list.ts @@ -10,7 +10,26 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ListNamedVersions extends BaseCommand { static description = 'List all named versions for a specific iModel.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --top 10`, + description: 'Example 1: List the first 10 named versions for a specific iModel' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --skip 5 --top 10`, + description: 'Example 2: Skip the first 5 named versions and return the next set' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --search "Milestone"`, + description: `Example 3: Search for named versions containing 'Milestone'` + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Version 2.0" --order-by "changesetIndex desc"`, + description: 'Example 4: Filter named versions by exact name and sort in descending order by changesetIndex' + } + ]; + static flags = { "imodel-id": Flags.string({ char: 'm', diff --git a/src/commands/imodel/populate.ts b/src/commands/imodel/populate.ts index e123417b..5a189e51 100644 --- a/src/commands/imodel/populate.ts +++ b/src/commands/imodel/populate.ts @@ -25,9 +25,24 @@ import { storageRun } from "../../services/synchronizationClient/models/storage- export default class PopulateIModel extends BaseCommand { static description = 'Synchronize design files into an iModel.' - static examples = [ - `<%= config.bin %> <%= command.id %>`, - ] + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --imodel-id b1a2c3d4-5678-90ab-cdef-1234567890ab --file file1.dwg --connector-type DWG --file file2.dwg --connector-type DWG`, + description: 'Example 1: Synchronizing DWG Files' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id c2d3e4f5-6789-01ab-cdef-2345678901bc --file site1.dgn --connector-type CIVIL --file structure2.dgn --connector-type CIVIL`, + description: 'Example 2: Synchronizing DGN Files' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id d3e4f5g6-7890-12ab-cdef-3456789012cd --file data1.csv --file data2.csv --file model.ifc`, + description: 'Example 3: Synchronizing CSV and IFC Files' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id i9j0k1l2-3456-78ab-cdef-9012345678ij --file model.rvt --file design.dgn`, + description: 'Example 4: Synchronizing Revit and DGN Files' + } + ]; static flags = { "connector-type": Flags.string({ diff --git a/src/commands/imodel/update.ts b/src/commands/imodel/update.ts index 5d3122f9..1f61d5f3 100644 --- a/src/commands/imodel/update.ts +++ b/src/commands/imodel/update.ts @@ -10,7 +10,11 @@ import BaseCommand from "../../extensions/base-command.js"; export default class UpdateCommand extends BaseCommand { static description = 'Update an iModel in an iTwin'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee7d --name "Updated Sun City Renewable-energy Plant" --description "Updated overall model of wind and solar farms in Sun City" --extent '{ "southWest": { "latitude": 46.13267702834806, "longitude": 7.672120009938448 }, "northEast": { "latitude": 46.302763954781234, "longitude": 7.835541640797823 }}'` + ]; + static flags = { description: Flags.string({ char: 'd', diff --git a/src/commands/imodel/view/cesium-sandcastle.ts b/src/commands/imodel/view/cesium-sandcastle.ts index 8d266b65..aa5c0a52 100644 --- a/src/commands/imodel/view/cesium-sandcastle.ts +++ b/src/commands/imodel/view/cesium-sandcastle.ts @@ -12,7 +12,18 @@ import { link, links } from "../../../services/general-models/links.js"; export default class CesiumSandcastle extends BaseCommand { static description = "Setup iModel and get url to view it in Cesium Sandcastle"; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --imodel-id "5e19bee0-3aea-4355-a9f0-c6df9989ee7d" --changeset-id "2f3b4a8c92d747d5c8a8b2f9cde6742e5d74b3b5"`, + description: 'Example 1: Get a link to a specific changeset of an iModel in Cesium Sandcastle' + }, + { + command: `<%= config.bin %> <%= command.id %> --imodel-id "5e19bee0-3aea-4355-a9f0-c6df9989ee7d" --changeset-id "2f3b4a8c92d747d5c8a8b2f9cde6742e5d74b3b5" --open`, + description: 'Example 2: Get a link to a specific changeset of an iModel in Cesium Sandcastle and open the URL in the browser' + } + ]; + static flags = { "changeset-id": Flags.string({ description: "Changeset id to be viewed in Cesium Sandcastle.", diff --git a/src/commands/itwin/create.ts b/src/commands/itwin/create.ts index be708db0..82d863e1 100644 --- a/src/commands/itwin/create.ts +++ b/src/commands/itwin/create.ts @@ -10,7 +10,22 @@ import BaseCommand from "../../extensions/base-command.js"; export default class CreateITwin extends BaseCommand { static description = 'Create an iTwin'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --class Thing --sub-class Asset --name "Golden Gate Revamp"`, + description: `Example 1: Creating an iTwin with the 'Thing' class and 'Asset' subclass` + }, + { + command: `<%= config.bin %> <%= command.id %> --class Endeavor --sub-class Project --name "Bridge Construction" --geographic-location "San Francisco, CA" --iana-time-zone America/Los_Angeles`, + description: `Example 2: Creating an iTwin with the 'Endeavor' class and 'Project' subclass` + }, + { + command: `<%= config.bin %> <%= command.id %> --class Endeavor --sub-class Program --name "Rail Network" --data-center-location "UK South" --status Trial`, + description: `Example 3: Creating an iTwin with data center location and status set to 'Trial'` + } + ]; + static flags = { class: Flags.string({ description: 'The Class of your iTwin.', diff --git a/src/commands/itwin/delete.ts b/src/commands/itwin/delete.ts index acd65e4f..a381162b 100644 --- a/src/commands/itwin/delete.ts +++ b/src/commands/itwin/delete.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../extensions/base-command.js"; export default class DeleteITwin extends BaseCommand { static description = 'Delete an iTwin'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id b1a2c3d4-5678-90ab-cdef-1234567890ab` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/itwin/info.ts b/src/commands/itwin/info.ts index ac16c298..7b02a501 100644 --- a/src/commands/itwin/info.ts +++ b/src/commands/itwin/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../extensions/base-command.js"; export default class ITwinInfo extends BaseCommand { static description = 'Retrieve metadata for the specified iTwin.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id b1a2c3d4-5678-90ab-cdef-1234567890ab` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/itwin/list.ts b/src/commands/itwin/list.ts index 59baf130..2d622357 100644 --- a/src/commands/itwin/list.ts +++ b/src/commands/itwin/list.ts @@ -10,7 +10,30 @@ import BaseCommand from "../../extensions/base-command.js"; export default class ListITwins extends BaseCommand { static description = 'List of iTwins'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %>`, + description: 'Example 1: Getting all itwins' + }, + { + command: `<%= config.bin %> <%= command.id %> --sub-class Project --status Active`, + description: 'Example 2: Filtering by subClass and status' + }, + { + command: `<%= config.bin %> <%= command.id %> --sub-class Program --type Luxury --top 10`, + description: 'Example 3: Limiting the number of returned results and filtering by type' + }, + { + command: `<%= config.bin %> <%= command.id %> --sub-class Asset --name "Solar Farm" --include-inactive true`, + description: 'Example 4: Searching by display name and including inactive iTwins' + }, + { + command: `<%= config.bin %> <%= command.id %> --sub-class WorkPackage --parent-id b1a2c3d4-5678-90ab-cdef-1234567890ab --skip 5`, + description: 'Example 5: Filtering by parent iTwin ID and skipping the first 5 results' + } + ]; + static flags = { "include-inactive": Flags.boolean({ description: 'Include Inactive iTwins in the result.', diff --git a/src/commands/itwin/repository/create.ts b/src/commands/itwin/repository/create.ts index a377a097..e1f36446 100644 --- a/src/commands/itwin/repository/create.ts +++ b/src/commands/itwin/repository/create.ts @@ -10,7 +10,22 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class CreateRepository extends BaseCommand { static description = 'Create a new repository URI for iTwin data.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --class GeographicInformationSystem --sub-class WebMapTileService --uri https://example.com/repository1`, + description: 'Example 1: Creating a repository with Geographic Information System class' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --class Construction --sub-class Performance --uri https://example.com/repository2`, + description: 'Example 2: Creating a repository for Construction class with MapServer subclass' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --class Subsurface --sub-class EvoWorkspace --uri https://example.com/repository3`, + description: 'Example 3: Creating a repository for Subsurface class without specifying a subclass' + } + ]; + static flags = { class: Flags.string({ description: 'The class of your iTwin repository.', diff --git a/src/commands/itwin/repository/delete.ts b/src/commands/itwin/repository/delete.ts index 445b5006..505abf49 100644 --- a/src/commands/itwin/repository/delete.ts +++ b/src/commands/itwin/repository/delete.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class DeleteRepository extends BaseCommand { static description = 'Delete a specified repository from an iTwin.'; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --repository-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/itwin/repository/list.ts b/src/commands/itwin/repository/list.ts index 4f869bc6..84558ed2 100644 --- a/src/commands/itwin/repository/list.ts +++ b/src/commands/itwin/repository/list.ts @@ -9,7 +9,22 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ListRepositories extends BaseCommand { static description = 'Retrieve a list of repositories for a specified iTwin.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1: Listing all repositories for an iTwin' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --class iModels`, + description: 'Example 2: Filtering repositories by class' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --class GeographicInformationSystem --sub-class WebMapTileService`, + description: 'Example 3: Filtering repositories by class and subClass' + } + ]; + static flags = { class: Flags.string({ description: 'Specify a particular class of repositories to retrieve.', diff --git a/src/commands/itwin/update.ts b/src/commands/itwin/update.ts index aef6823e..fc7c83aa 100644 --- a/src/commands/itwin/update.ts +++ b/src/commands/itwin/update.ts @@ -10,7 +10,22 @@ import BaseCommand from "../../extensions/base-command.js"; export default class UpdateCommand extends BaseCommand { static description = 'Update an iTwin'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --itwin-id b1a2c3d4-5678-90ab-cdef-1234567890ab --name "Updated Portfolio"`, + description: `Example 1: Updating iTwin's display name` + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id b1a2c3d4-5678-90ab-cdef-1234567890ab --geographic-location "New York, NY" --iana-time-zone America/New_York`, + description: 'Example 2: Changing geographic location and time zone' + }, + { + command: `<%= config.bin %> <%= command.id %> --itwin-id b1a2c3d4-5678-90ab-cdef-1234567890ab --status Inactive`, + description: `Example 3: Setting the iTwin's status to 'Inactive'` + } + ]; + static flags = { "geographic-location": Flags.string({ description: 'Optional location, typically an address or city.', diff --git a/src/commands/storage/file/create.ts b/src/commands/storage/file/create.ts index 76eab847..fada4581 100644 --- a/src/commands/storage/file/create.ts +++ b/src/commands/storage/file/create.ts @@ -9,7 +9,18 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class FileCreate extends BaseCommand { static description = 'Create a new file in a specified folder in iTwin\'s storage.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --folder-id abc12345-6789-4321-abcd-9876543210ef --name design.dwg`, + description: 'Example 1: Creating a file with display name only' + }, + { + command: `<%= config.bin %> <%= command.id %> --folder-id abc12345-6789-4321-abcd-9876543210ef --name model.ifc --description "Model file for the building design"`, + description: 'Example 2: Creating a file with display name and description' + } + ]; + static flags = { description: Flags.string({ char: 'd', description: 'A description for the file.', required: false }), "folder-id": Flags.string({ char: 'f', description: 'The ID of the folder where the file will be created.', required: true }), diff --git a/src/commands/storage/file/delete.ts b/src/commands/storage/file/delete.ts index 497004b3..3288c5be 100644 --- a/src/commands/storage/file/delete.ts +++ b/src/commands/storage/file/delete.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class DeleteFile extends BaseCommand { static description = "Delete a file from an iTwin's storage."; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --file-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + ]; + static flags = { "file-id": Flags.string({ char: 'f', diff --git a/src/commands/storage/file/info.ts b/src/commands/storage/file/info.ts index 3d8e8b8c..5bd0fabc 100644 --- a/src/commands/storage/file/info.ts +++ b/src/commands/storage/file/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class FileInfo extends BaseCommand { static description = "Retrieve metadata for a specific file in an iTwin's storage."; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --file-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + ]; + static flags = { "file-id": Flags.string({ char: 'f', description: "The ID of the file to retrieve information about.", required: true }), }; diff --git a/src/commands/storage/file/list.ts b/src/commands/storage/file/list.ts index 955da713..6b98e0c5 100644 --- a/src/commands/storage/file/list.ts +++ b/src/commands/storage/file/list.ts @@ -9,7 +9,18 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ListFiles extends BaseCommand { static description = "List files in a folder of an iTwin's storage. Optionally, include subfolders in the result."; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --folder-id b1a2c3d4-5678-90ab-cdef-1234567890ab`, + description: 'Example 1: List files in a specific folder' + }, + { + command: `<%= config.bin %> <%= command.id %> --folder-id b1a2c3d4-5678-90ab-cdef-1234567890ab --include-folders true`, + description: 'Example 2: List files and include subfolders in the result' + } + ]; + static flags = { "folder-id": Flags.string({ char: 'f', description: "The ID of the folder whose files you want to list.", required: true }), "include-folders": Flags.boolean({ description: "Whether to include subfolders in the result." }), diff --git a/src/commands/storage/file/update-complete.ts b/src/commands/storage/file/update-complete.ts index 8ceadf9f..d2dabb93 100644 --- a/src/commands/storage/file/update-complete.ts +++ b/src/commands/storage/file/update-complete.ts @@ -9,7 +9,14 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class FileUpdateComplete extends BaseCommand { static description = 'Complete update of a file.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --file-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1: Complete the file creation or update process' + } + ]; + static flags = { "file-id": Flags.string({ char: 'f', description: 'The file id.', required: true }), }; diff --git a/src/commands/storage/file/update-content.ts b/src/commands/storage/file/update-content.ts index 151d4810..48a21a5c 100644 --- a/src/commands/storage/file/update-content.ts +++ b/src/commands/storage/file/update-content.ts @@ -9,7 +9,14 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class UpdateContent extends BaseCommand { static description = 'Update file content.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --file-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1: Get URL to update file content' + } + ]; + static flags = { "file-id": Flags.string({ char: 'f', description: 'The file id.', required: true }), }; diff --git a/src/commands/storage/file/update.ts b/src/commands/storage/file/update.ts index 84ccccfc..a23bdf71 100644 --- a/src/commands/storage/file/update.ts +++ b/src/commands/storage/file/update.ts @@ -9,7 +9,18 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class UpdateCommand extends BaseCommand { static description = "Update the metadata of a file in an iTwin's storage, such as display name or description."; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --file-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --name "Updated Design File"`, + description: 'Example 1: Update file display name' + }, + { + command: `<%= config.bin %> <%= command.id %> --file-id c9f2b8a5-345d-4cfa-b3e5-123456789abc --name "New Model File" --description "Updated model with new specifications"`, + description: 'Example 2: Update file description and display name' + } + ]; + static flags = { description: Flags.string({ char: 'd', description: "A description for the file." }), "file-id": Flags.string({ char: 'f', description: "The ID of the file to be updated.", required: true }), diff --git a/src/commands/storage/file/upload.ts b/src/commands/storage/file/upload.ts index 16d38d10..9cccacc9 100644 --- a/src/commands/storage/file/upload.ts +++ b/src/commands/storage/file/upload.ts @@ -10,7 +10,18 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class FileUpload extends BaseCommand { static description = 'Upload a new file.'; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --upload-url https://example.com/upload-url --file-path /path/to/your/file.pdf`, + description: 'Example 1: Upload a PDF file to the storage' + }, + { + command: `<%= config.bin %> <%= command.id %> --upload-url https://example.com/image-upload-url --file-path /path/to/your/image.jpg`, + description: 'Example 2: Upload an image file to the storage' + } + ]; + static flags = { "file-path": Flags.string({ char: 'f', description: 'The path to the file.', required: true }), "upload-url": Flags.string({ char: 'u', description: 'The url for the file to be uploaded to.', required: true }), diff --git a/src/commands/storage/folder/create.ts b/src/commands/storage/folder/create.ts index f366ec15..0314f1ce 100644 --- a/src/commands/storage/folder/create.ts +++ b/src/commands/storage/folder/create.ts @@ -9,7 +9,19 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class CreateFolder extends BaseCommand { static description = "Create a new folder in a specified parent folder in iTwin's storage."; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --parent-folder-id ROOT_FOLDER_ID_HERE --name "Project Documents" --description "Folder for all project-related documents"`, + description: `Example 1: Create a folder inside the root folder with a description + Note: You can retrieve the root folder ID using the 'itp storage root-folder' command.` + }, + { + command: `<%= config.bin %> <%= command.id %> --parent-folder-id b2c3d4e5-6789-01ab-cdef-2345678901bc --name "Design Files"`, + description: 'Example 2: Create a subfolder inside an existing folder' + } + ]; + static flags = { description: Flags.string({ char: 'd', description: "A description of the folder." }), name: Flags.string({ char: 'n', description: "The display name of the folder to be created.", required: true }), diff --git a/src/commands/storage/folder/delete.ts b/src/commands/storage/folder/delete.ts index a8b1156d..add04206 100644 --- a/src/commands/storage/folder/delete.ts +++ b/src/commands/storage/folder/delete.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class DeleteFolder extends BaseCommand { static description = "Delete a folder from an iTwin's storage."; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --folder-id a1b2c3d4-5678-90ab-cdef-1234567890ab` + ]; + static flags = { "folder-id": Flags.string({ char: 'f', description: "The ID of the folder to be deleted.", required: true }), }; diff --git a/src/commands/storage/folder/info.ts b/src/commands/storage/folder/info.ts index 3c752c93..7692f8b1 100644 --- a/src/commands/storage/folder/info.ts +++ b/src/commands/storage/folder/info.ts @@ -9,7 +9,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class FolderInfo extends BaseCommand { static description = "Retrieve metadata for a specific folder in an iTwin's storage."; - + + static examples = [ + `<%= config.bin %> <%= command.id %> --folder-id a1b2c3d4-5678-90ab-cdef-1234567890ab` + ]; + static flags = { "folder-id": Flags.string({ char: 'f', description: "The ID of the folder to retrieve information about.", required: true }), }; diff --git a/src/commands/storage/folder/list.ts b/src/commands/storage/folder/list.ts index 24fbd3aa..fbad3d2b 100644 --- a/src/commands/storage/folder/list.ts +++ b/src/commands/storage/folder/list.ts @@ -9,7 +9,18 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ListFolders extends BaseCommand { static description = "List folders in a parent folder of an iTwin's storage. Optionally, include files in the result."; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --folder-id a1b2c3d4-5678-90ab-cdef-1234567890ab`, + description: 'Example 1: List all folders in a parent folder' + }, + { + command: `<%= config.bin %> <%= command.id %> --folder-id a1b2c3d4-5678-90ab-cdef-1234567890ab --include-files true`, + description: 'Example 2: List all folders and files in a parent folder' + } + ]; + static flags = { "folder-id": Flags.string({ char: 'f', description: "The ID of the parent folder whose contents you want to list.", required: true }), "include-files": Flags.boolean({ description: "Whether to include files in the result." }), diff --git a/src/commands/storage/folder/update.ts b/src/commands/storage/folder/update.ts index 9e963072..53849903 100644 --- a/src/commands/storage/folder/update.ts +++ b/src/commands/storage/folder/update.ts @@ -9,7 +9,18 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class UpdateFolder extends BaseCommand { static description = "Update the metadata of a folder in an iTwin's storage, such as its display name or description."; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --folder-id a1b2c3d4-5678-90ab-cdef-1234567890ab --name "Updated Project Documents"`, + description: 'Example 1: Update folder display name' + }, + { + command: `<%= config.bin %> <%= command.id %> --folder-id b2c3d4e5-6789-01ab-cdef-2345678901bc --name "Updated Design Files" --description "Folder containing updated design documents"`, + description: 'Example 2: Update file description and display name' + } + ]; + static flags = { description: Flags.string({ char: 'd', description: "A description for the folder." }), "folder-id": Flags.string({ char: 'f', description: "The ID of the folder to be updated.", required: true }), diff --git a/src/commands/storage/root-folder.ts b/src/commands/storage/root-folder.ts index 1a114c72..2efc50dd 100644 --- a/src/commands/storage/root-folder.ts +++ b/src/commands/storage/root-folder.ts @@ -10,6 +10,10 @@ import BaseCommand from '../../extensions/base-command.js'; export default class GetRootFolder extends BaseCommand { static description = 'Retrieve the top-level folders and files in an iTwin\'s storage.'; + static examples = [ + `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + ]; + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/user/info.ts b/src/commands/user/info.ts index d54004c4..2472f034 100644 --- a/src/commands/user/info.ts +++ b/src/commands/user/info.ts @@ -9,7 +9,14 @@ import BaseCommand from "../../extensions/base-command.js"; export default class UserInfo extends BaseCommand { static description = "Retrieve information about specific users based on their user IDs."; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --user-id user1-id --user-id user2-id --user-id user3-id`, + description: 'Example 1: Retrieve information about specific users by their user IDs' + } + ]; + static flags = { "user-id": Flags.string({ description: "User IDs to retrieve information for.", diff --git a/src/commands/user/search.ts b/src/commands/user/search.ts index 85eade54..b59db27c 100644 --- a/src/commands/user/search.ts +++ b/src/commands/user/search.ts @@ -9,7 +9,18 @@ import BaseCommand from "../../extensions/base-command.js"; export default class UserSearch extends BaseCommand { static description = "Search for users based on filter criteria."; - + + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --search "John Doe"`, + description: 'Example 1: Search for users by a name string' + }, + { + command: `<%= config.bin %> <%= command.id %> --search john.doe@example.com`, + description: 'Example 2: Search for users by email' + } + ]; + static flags = { search: Flags.string({ description: "A string to search for users by name, email, or other attributes.", required: true }), }; From 0e5a3de4e93b1134bb86f805d9c2d3c5e7f50aae Mon Sep 17 00:00:00 2001 From: Karolis Zukauskas Date: Tue, 25 Mar 2025 14:35:24 +0200 Subject: [PATCH 2/2] Improved command example format consistency. --- src/commands/access-control/group/create.ts | 5 ++++- src/commands/access-control/group/delete.ts | 7 +++++-- src/commands/access-control/group/info.ts | 9 ++++++--- src/commands/access-control/group/list.ts | 9 ++++++--- .../access-control/member/group/delete.ts | 9 ++++++--- .../access-control/member/group/info.ts | 9 ++++++--- .../access-control/member/group/list.ts | 5 ++++- .../access-control/member/group/update.ts | 5 ++++- .../access-control/member/invitations.ts | 5 ++++- .../access-control/member/owner/add.ts | 7 +++++-- .../access-control/member/owner/delete.ts | 7 +++++-- .../access-control/member/owner/list.ts | 5 ++++- .../access-control/member/user/delete.ts | 7 +++++-- .../access-control/member/user/info.ts | 7 +++++-- .../access-control/member/user/list.ts | 7 +++++-- .../access-control/member/user/update.ts | 5 ++++- .../access-control/permissions/all.ts | 7 +++++-- src/commands/access-control/permissions/me.ts | 7 +++++-- src/commands/access-control/role/create.ts | 5 ++++- src/commands/access-control/role/delete.ts | 5 ++++- src/commands/access-control/role/info.ts | 5 ++++- src/commands/access-control/role/list.ts | 5 ++++- src/commands/auth/info.ts | 9 ++++++--- src/commands/auth/login.ts | 19 ++++++++++++++----- src/commands/auth/logout.ts | 9 ++++++--- src/commands/changed-elements/changesets.ts | 6 +++--- src/commands/changed-elements/comparison.ts | 4 ++-- src/commands/changed-elements/disable.ts | 5 ++++- src/commands/changed-elements/enable.ts | 5 ++++- src/commands/changed-elements/info.ts | 5 ++++- src/commands/imodel/changeset/info.ts | 5 ++++- src/commands/imodel/connection/auth.ts | 7 +++++-- src/commands/imodel/connection/delete.ts | 5 ++++- src/commands/imodel/connection/info.ts | 5 ++++- src/commands/imodel/connection/run/create.ts | 2 +- src/commands/imodel/connection/run/info.ts | 5 ++++- .../imodel/connection/sourcefile/delete.ts | 5 ++++- .../imodel/connection/sourcefile/info.ts | 5 ++++- .../imodel/connection/sourcefile/update.ts | 5 ++++- src/commands/imodel/delete.ts | 7 +++++-- src/commands/imodel/info.ts | 7 +++++-- src/commands/imodel/named-version/info.ts | 5 ++++- src/commands/imodel/update.ts | 5 ++++- src/commands/itwin/delete.ts | 5 ++++- src/commands/itwin/info.ts | 5 ++++- src/commands/itwin/repository/delete.ts | 5 ++++- src/commands/storage/file/delete.ts | 5 ++++- src/commands/storage/file/info.ts | 5 ++++- src/commands/storage/folder/delete.ts | 5 ++++- src/commands/storage/folder/info.ts | 5 ++++- src/commands/storage/root-folder.ts | 7 +++++-- src/commands/user/me.ts | 9 ++++++--- 52 files changed, 238 insertions(+), 85 deletions(-) diff --git a/src/commands/access-control/group/create.ts b/src/commands/access-control/group/create.ts index 84c121c1..36445c0f 100644 --- a/src/commands/access-control/group/create.ts +++ b/src/commands/access-control/group/create.ts @@ -11,7 +11,10 @@ export default class CreateAccessControlGroup extends BaseCommand { static description = 'Create a new group for an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Engineering Team" --description "Group handling engineering tasks"` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Engineering Team" --description "Group handling engineering tasks"`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/group/delete.ts b/src/commands/access-control/group/delete.ts index eaae5595..77fa3ab1 100644 --- a/src/commands/access-control/group/delete.ts +++ b/src/commands/access-control/group/delete.ts @@ -9,9 +9,12 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class DeleteAccessControlGroup extends BaseCommand { static description = 'Delete an existing group from an iTwin.'; - + static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/group/info.ts b/src/commands/access-control/group/info.ts index dde398c6..808361c6 100644 --- a/src/commands/access-control/group/info.ts +++ b/src/commands/access-control/group/info.ts @@ -9,11 +9,14 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class AccessControlGroupInfo extends BaseCommand { static description = 'Retrieve details about a specific group in an iTwin.'; - + static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1:' + } ]; - + static flags = { "group-id": Flags.string({ char: 'g', diff --git a/src/commands/access-control/group/list.ts b/src/commands/access-control/group/list.ts index ead3f6f0..286a695c 100644 --- a/src/commands/access-control/group/list.ts +++ b/src/commands/access-control/group/list.ts @@ -9,11 +9,14 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ListAccessControlGroups extends BaseCommand { static description = 'List all groups for a specific iTwin.'; - + static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1:' + } ]; - + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/member/group/delete.ts b/src/commands/access-control/member/group/delete.ts index 6fcec94f..9852c2e0 100644 --- a/src/commands/access-control/member/group/delete.ts +++ b/src/commands/access-control/member/group/delete.ts @@ -11,9 +11,12 @@ export default class DeleteGroupMember extends BaseCommand { static description = 'Remove a group from an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id` - ]; - + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id`, + description: 'Example 1:' + } + ]; + static flags = { "group-id": Flags.string({ char: 'g', diff --git a/src/commands/access-control/member/group/info.ts b/src/commands/access-control/member/group/info.ts index 2ddadb6d..b6132b8e 100644 --- a/src/commands/access-control/member/group/info.ts +++ b/src/commands/access-control/member/group/info.ts @@ -11,9 +11,12 @@ export default class InfoGroupMember extends BaseCommand { static description = 'Retrieve details about a specific group member in an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id` - ]; - + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id`, + description: 'Example 1:' + } + ]; + static flags = { "group-id": Flags.string({ char: 'g', diff --git a/src/commands/access-control/member/group/list.ts b/src/commands/access-control/member/group/list.ts index f7b130e3..c5805af2 100644 --- a/src/commands/access-control/member/group/list.ts +++ b/src/commands/access-control/member/group/list.ts @@ -11,7 +11,10 @@ export default class ListGroupMembers extends BaseCommand { static description = 'List all group members of an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/member/group/update.ts b/src/commands/access-control/member/group/update.ts index 17e2428f..8e587ac1 100644 --- a/src/commands/access-control/member/group/update.ts +++ b/src/commands/access-control/member/group/update.ts @@ -11,7 +11,10 @@ export default class UpdateGroupMember extends BaseCommand { static description = 'Update the role assignments for a group in an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id --role-ids role1-id --role-ids role2-id` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --group-id group1-id --role-ids role1-id --role-ids role2-id`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/member/invitations.ts b/src/commands/access-control/member/invitations.ts index 1b12a5b2..5220d2a3 100644 --- a/src/commands/access-control/member/invitations.ts +++ b/src/commands/access-control/member/invitations.ts @@ -11,7 +11,10 @@ export default class AccessControlMemberInvitations extends BaseCommand { static description = "Retrieve the list of pending invitations for an iTwin's members."; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/member/owner/add.ts b/src/commands/access-control/member/owner/add.ts index 9bea328a..f73fbeb7 100644 --- a/src/commands/access-control/member/owner/add.ts +++ b/src/commands/access-control/member/owner/add.ts @@ -11,9 +11,12 @@ export default class AddOwner extends BaseCommand { static description = 'Add a new owner to an iTwin by email.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --email john.owner@example.com` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --email john.owner@example.com`, + description: 'Example 1:' + } ]; - + static flags = { email: Flags.string({ description: 'The email address of the new owner.', diff --git a/src/commands/access-control/member/owner/delete.ts b/src/commands/access-control/member/owner/delete.ts index 1dcfb38e..a3b0d701 100644 --- a/src/commands/access-control/member/owner/delete.ts +++ b/src/commands/access-control/member/owner/delete.ts @@ -11,9 +11,12 @@ export default class DeleteOwner extends BaseCommand { static description = 'Remove an owner from an iTwin by their member ID.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id`, + description: 'Example 1:' + } ]; - + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/member/owner/list.ts b/src/commands/access-control/member/owner/list.ts index 47b41171..fbab96a9 100644 --- a/src/commands/access-control/member/owner/list.ts +++ b/src/commands/access-control/member/owner/list.ts @@ -11,7 +11,10 @@ export default class ListOwners extends BaseCommand { static description = 'List all owners of a specific iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/member/user/delete.ts b/src/commands/access-control/member/user/delete.ts index 7369b451..649c3858 100644 --- a/src/commands/access-control/member/user/delete.ts +++ b/src/commands/access-control/member/user/delete.ts @@ -11,9 +11,12 @@ export default class DeleteUserMember extends BaseCommand { static description = 'Remove a user from an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id`, + description: 'Example 1:' + } ]; - + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/member/user/info.ts b/src/commands/access-control/member/user/info.ts index 44a5f433..c13be359 100644 --- a/src/commands/access-control/member/user/info.ts +++ b/src/commands/access-control/member/user/info.ts @@ -11,9 +11,12 @@ export default class InfoUserMember extends BaseCommand { static description = 'Retrieve details about a specific user member in an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id`, + description: 'Example 1:' + } ]; - + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/member/user/list.ts b/src/commands/access-control/member/user/list.ts index 9aa3d8ec..6331e91c 100644 --- a/src/commands/access-control/member/user/list.ts +++ b/src/commands/access-control/member/user/list.ts @@ -11,9 +11,12 @@ export default class ListUserMembers extends BaseCommand { static description = 'Retrieve details about a specific user member in an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1:' + } ]; - + static flags = { "itwin-id": Flags.string({ char: 'i', diff --git a/src/commands/access-control/member/user/update.ts b/src/commands/access-control/member/user/update.ts index 28f665d1..1157f609 100644 --- a/src/commands/access-control/member/user/update.ts +++ b/src/commands/access-control/member/user/update.ts @@ -11,7 +11,10 @@ export default class UpdateUserMember extends BaseCommand { static description = 'Update the role assignments for a user in an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id --role-ids role1-id --role-ids role2-id` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --member-id user1-id --role-ids role1-id --role-ids role2-id`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/permissions/all.ts b/src/commands/access-control/permissions/all.ts index a89740f7..e6ace5e0 100644 --- a/src/commands/access-control/permissions/all.ts +++ b/src/commands/access-control/permissions/all.ts @@ -9,9 +9,12 @@ export default class ListAllPermissions extends BaseCommand { static description = 'List all iTwin permissions.'; static examples = [ - `<%= config.bin %> <%= command.id %>` + { + command: `<%= config.bin %> <%= command.id %>`, + description: 'Example 1:' + } ]; - + async run() { await this.parse(ListAllPermissions); diff --git a/src/commands/access-control/permissions/me.ts b/src/commands/access-control/permissions/me.ts index d3e4b690..c16de3ce 100644 --- a/src/commands/access-control/permissions/me.ts +++ b/src/commands/access-control/permissions/me.ts @@ -10,8 +10,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class MyPermissions extends BaseCommand { static description = 'Retrieve a list of your permissions on a specified iTwin.'; - static examples = [ - `<%= config.bin %> <%= command.id %>` + static examples = [ + { + command: `<%= config.bin %> <%= command.id %>`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/role/create.ts b/src/commands/access-control/role/create.ts index 6bf15a89..b9fd4acc 100644 --- a/src/commands/access-control/role/create.ts +++ b/src/commands/access-control/role/create.ts @@ -11,7 +11,10 @@ export default class CreateRole extends BaseCommand { static description = 'Create a new role for an iTwin. To assign permissions after creation, use itp access-control role update.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Project Manager" --description "Manages all aspects of the project"` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --name "Project Manager" --description "Manages all aspects of the project"`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/role/delete.ts b/src/commands/access-control/role/delete.ts index 2b7400ab..34dd40db 100644 --- a/src/commands/access-control/role/delete.ts +++ b/src/commands/access-control/role/delete.ts @@ -11,7 +11,10 @@ export default class DeleteRole extends BaseCommand { static description = 'Delete an existing role from an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --role-id role1-id` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --role-id role1-id`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/role/info.ts b/src/commands/access-control/role/info.ts index 1f4a2e39..75db3daf 100644 --- a/src/commands/access-control/role/info.ts +++ b/src/commands/access-control/role/info.ts @@ -11,7 +11,10 @@ export default class InfoRole extends BaseCommand { static description = 'Retrieve details about a specific role in an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --role-id role1-id` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --role-id role1-id`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/access-control/role/list.ts b/src/commands/access-control/role/list.ts index 3007f350..7f576d2b 100644 --- a/src/commands/access-control/role/list.ts +++ b/src/commands/access-control/role/list.ts @@ -11,7 +11,10 @@ export default class ListRoles extends BaseCommand { static description = 'List all roles for a specific iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/auth/info.ts b/src/commands/auth/info.ts index fd5b60f3..594391ba 100644 --- a/src/commands/auth/info.ts +++ b/src/commands/auth/info.ts @@ -10,9 +10,12 @@ export default class Info extends BaseCommand { static description = 'Display authentication information. This command access current authentication storage and returns cached information about the current auth profile.' - static examples = [ - `<%= config.bin %> <%= command.id %>`, - ] + static examples = [ + { + command: `<%= config.bin %> <%= command.id %>`, + description: 'Example 1:' + } + ]; static flags = {} diff --git a/src/commands/auth/login.ts b/src/commands/auth/login.ts index 1f360f89..a8a75f07 100644 --- a/src/commands/auth/login.ts +++ b/src/commands/auth/login.ts @@ -12,11 +12,20 @@ export default class Login extends BaseCommand { static description = 'Authenticate itp with Bentley. This command initiates the login process to obtain the necessary authentication tokens.' - static examples = [ - `<%= config.bin %> <%= command.id %>`, - `<%= config.bin %> <%= command.id %> --client-id native-a1254s86d4a5s4d`, - `<%= config.bin %> <%= command.id %> --client-id service-a1254s86d4a5s4d --client-secret a456a7s89da46s5f4a6f16a5sdf3as2d1f65a4sdf13`, - ] + static examples = [ + { + command: `<%= config.bin %> <%= command.id %>`, + description: 'Example 1:' + }, + { + command: `<%= config.bin %> <%= command.id %> --client-id native-a1254s86d4a5s4d`, + description: 'Example 2:' + }, + { + command: `<%= config.bin %> <%= command.id %> --client-id service-a1254s86d4a5s4d --client-secret a456a7s89da46s5f4a6f16a5sdf3as2d1f65a4sdf13`, + description: 'Example 3:' + } + ]; static flags = { "client-id": Flags.string({ diff --git a/src/commands/auth/logout.ts b/src/commands/auth/logout.ts index 4eaf0f69..642b7c89 100644 --- a/src/commands/auth/logout.ts +++ b/src/commands/auth/logout.ts @@ -10,9 +10,12 @@ export default class Logout extends BaseCommand { static description = 'Log out of the Bentley authentication session. This command clears the current authentication tokens and configuration.' - static examples = [ - `<%= config.bin %> <%= command.id %>`, - ] + static examples = [ + { + command: `<%= config.bin %> <%= command.id %>`, + description: 'Example 1:' + } + ]; static flags = {} diff --git a/src/commands/changed-elements/changesets.ts b/src/commands/changed-elements/changesets.ts index 77090a4e..4d5fce18 100644 --- a/src/commands/changed-elements/changesets.ts +++ b/src/commands/changed-elements/changesets.ts @@ -12,15 +12,15 @@ export default class GetChangesetStatus extends BaseCommand { static examples = [ { - command: '<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --top 10', + command: `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --top 10`, description: 'Example 1: Retrieve the processing status of the first 10 changesets for a specific iModel' }, { - command: '<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --skip 5 --top 10', + command: `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --skip 5 --top 10`, description: 'Example 2: Skip the first 5 changesets and return the next set' }, { - command: '<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51', + command: `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, description: 'Example 3: Retrieve all changesets for a specific iModel' } ]; diff --git a/src/commands/changed-elements/comparison.ts b/src/commands/changed-elements/comparison.ts index be2e6697..6ab26897 100644 --- a/src/commands/changed-elements/comparison.ts +++ b/src/commands/changed-elements/comparison.ts @@ -12,11 +12,11 @@ export default class ChangedElementsComparison extends BaseCommand { static examples = [ { - command: '<%= config.bin %> <%= command.id %> --itwin-id 89337c07-ab59-4080-81cc-5e237be55369 --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id1 2f3b4a8c92d747d5c8a8b2f9cde6742e5d74b3b5 --changeset-id2 4b8a5d9e8d534a71b02894f2a2b4e91d', + command: `<%= config.bin %> <%= command.id %> --itwin-id 89337c07-ab59-4080-81cc-5e237be55369 --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id1 2f3b4a8c92d747d5c8a8b2f9cde6742e5d74b3b5 --changeset-id2 4b8a5d9e8d534a71b02894f2a2b4e91d`, description: 'Example 1: Compare two changesets in an iModel' }, { - command: '<%= config.bin %> <%= command.id %> --itwin-id 89337c07-ab59-4080-81cc-5e237be55369 --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id1 5d9e8b2f6744a71b02894f1a2b4e91d7 --changeset-id2 6b8e4f7a7348a81b93754c2d5d8f7e12', + command: `<%= config.bin %> <%= command.id %> --itwin-id 89337c07-ab59-4080-81cc-5e237be55369 --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id1 5d9e8b2f6744a71b02894f1a2b4e91d7 --changeset-id2 6b8e4f7a7348a81b93754c2d5d8f7e12`, description: 'Example 2: Comparing another set of changesets in the same iModel' } ]; diff --git a/src/commands/changed-elements/disable.ts b/src/commands/changed-elements/disable.ts index 4134881b..7c8e9767 100644 --- a/src/commands/changed-elements/disable.ts +++ b/src/commands/changed-elements/disable.ts @@ -11,7 +11,10 @@ export default class ChangedElementsDisable extends BaseCommand { static description = "Disable change tracking for a specified iModel."; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/changed-elements/enable.ts b/src/commands/changed-elements/enable.ts index 3dd3d813..765ad26b 100644 --- a/src/commands/changed-elements/enable.ts +++ b/src/commands/changed-elements/enable.ts @@ -11,7 +11,10 @@ export default class ChangedElementsEnable extends BaseCommand { static description = "Enable change tracking for a specified iModel."; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/changed-elements/info.ts b/src/commands/changed-elements/info.ts index 634dfd41..1fde24e0 100644 --- a/src/commands/changed-elements/info.ts +++ b/src/commands/changed-elements/info.ts @@ -11,7 +11,10 @@ export default class ChangedElementsInfo extends BaseCommand { static description = "Retrieve change tracking information for a specified iModel."; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id 1a2b3c4d-5678-90ab-cdef-1234567890ab --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/changeset/info.ts b/src/commands/imodel/changeset/info.ts index 17d9f858..13c8ab02 100644 --- a/src/commands/imodel/changeset/info.ts +++ b/src/commands/imodel/changeset/info.ts @@ -11,7 +11,10 @@ export default class ChangesetInfo extends BaseCommand { static description = 'Retrieve details about a specific changeset of an iModel.'; static examples = [ - `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id 2f3b4a8c92d747d5c8a8b2f9cde6742e5d74b3b5` + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --changeset-id 2f3b4a8c92d747d5c8a8b2f9cde6742e5d74b3b5`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/connection/auth.ts b/src/commands/imodel/connection/auth.ts index db4b0c83..31084be4 100644 --- a/src/commands/imodel/connection/auth.ts +++ b/src/commands/imodel/connection/auth.ts @@ -13,8 +13,11 @@ import BaseCommand from "../../../extensions/base-command.js"; export default class ConnectionAuth extends BaseCommand { static description = 'Authenticate connector for user'; - static examples = [ - `<%= config.bin %> <%= command.id %>` + static examples = [ + { + command: `<%= config.bin %> <%= command.id %>`, + description: 'Example 1:' + } ]; async run() { diff --git a/src/commands/imodel/connection/delete.ts b/src/commands/imodel/connection/delete.ts index e9998c33..708efa3d 100644 --- a/src/commands/imodel/connection/delete.ts +++ b/src/commands/imodel/connection/delete.ts @@ -11,7 +11,10 @@ export default class DeleteConnection extends BaseCommand { static description = 'Delete a storage connection from an iModel.'; static examples = [ - `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/connection/info.ts b/src/commands/imodel/connection/info.ts index 0ba1f48c..b5e97e33 100644 --- a/src/commands/imodel/connection/info.ts +++ b/src/commands/imodel/connection/info.ts @@ -11,7 +11,10 @@ export default class ConnectionInfo extends BaseCommand { static description = 'Get connector info.'; static examples = [ - `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/connection/run/create.ts b/src/commands/imodel/connection/run/create.ts index e19a73ce..eec52d06 100644 --- a/src/commands/imodel/connection/run/create.ts +++ b/src/commands/imodel/connection/run/create.ts @@ -12,7 +12,7 @@ export default class CreateConnectionRun extends BaseCommand { static examples = [ { - command: '<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42', + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, description: 'Example 1: Running a storage connection for an iModel' } ]; diff --git a/src/commands/imodel/connection/run/info.ts b/src/commands/imodel/connection/run/info.ts index 73dc7ee4..4b2b6a67 100644 --- a/src/commands/imodel/connection/run/info.ts +++ b/src/commands/imodel/connection/run/info.ts @@ -11,7 +11,10 @@ export default class ConnectionRunInfo extends BaseCommand { static description = 'Get connector run info.'; static examples = [ - `<%= config.bin %> <%= command.id %> --connection-id abc12345-6789-4321-abcd-9876543210ef --connection-run-id run98765-4321-abcd-1234-567890abcdef` + { + command: `<%= config.bin %> <%= command.id %> --connection-id abc12345-6789-4321-abcd-9876543210ef --connection-run-id run98765-4321-abcd-1234-567890abcdef`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/connection/sourcefile/delete.ts b/src/commands/imodel/connection/sourcefile/delete.ts index 68e6a7a3..f2caeba5 100644 --- a/src/commands/imodel/connection/sourcefile/delete.ts +++ b/src/commands/imodel/connection/sourcefile/delete.ts @@ -11,7 +11,10 @@ export default class ConnectionSourceFileDelete extends BaseCommand { static description = 'Remove a source file from a storage connection of an iModel.'; static examples = [ - `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --source-file-id 297c8ab9-53a3-4fe5-adf8-79b4c1a95cbb` + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --source-file-id 297c8ab9-53a3-4fe5-adf8-79b4c1a95cbb`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/connection/sourcefile/info.ts b/src/commands/imodel/connection/sourcefile/info.ts index 6d394a2e..2add6d9c 100644 --- a/src/commands/imodel/connection/sourcefile/info.ts +++ b/src/commands/imodel/connection/sourcefile/info.ts @@ -11,7 +11,10 @@ export default class ConnectionSourceFileInfo extends BaseCommand { static description = 'Retrieve details about a specific source file in a storage connection of an iModel.'; static examples = [ - `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --source-file-id 297c8ab9-53a3-4fe5-adf8-79b4c1a95cbb` + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --source-file-id 297c8ab9-53a3-4fe5-adf8-79b4c1a95cbb`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/connection/sourcefile/update.ts b/src/commands/imodel/connection/sourcefile/update.ts index eeee355d..f77bda9d 100644 --- a/src/commands/imodel/connection/sourcefile/update.ts +++ b/src/commands/imodel/connection/sourcefile/update.ts @@ -12,7 +12,10 @@ export default class ConnectionSourceFileUpdate extends BaseCommand { static description = 'Update an existing source file in a storage connection of an iModel.'; static examples = [ - `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --source-file-id 297c8ab9-53a3-4fe5-adf8-79b4c1a95cbb --connector-type DWG` + { + command: `<%= config.bin %> <%= command.id %> --connection-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42 --source-file-id 297c8ab9-53a3-4fe5-adf8-79b4c1a95cbb --connector-type DWG`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/delete.ts b/src/commands/imodel/delete.ts index bc4b99c0..0b21dd68 100644 --- a/src/commands/imodel/delete.ts +++ b/src/commands/imodel/delete.ts @@ -10,8 +10,11 @@ import BaseCommand from "../../extensions/base-command.js"; export default class DeleteIModel extends BaseCommand { static description = 'Delete an existing iModel.'; - static examples = [ - `<%= config.bin %> <%= command.id %> --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee7d` + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee7d`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/info.ts b/src/commands/imodel/info.ts index d544b13c..67193f51 100644 --- a/src/commands/imodel/info.ts +++ b/src/commands/imodel/info.ts @@ -10,8 +10,11 @@ import BaseCommand from "../../extensions/base-command.js"; export class IModelInfo extends BaseCommand { static description = 'Retrieve metadata for the specified Model'; - static examples = [ - `<%= config.bin %> <%= command.id %> --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee7d` + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee7d`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/named-version/info.ts b/src/commands/imodel/named-version/info.ts index b63478b4..1e82bf5a 100644 --- a/src/commands/imodel/named-version/info.ts +++ b/src/commands/imodel/named-version/info.ts @@ -11,7 +11,10 @@ export default class NamedVersionInfo extends BaseCommand { static description = 'Retrieve details about a specific named version in an iModel.'; static examples = [ - `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --named-version-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + { + command: `<%= config.bin %> <%= command.id %> --imodel-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --named-version-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/imodel/update.ts b/src/commands/imodel/update.ts index 1f61d5f3..41df7fc6 100644 --- a/src/commands/imodel/update.ts +++ b/src/commands/imodel/update.ts @@ -12,7 +12,10 @@ export default class UpdateCommand extends BaseCommand { static description = 'Update an iModel in an iTwin'; static examples = [ - `<%= config.bin %> <%= command.id %> --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee7d --name "Updated Sun City Renewable-energy Plant" --description "Updated overall model of wind and solar farms in Sun City" --extent '{ "southWest": { "latitude": 46.13267702834806, "longitude": 7.672120009938448 }, "northEast": { "latitude": 46.302763954781234, "longitude": 7.835541640797823 }}'` + { + command: `<%= config.bin %> <%= command.id %> --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee7d --name "Updated Sun City Renewable-energy Plant" --description "Updated overall model of wind and solar farms in Sun City" --extent '{ "southWest": { "latitude": 46.13267702834806, "longitude": 7.672120009938448 }, "northEast": { "latitude": 46.302763954781234, "longitude": 7.835541640797823 }}'`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/itwin/delete.ts b/src/commands/itwin/delete.ts index a381162b..10ef83e0 100644 --- a/src/commands/itwin/delete.ts +++ b/src/commands/itwin/delete.ts @@ -11,7 +11,10 @@ export default class DeleteITwin extends BaseCommand { static description = 'Delete an iTwin'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id b1a2c3d4-5678-90ab-cdef-1234567890ab` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id b1a2c3d4-5678-90ab-cdef-1234567890ab`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/itwin/info.ts b/src/commands/itwin/info.ts index 7b02a501..8c41476b 100644 --- a/src/commands/itwin/info.ts +++ b/src/commands/itwin/info.ts @@ -11,7 +11,10 @@ export default class ITwinInfo extends BaseCommand { static description = 'Retrieve metadata for the specified iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id b1a2c3d4-5678-90ab-cdef-1234567890ab` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id b1a2c3d4-5678-90ab-cdef-1234567890ab`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/itwin/repository/delete.ts b/src/commands/itwin/repository/delete.ts index 505abf49..185b80ef 100644 --- a/src/commands/itwin/repository/delete.ts +++ b/src/commands/itwin/repository/delete.ts @@ -11,7 +11,10 @@ export default class DeleteRepository extends BaseCommand { static description = 'Delete a specified repository from an iTwin.'; static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --repository-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51 --repository-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/storage/file/delete.ts b/src/commands/storage/file/delete.ts index 3288c5be..36a04f28 100644 --- a/src/commands/storage/file/delete.ts +++ b/src/commands/storage/file/delete.ts @@ -11,7 +11,10 @@ export default class DeleteFile extends BaseCommand { static description = "Delete a file from an iTwin's storage."; static examples = [ - `<%= config.bin %> <%= command.id %> --file-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + { + command: `<%= config.bin %> <%= command.id %> --file-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/storage/file/info.ts b/src/commands/storage/file/info.ts index 5bd0fabc..9eb2d958 100644 --- a/src/commands/storage/file/info.ts +++ b/src/commands/storage/file/info.ts @@ -11,7 +11,10 @@ export default class FileInfo extends BaseCommand { static description = "Retrieve metadata for a specific file in an iTwin's storage."; static examples = [ - `<%= config.bin %> <%= command.id %> --file-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42` + { + command: `<%= config.bin %> <%= command.id %> --file-id bf4d8b36-25d7-4b72-b38b-12c1f0325f42`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/storage/folder/delete.ts b/src/commands/storage/folder/delete.ts index add04206..9dd71c71 100644 --- a/src/commands/storage/folder/delete.ts +++ b/src/commands/storage/folder/delete.ts @@ -11,7 +11,10 @@ export default class DeleteFolder extends BaseCommand { static description = "Delete a folder from an iTwin's storage."; static examples = [ - `<%= config.bin %> <%= command.id %> --folder-id a1b2c3d4-5678-90ab-cdef-1234567890ab` + { + command: `<%= config.bin %> <%= command.id %> --folder-id a1b2c3d4-5678-90ab-cdef-1234567890ab`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/storage/folder/info.ts b/src/commands/storage/folder/info.ts index 7692f8b1..0d91c950 100644 --- a/src/commands/storage/folder/info.ts +++ b/src/commands/storage/folder/info.ts @@ -11,7 +11,10 @@ export default class FolderInfo extends BaseCommand { static description = "Retrieve metadata for a specific folder in an iTwin's storage."; static examples = [ - `<%= config.bin %> <%= command.id %> --folder-id a1b2c3d4-5678-90ab-cdef-1234567890ab` + { + command: `<%= config.bin %> <%= command.id %> --folder-id a1b2c3d4-5678-90ab-cdef-1234567890ab`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/storage/root-folder.ts b/src/commands/storage/root-folder.ts index 2efc50dd..450a1fb3 100644 --- a/src/commands/storage/root-folder.ts +++ b/src/commands/storage/root-folder.ts @@ -10,8 +10,11 @@ import BaseCommand from '../../extensions/base-command.js'; export default class GetRootFolder extends BaseCommand { static description = 'Retrieve the top-level folders and files in an iTwin\'s storage.'; - static examples = [ - `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51` + static examples = [ + { + command: `<%= config.bin %> <%= command.id %> --itwin-id ad0ba809-9241-48ad-9eb0-c8038c1a1d51`, + description: 'Example 1:' + } ]; static flags = { diff --git a/src/commands/user/me.ts b/src/commands/user/me.ts index 85b48e98..185d7468 100644 --- a/src/commands/user/me.ts +++ b/src/commands/user/me.ts @@ -10,9 +10,12 @@ export default class Me extends BaseCommand { static description = 'Retrieve information about the currently authenticated user.' - static examples = [ - `<%= config.bin %> <%= command.id %>`, - ] + static examples = [ + { + command: `<%= config.bin %> <%= command.id %>`, + description: 'Example 1:' + } + ]; static flags = {}