Skip to content

Commit f879d99

Browse files
committed
rename config to inspect
1 parent 09c2e98 commit f879d99

6 files changed

Lines changed: 60 additions & 47 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@salesforce/b2c-cli': patch
3+
---
4+
5+
Rename `setup config` to `setup inspect` to better reflect its read-only purpose. `setup config` continues to work as an alias.

docs/cli/setup.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ description: Commands for viewing configuration, installing AI agent skills, and
66

77
Commands for viewing configuration and setting up the development environment.
88

9-
## b2c setup config
9+
## b2c setup inspect
1010

1111
Display the resolved configuration from all sources, showing which values are set and where they came from. Useful for debugging configuration issues.
1212

13+
**Alias:** `b2c setup config`
14+
1315
### Usage
1416

1517
```bash
16-
b2c setup config [FLAGS]
18+
b2c setup inspect [FLAGS]
1719
```
1820

1921
### Flags
@@ -27,16 +29,16 @@ b2c setup config [FLAGS]
2729

2830
```bash
2931
# Display resolved configuration (sensitive values masked)
30-
b2c setup config
32+
b2c setup inspect
3133

3234
# Display configuration with sensitive values unmasked
33-
b2c setup config --unmask
35+
b2c setup inspect --unmask
3436

3537
# Output as JSON for scripting
36-
b2c setup config --json
38+
b2c setup inspect --json
3739

3840
# Debug configuration with a specific instance
39-
b2c setup config -i staging
41+
b2c setup inspect -i staging
4042
```
4143

4244
### Output

docs/guide/configuration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,17 +332,17 @@ The CLI will try each method in order until one succeeds.
332332

333333
## Debugging Configuration
334334

335-
Use `b2c setup config` to view the resolved configuration and see which source provided each value:
335+
Use `b2c setup inspect` to view the resolved configuration and see which source provided each value:
336336

337337
```bash
338338
# Display resolved configuration (sensitive values masked)
339-
b2c setup config
339+
b2c setup inspect
340340

341341
# Show actual sensitive values
342-
b2c setup config --unmask
342+
b2c setup inspect --unmask
343343

344344
# Output as JSON
345-
b2c setup config --json
345+
b2c setup inspect --json
346346
```
347347

348348
This command helps troubleshoot issues like:
@@ -351,7 +351,7 @@ This command helps troubleshoot issues like:
351351
- Understanding credential source priority
352352
- Identifying hostname mismatch protection triggers
353353

354-
See [setup config](/cli/setup#b2c-setup-config) for full documentation.
354+
See [setup inspect](/cli/setup#b2c-setup-inspect) for full documentation.
355355

356356
## Next Steps
357357

packages/b2c-cli/src/commands/setup/config.ts renamed to packages/b2c-cli/src/commands/setup/inspect.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import {withDocs} from '../../i18n/index.js';
1515
const SENSITIVE_FIELDS = new Set<keyof NormalizedConfig>(['clientSecret', 'mrtApiKey', 'password']);
1616

1717
/**
18-
* JSON output structure for the config command.
18+
* JSON output structure for the inspect command.
1919
*/
20-
interface SetupConfigResponse {
20+
interface SetupInspectResponse {
2121
config: Record<string, unknown>;
2222
sources: ConfigSourceInfo[];
2323
warnings?: string[];
@@ -65,8 +65,10 @@ function getDisplayValue(field: string, value: unknown, unmask: boolean): string
6565
/**
6666
* Command to display resolved configuration.
6767
*/
68-
export default class SetupConfig extends BaseCommand<typeof SetupConfig> {
69-
static description = withDocs('Display resolved configuration', '/cli/setup.html#b2c-setup-config');
68+
export default class SetupInspect extends BaseCommand<typeof SetupInspect> {
69+
static aliases = ['setup:config'];
70+
71+
static description = withDocs('Display resolved configuration', '/cli/setup.html#b2c-setup-inspect');
7072

7173
static enableJsonFlag = true;
7274

@@ -84,7 +86,7 @@ export default class SetupConfig extends BaseCommand<typeof SetupConfig> {
8486
}),
8587
};
8688

87-
async run(): Promise<SetupConfigResponse> {
89+
async run(): Promise<SetupInspectResponse> {
8890
const {values, sources, warnings} = this.resolvedConfig;
8991
const unmask = this.flags.unmask;
9092

@@ -96,7 +98,7 @@ export default class SetupConfig extends BaseCommand<typeof SetupConfig> {
9698
}
9799
}
98100

99-
const result: SetupConfigResponse = {
101+
const result: SetupInspectResponse = {
100102
config: outputConfig,
101103
sources,
102104
warnings: warnings.length > 0 ? warnings.map((w) => w.message) : undefined,

packages/b2c-cli/test/commands/setup/config.test.ts renamed to packages/b2c-cli/test/commands/setup/inspect.test.ts

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import {expect} from 'chai';
88
import sinon from 'sinon';
99

10-
import SetupConfig from '../../../src/commands/setup/config.js';
10+
import SetupInspect from '../../../src/commands/setup/inspect.js';
1111
import {isolateConfig, restoreConfig} from '@salesforce/b2c-tooling-sdk/test-utils';
1212
import {runSilent} from '../../helpers/test-setup.js';
1313
import type {ConfigSourceInfo, NormalizedConfig} from '@salesforce/b2c-tooling-sdk/config';
@@ -52,9 +52,9 @@ function stubResolvedConfig(
5252
}
5353

5454
/**
55-
* Unit tests for setup config command.
55+
* Unit tests for setup inspect command.
5656
*/
57-
describe('setup config', () => {
57+
describe('setup inspect', () => {
5858
beforeEach(() => {
5959
isolateConfig();
6060
});
@@ -66,22 +66,26 @@ describe('setup config', () => {
6666

6767
describe('command structure', () => {
6868
it('should have correct description', () => {
69-
expect(SetupConfig.description).to.be.a('string');
70-
expect(SetupConfig.description).to.include('configuration');
69+
expect(SetupInspect.description).to.be.a('string');
70+
expect(SetupInspect.description).to.include('configuration');
7171
});
7272

7373
it('should enable JSON flag', () => {
74-
expect(SetupConfig.enableJsonFlag).to.be.true;
74+
expect(SetupInspect.enableJsonFlag).to.be.true;
7575
});
7676

7777
it('should have unmask flag', () => {
78-
expect(SetupConfig.flags).to.have.property('unmask');
78+
expect(SetupInspect.flags).to.have.property('unmask');
79+
});
80+
81+
it('should have setup:config alias', () => {
82+
expect(SetupInspect.aliases).to.include('setup:config');
7983
});
8084
});
8185

8286
describe('masking', () => {
8387
it('should mask password by default', async () => {
84-
const command = new SetupConfig([], {} as any);
88+
const command = new SetupInspect([], {} as any);
8589
(command as any).flags = {unmask: false};
8690
stubJsonEnabled(command, true);
8791
stubCommandConfigAndLogger(command);
@@ -97,7 +101,7 @@ describe('setup config', () => {
97101
});
98102

99103
it('should mask clientSecret by default', async () => {
100-
const command = new SetupConfig([], {} as any);
104+
const command = new SetupInspect([], {} as any);
101105
(command as any).flags = {unmask: false};
102106
stubJsonEnabled(command, true);
103107
stubCommandConfigAndLogger(command);
@@ -113,7 +117,7 @@ describe('setup config', () => {
113117
});
114118

115119
it('should mask mrtApiKey by default', async () => {
116-
const command = new SetupConfig([], {} as any);
120+
const command = new SetupInspect([], {} as any);
117121
(command as any).flags = {unmask: false};
118122
stubJsonEnabled(command, true);
119123
stubCommandConfigAndLogger(command);
@@ -129,7 +133,7 @@ describe('setup config', () => {
129133
});
130134

131135
it('should show REDACTED for short secrets', async () => {
132-
const command = new SetupConfig([], {} as any);
136+
const command = new SetupInspect([], {} as any);
133137
(command as any).flags = {unmask: false};
134138
stubJsonEnabled(command, true);
135139
stubCommandConfigAndLogger(command);
@@ -143,7 +147,7 @@ describe('setup config', () => {
143147
});
144148

145149
it('should unmask values when --unmask flag is provided', async () => {
146-
const command = new SetupConfig([], {} as any);
150+
const command = new SetupInspect([], {} as any);
147151
(command as any).flags = {unmask: true};
148152
stubJsonEnabled(command, true);
149153
stubCommandConfigAndLogger(command);
@@ -170,7 +174,7 @@ describe('setup config', () => {
170174

171175
describe('output formatting', () => {
172176
it('should return structured JSON in --json mode', async () => {
173-
const command = new SetupConfig([], {} as any);
177+
const command = new SetupInspect([], {} as any);
174178
(command as any).flags = {unmask: false};
175179
stubJsonEnabled(command, true);
176180
stubCommandConfigAndLogger(command);
@@ -199,7 +203,7 @@ describe('setup config', () => {
199203
});
200204

201205
it('should display warnings if present', async () => {
202-
const command = new SetupConfig([], {} as any);
206+
const command = new SetupInspect([], {} as any);
203207
(command as any).flags = {unmask: false};
204208
stubJsonEnabled(command, true);
205209
stubCommandConfigAndLogger(command);
@@ -216,7 +220,7 @@ describe('setup config', () => {
216220
});
217221

218222
it('should handle empty config gracefully', async () => {
219-
const command = new SetupConfig([], {} as any);
223+
const command = new SetupInspect([], {} as any);
220224
(command as any).flags = {unmask: false};
221225
stubJsonEnabled(command, true);
222226
stubCommandConfigAndLogger(command);
@@ -229,7 +233,7 @@ describe('setup config', () => {
229233
});
230234

231235
it('should handle array values (scopes)', async () => {
232-
const command = new SetupConfig([], {} as any);
236+
const command = new SetupInspect([], {} as any);
233237
(command as any).flags = {unmask: false};
234238
stubJsonEnabled(command, true);
235239
stubCommandConfigAndLogger(command);
@@ -245,7 +249,7 @@ describe('setup config', () => {
245249

246250
describe('source tracking', () => {
247251
it('should track which source provided each field', async () => {
248-
const command = new SetupConfig([], {} as any);
252+
const command = new SetupInspect([], {} as any);
249253
(command as any).flags = {unmask: false};
250254
stubJsonEnabled(command, true);
251255
stubCommandConfigAndLogger(command);
@@ -278,7 +282,7 @@ describe('setup config', () => {
278282
});
279283

280284
it('should handle fieldsIgnored correctly', async () => {
281-
const command = new SetupConfig([], {} as any);
285+
const command = new SetupInspect([], {} as any);
282286
(command as any).flags = {unmask: false};
283287
stubJsonEnabled(command, true);
284288
stubCommandConfigAndLogger(command);
@@ -314,7 +318,7 @@ describe('setup config', () => {
314318

315319
describe('human-readable output', () => {
316320
it('should display formatted info in non-JSON mode', async () => {
317-
const command = new SetupConfig([], {} as any);
321+
const command = new SetupInspect([], {} as any);
318322
(command as any).flags = {unmask: false};
319323
stubJsonEnabled(command, false);
320324
stubCommandConfigAndLogger(command);
@@ -347,7 +351,7 @@ describe('setup config', () => {
347351
});
348352

349353
it('should show unmask warning when --unmask is used', async () => {
350-
const command = new SetupConfig([], {} as any);
354+
const command = new SetupInspect([], {} as any);
351355
(command as any).flags = {unmask: true};
352356
stubJsonEnabled(command, false);
353357
stubCommandConfigAndLogger(command);

skills/b2c-cli/skills/b2c-config/SKILL.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ description: View and debug b2c CLI configuration and understand where credentia
55

66
# B2C Config Skill
77

8-
Use the `b2c setup config` command to view the resolved configuration and understand where each value comes from. This is essential for debugging configuration issues and verifying that the CLI is using the correct settings.
8+
Use the `b2c setup inspect` command to view the resolved configuration and understand where each value comes from. This is essential for debugging configuration issues and verifying that the CLI is using the correct settings.
99

10-
> **Tip:** If `b2c` is not installed globally, use `npx @salesforce/b2c-cli` instead (e.g., `npx @salesforce/b2c-cli setup config`).
10+
> **Tip:** `b2c setup config` still works as an alias. If `b2c` is not installed globally, use `npx @salesforce/b2c-cli` instead (e.g., `npx @salesforce/b2c-cli setup inspect`).
1111
1212
## When to Use
1313

14-
Use `b2c setup config` when you need to:
14+
Use `b2c setup inspect` when you need to:
1515

1616
- Verify which configuration file is being used
1717
- Check if environment variables are being read correctly
@@ -26,33 +26,33 @@ Use `b2c setup config` when you need to:
2626

2727
```bash
2828
# Display resolved configuration (sensitive values masked by default)
29-
b2c setup config
29+
b2c setup inspect
3030

3131
# View configuration for a specific instance from dw.json
32-
b2c setup config -i staging
32+
b2c setup inspect -i staging
3333

3434
# View configuration with a specific config file
35-
b2c setup config --config /path/to/dw.json
35+
b2c setup inspect --config /path/to/dw.json
3636
```
3737

3838
### Debug Sensitive Values
3939

4040
```bash
4141
# Show actual passwords, secrets, and API keys (use with caution)
42-
b2c setup config --unmask
42+
b2c setup inspect --unmask
4343
```
4444

4545
### JSON Output for Scripting
4646

4747
```bash
4848
# Output as JSON for parsing in scripts
49-
b2c setup config --json
49+
b2c setup inspect --json
5050

5151
# Pretty-print with jq
52-
b2c setup config --json | jq '.config'
52+
b2c setup inspect --json | jq '.config'
5353

5454
# Check which sources are loaded
55-
b2c setup config --json | jq '.sources'
55+
b2c setup inspect --json | jq '.sources'
5656
```
5757

5858
## Understanding the Output

0 commit comments

Comments
 (0)