Skip to content

Commit 1701495

Browse files
authored
Merge pull request #68 from salesforcecli/ew/add-alias-commands
Alias commands
2 parents 03b507c + cff4e6d commit 1701495

31 files changed

+1905
-590
lines changed

.github/workflows/notify-slack-on-pr-open.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Notify Slack on PR open
12-
env:
13-
WEBHOOK_URL : ${{ secrets.CLI_TEAM_SLACK_WEBHOOK_URL }}
14-
PULL_REQUEST_AUTHOR_ICON_URL : ${{ github.event.pull_request.user.avatar_url }}
15-
PULL_REQUEST_AUTHOR_NAME : ${{ github.event.pull_request.user.login }}
16-
PULL_REQUEST_AUTHOR_PROFILE_URL: ${{ github.event.pull_request.user.html_url }}
17-
PULL_REQUEST_BASE_BRANCH_NAME : ${{ github.event.pull_request.base.ref }}
18-
PULL_REQUEST_COMPARE_BRANCH_NAME : ${{ github.event.pull_request.head.ref }}
19-
PULL_REQUEST_NUMBER : ${{ github.event.pull_request.number }}
20-
PULL_REQUEST_REPO: ${{ github.event.pull_request.head.repo.name }}
21-
PULL_REQUEST_TITLE : ${{ github.event.pull_request.title }}
22-
PULL_REQUEST_URL : ${{ github.event.pull_request.html_url }}
23-
uses: salesforcecli/github-workflows/.github/actions/prNotification@main
11+
- name: Notify Slack on PR open
12+
env:
13+
WEBHOOK_URL: ${{ secrets.CLI_TEAM_SLACK_WEBHOOK_URL }}
14+
PULL_REQUEST_AUTHOR_ICON_URL: ${{ github.event.pull_request.user.avatar_url }}
15+
PULL_REQUEST_AUTHOR_NAME: ${{ github.event.pull_request.user.login }}
16+
PULL_REQUEST_AUTHOR_PROFILE_URL: ${{ github.event.pull_request.user.html_url }}
17+
PULL_REQUEST_BASE_BRANCH_NAME: ${{ github.event.pull_request.base.ref }}
18+
PULL_REQUEST_COMPARE_BRANCH_NAME: ${{ github.event.pull_request.head.ref }}
19+
PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
20+
PULL_REQUEST_REPO: ${{ github.event.pull_request.head.repo.name }}
21+
PULL_REQUEST_TITLE: ${{ github.event.pull_request.title }}
22+
PULL_REQUEST_URL: ${{ github.event.pull_request.html_url }}
23+
uses: salesforcecli/github-workflows/.github/actions/prNotification@main

command-snapshot.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
[
2+
{
3+
"command": "alias:list",
4+
"plugin": "@salesforce/plugin-settings",
5+
"flags": ["json"],
6+
"alias": []
7+
},
8+
{
9+
"command": "alias:set",
10+
"plugin": "@salesforce/plugin-settings",
11+
"flags": ["json"],
12+
"alias": []
13+
},
14+
{
15+
"command": "alias:unset",
16+
"plugin": "@salesforce/plugin-settings",
17+
"flags": ["all", "json", "no-prompt"],
18+
"alias": []
19+
},
220
{
321
"command": "config:get",
422
"plugin": "@salesforce/plugin-settings",

messages/alias.list.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# summary
2+
3+
List all aliases currently set on your local computer.
4+
5+
# description
6+
7+
Aliases are global, which means that you can use all the listed aliases in any Salesforce DX project on your computer.
8+
9+
# examples
10+
11+
- List all the aliases you've set:
12+
13+
<%= config.bin %> <%= command.id %>

messages/alias.set.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# summary
2+
3+
Set one or more aliases on your local computer.
4+
5+
# description
6+
7+
Aliases are user-defined short names that make it easier to use the CLI. For example, users often set an alias for a scratch org usernames because they're long and unintuitive. Check the --help of a CLI command to determine where you can use an alias.
8+
9+
You can associate an alias with only one value at a time. If you set an alias multiple times, the alias points to the most recent value. Aliases are global; after you set an alias, you can use it in any Salesforce DX project on your computer.
10+
11+
Use quotes to specify an alias value that contains spaces. You typically use an equal sign to set your alias, although you don't need it if you're setting a single alias in a command.
12+
13+
# examples
14+
15+
- Set an alias for a scratch org username:
16+
17+
<%= config.bin %> <%= command.id %> my-scratch-org=[email protected]
18+
19+
- Set multiple aliases with a single command:
20+
21+
<%= config.bin %> <%= command.id %> my-scratch-org=[email protected] my-other-scratch-org=[email protected]
22+
23+
- Set an alias that contains spaces:
24+
25+
<%= config.bin %> <%= command.id %> my-alias='alias with spaces'
26+
27+
- Set a single alias without using an equal sign:
28+
29+
<%= config.bin %> <%= command.id %> my-scratch-org [email protected]
30+
31+
# error.ArgumentsRequired
32+
33+
You must provide one or more aliases to set. Use the --help flag to see examples.
34+
35+
# error.ValueRequired
36+
37+
You must provide a value when setting an alias. Use `sf alias unset my-alias-name` to remove existing aliases.

messages/alias.unset.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# summary
2+
3+
Unset one or more aliases that are currently set on your local computer.
4+
5+
# description
6+
7+
Aliases are global, so when you unset one it's no longer available in any Salesforce DX project.
8+
9+
# flags.all.summary
10+
11+
Unset all currently set aliases.
12+
13+
# flags.no-prompt.summary
14+
15+
Don't prompt the user for confirmation when unsetting all aliases.
16+
17+
# examples
18+
19+
- Unset an alias:
20+
21+
<%= config.bin %> <%= command.id %> my-alias
22+
23+
- Unset multiple aliases with a single command:
24+
25+
<%= config.bin %> <%= command.id %> my-alias my-other-alias
26+
27+
- Unset all aliases:
28+
29+
<%= config.bin %> <%= command.id %> --all [--no-prompt]
30+
31+
# error.NameRequired
32+
33+
You must provide an alias name when unsetting an alias.
34+
35+
# warning.NoAliasesSet
36+
37+
The `--all` flag was passed, but no aliases are currently set. Exiting.
38+
39+
# prompt.RemoveAllAliases
40+
41+
Are you sure you want to unset all aliases?
File renamed without changes.

messages/list.md renamed to messages/config.list.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ List the configuration variables that you've previously set.
44

55
# description
66

7-
Global configuration variables apply to any directory and are always displayed. If you run this command from a project directory, local configuration variables are also displayed.
7+
Global configuration variables apply to any Salesforce DX project and are always displayed. If you run this command from a project directory, local configuration variables are also displayed.
88

99
# examples
1010

messages/set.md renamed to messages/config.set.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Set one or more configuration variables, such as your default org.
66

77
Use configuration variables to set CLI defaults, such as your default org or the API version you want the CLI to use. For example, if you set the "target-org" configuration variable, you don't need to specify it as a "sf deploy metadata" flag if you're deploying to your default org.
88

9-
Local configuration variables apply only to your current project. Global variables, specified with the --global flag, apply in any directory.
9+
Local configuration variables apply only to your current project. Global variables, specified with the --global flag, apply in any Salesforce DX project.
1010

1111
The resolution order if you've set a flag value in multiple ways is as follows:
1212

@@ -30,18 +30,18 @@ Run "sf config list" to see the configuration variables you've already set and t
3030

3131
<%= config.bin %> <%= command.id %> --global target-org=my-scratch-org
3232

33-
# flags.global.summary
34-
35-
Set the configuration variables globally, so they can be used from any directory.
36-
37-
# error.InvalidArgumentFormat
33+
- Set a single configuration variable without using an equal sign; this syntax doesn't work when setting multiple configuration variables:
3834

39-
Set configuration variables with this format: key=value or key="value with spaces". Use the --help flag to view the available configuration variables.
35+
<%= config.bin %> <%= command.id %> target-org [email protected]
4036

41-
# error.DuplicateArgument
37+
# flags.global.summary
4238

43-
Found duplicate argument %s. You can specify a configuration variable only one time in a single command execution. Remove the duplicate and try again.
39+
Set the configuration variables globally, so they can be used from any Salesforce DX project.
4440

4541
# error.ArgumentsRequired
4642

4743
You must provide one or more configuration variables to set. Use the --help flag to view the available configuration variables.
44+
45+
# error.ValueRequired
46+
47+
You must provide a value when setting a config. Use `sf config unset the-config-name` to unset existing configs.

messages/unset.md renamed to messages/config.unset.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Unset local or global configuration variables.
44

55
# description
66

7-
Local configuration variables apply only to your current project. Global configuration variables apply in any directory.
7+
Local configuration variables apply only to your current project. Global configuration variables apply in any Salesforce DX project.
88

99
# examples
1010

@@ -18,7 +18,7 @@ Local configuration variables apply only to your current project. Global configu
1818

1919
# flags.global.summary
2020

21-
Unset the configuration variables globally, so they can no longer be used from any directory.
21+
Unset the configuration variables globally, so they can no longer be used from any Salesforce DX project.
2222

2323
# error.NoConfigKeysFound
2424

package.json

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@
55
"author": "Salesforce",
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {
8-
"@oclif/core": "^1.16.5",
9-
"@salesforce/core": "^3.30.8",
8+
"@oclif/core": "^1.19.0",
9+
"@salesforce/core": "^3.31.12",
1010
"@salesforce/sf-plugins-core": "^1.15.2",
1111
"tslib": "^2"
1212
},
1313
"devDependencies": {
14-
"@oclif/plugin-command-snapshot": "^3.2.4",
15-
"@oclif/test": "^2.2.3",
14+
"@oclif/plugin-command-snapshot": "^3.2.5",
15+
"@oclif/test": "^2.2.4",
1616
"@salesforce/cli-plugins-testkit": "^3.2.3",
1717
"@salesforce/dev-config": "^3.1.0",
1818
"@salesforce/dev-scripts": "^3.1.0",
19-
"@salesforce/kit": "^1.6.1",
19+
"@salesforce/kit": "^1.7.0",
2020
"@salesforce/plugin-command-reference": "^2.2.8",
2121
"@salesforce/prettier-config": "^0.0.2",
2222
"@salesforce/ts-sinon": "^1.4.0",
23-
"@salesforce/ts-types": "^1.5.20",
23+
"@salesforce/ts-types": "^1.5.21",
2424
"@types/fs-extra": "^9.0.13",
2525
"@types/shelljs": "^0.8.11",
26-
"@typescript-eslint/eslint-plugin": "^5.40.0",
27-
"@typescript-eslint/parser": "^5.40.0",
26+
"@typescript-eslint/eslint-plugin": "^5.40.1",
27+
"@typescript-eslint/parser": "^5.40.1",
2828
"chai": "^4.3.6",
2929
"eslint": "^8.25.0",
3030
"eslint-config-prettier": "^8.5.0",
@@ -33,7 +33,7 @@
3333
"eslint-config-salesforce-typescript": "^1.1.1",
3434
"eslint-plugin-header": "^3.1.1",
3535
"eslint-plugin-import": "^2.26.0",
36-
"eslint-plugin-jsdoc": "^39.3.6",
36+
"eslint-plugin-jsdoc": "^39.3.13",
3737
"eslint-plugin-sf-plugin": "^0.3.0",
3838
"fs-extra": "^10.1.0",
3939
"husky": "^7.0.4",
@@ -87,6 +87,9 @@
8787
"topics": {
8888
"config": {
8989
"description": "Commands to configure Salesforce CLI."
90+
},
91+
"alias": {
92+
"description": "Use the alias commands to manage your aliases."
9093
}
9194
}
9295
},
@@ -110,10 +113,10 @@
110113
"test:command-reference": "./bin/dev commandreference:generate --erroronwarnings",
111114
"test:deprecation-policy": "./bin/dev snapshot:compare",
112115
"test:json-schema": "./bin/dev schema:compare",
113-
"test:nuts": "nyc mocha \"**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
116+
"test:nuts": "nyc mocha \"test/**/*.nut.ts\" --slow 4500 --timeout 600000 --parallel",
114117
"version": "oclif readme"
115118
},
116119
"publishConfig": {
117120
"access": "public"
118121
}
119-
}
122+
}

0 commit comments

Comments
 (0)