scc-universal 1.2.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,225 @@
1
+ ---
2
+ name: sf-cli-reference
3
+ description: >-
4
+ Use when looking up Salesforce CLI sf commands — org login, project deploy,
5
+ apex run test, data query, package install, scratch org creation.
6
+ Do NOT use for web documentation lookup or Apex code patterns.
7
+ origin: SCC
8
+ user-invocable: true
9
+ ---
10
+
11
+ # SF CLI Command Reference
12
+
13
+ Reference: @../_reference/SF_CLI_COMMANDS.md
14
+
15
+ ## When to Use
16
+
17
+ - When you need to find the right `sf` command for a Salesforce task
18
+ - When constructing CLI commands with correct flags and syntax
19
+ - When choosing between similar commands (e.g., deploy start vs deploy validate)
20
+ - When setting up org authentication (web, jwt, sfdx-url)
21
+ - When running Apex tests or querying data from the command line
22
+ - When managing scratch orgs, packages, or metadata via CLI
23
+
24
+ ---
25
+
26
+ ## Command Decision Tree
27
+
28
+ ### Authenticate to an Org
29
+
30
+ | Scenario | Command | Key Flags |
31
+ |---|---|---|
32
+ | Interactive browser login | `sf org login web` | `--alias`, `--set-default` |
33
+ | CI/CD non-interactive login | `sf org login jwt` | `--client-id`, `--jwt-key-file`, `--username` |
34
+ | Auth URL from file | `sf org login sfdx-url` | `--sfdx-url-file` |
35
+ | Log out of an org | `sf org logout` | `--target-org`, `--no-prompt` |
36
+ | List all connected orgs | `sf org list` | `--all` |
37
+ | Open org in browser | `sf org open` | `--target-org`, `--path` |
38
+ | Display org details | `sf org display` | `--target-org`, `--verbose` |
39
+
40
+ ### Deploy or Retrieve Source
41
+
42
+ | Scenario | Command | Key Flags |
43
+ |---|---|---|
44
+ | Deploy source directory | `sf project deploy start` | `--source-dir`, `--target-org` |
45
+ | Deploy with manifest | `sf project deploy start` | `--manifest`, `--target-org` |
46
+ | Deploy specific metadata | `sf project deploy start` | `--metadata "ApexClass:MyClass"` |
47
+ | Validate without deploying | `sf project deploy validate` | `--test-level`, `--target-org` |
48
+ | Quick deploy after validation | `sf project deploy quick` | `--job-id`, `--target-org` |
49
+ | Check deploy status | `sf project deploy report` | `--job-id` |
50
+ | Resume failed deploy | `sf project deploy resume` | `--job-id` |
51
+ | Cancel in-progress deploy | `sf project deploy cancel` | `--job-id` |
52
+ | Retrieve from org | `sf project retrieve start` | `--source-dir`, `--target-org` |
53
+ | Retrieve by manifest | `sf project retrieve start` | `--manifest` |
54
+ | Preview retrieval | `sf project retrieve preview` | `--target-org` |
55
+ | Generate manifest | `sf project generate manifest` | `--source-dir`, `--output-dir` |
56
+ | Convert source to mdapi | `sf project convert source` | `--root-dir`, `--output-dir` |
57
+ | Convert mdapi to source | `sf project convert mdapi` | `--root-dir`, `--output-dir` |
58
+ | Create new project | `sf project generate` | `--name`, `--template` |
59
+
60
+ ### Run Apex Code and Tests
61
+
62
+ | Scenario | Command | Key Flags |
63
+ |---|---|---|
64
+ | Execute anonymous Apex | `sf apex run` | `--file`, `--target-org` |
65
+ | Run all local tests | `sf apex run test` | `--test-level RunLocalTests` |
66
+ | Run specific test classes | `sf apex run test` | `--class-names "MyTest,OtherTest"` |
67
+ | Run specific test methods | `sf apex run test` | `--tests "MyTest.testMethod"` |
68
+ | Run tests with coverage | `sf apex run test` | `--code-coverage`, `--output-dir` |
69
+ | Run test suite | `sf apex run test` | `--suite-names "MySuite"` |
70
+ | Stream debug logs live | `sf apex tail log` | `--target-org`, `--debug-level` |
71
+ | Get a specific log | `sf apex get log` | `--log-id` |
72
+ | List recent logs | `sf apex list log` | `--target-org` |
73
+
74
+ ### Work with Data
75
+
76
+ | Scenario | Command | Key Flags |
77
+ |---|---|---|
78
+ | Run SOQL query | `sf data query` | `--query`, `--target-org` |
79
+ | Run SOQL from file | `sf data query` | `--file`, `--result-format` |
80
+ | Bulk SOQL query | `sf data query` | `--query`, `--bulk`, `--wait` |
81
+ | Run SOSL search | `sf data search` | `--query` |
82
+ | Create a record | `sf data create record` | `--sobject`, `--values` |
83
+ | Update a record | `sf data update record` | `--sobject`, `--record-id`, `--values` |
84
+ | Delete a record | `sf data delete record` | `--sobject`, `--record-id` |
85
+ | Bulk upsert from CSV | `sf data upsert bulk` | `--file`, `--sobject`, `--external-id` |
86
+ | Bulk delete from CSV | `sf data delete bulk` | `--file`, `--sobject` |
87
+ | Export data as tree | `sf data export tree` | `--query`, `--plan` |
88
+ | Import tree data | `sf data import tree` | `--plan`, `--target-org` |
89
+
90
+ ### Manage Scratch Orgs and Sandboxes
91
+
92
+ | Scenario | Command | Key Flags |
93
+ |---|---|---|
94
+ | Create scratch org | `sf org create scratch` | `--definition-file`, `--alias`, `--duration-days` |
95
+ | Delete scratch org | `sf org delete scratch` | `--target-org`, `--no-prompt` |
96
+ | Create sandbox | `sf org create sandbox` | `--name`, `--definition-file`, `--alias` |
97
+ | Clone sandbox | `sf org create sandbox` | `--clone`, `--name` |
98
+ | Delete sandbox | `sf org delete sandbox` | `--target-org`, `--no-prompt` |
99
+ | Resume sandbox creation | `sf org resume sandbox` | `--name`, `--target-org` |
100
+ | Assign permission set | `sf org assign permset` | `--name`, `--target-org` |
101
+ | Create user | `sf org create user` | `--definition-file`, `--target-org` |
102
+
103
+ ### Manage Packages
104
+
105
+ | Scenario | Command | Key Flags |
106
+ |---|---|---|
107
+ | Create package | `sf package create` | `--name`, `--package-type`, `--path` |
108
+ | Create version | `sf package version create` | `--package`, `--installation-key`, `--code-coverage` |
109
+ | Promote version | `sf package version promote` | `--package` |
110
+ | Install package | `sf package install` | `--package`, `--target-org` |
111
+ | Uninstall package | `sf package uninstall` | `--package`, `--target-org` |
112
+ | List versions | `sf package version list` | `--packages`, `--verbose` |
113
+ | List installed | `sf package installed list` | `--target-org` |
114
+
115
+ ### Work with Agentforce / AI Agents
116
+
117
+ | Scenario | Command | Key Flags |
118
+ |---|---|---|
119
+ | Create agent | `sf agent create` | `--target-org` |
120
+ | Generate agent spec | `sf agent generate spec` | `--output-dir` |
121
+ | Generate agent tests | `sf agent generate test` | `--spec-file`, `--output-dir` |
122
+ | Run agent tests | `sf agent test run` | `--name`, `--target-org` |
123
+ | Preview agent | `sf agent preview` | `--name`, `--target-org` |
124
+ | Activate agent | `sf agent activate` | `--target-org` |
125
+ | Deactivate agent | `sf agent deactivate` | `--target-org` |
126
+
127
+ > Note: `sf agent` commands are actively evolving. Run `sf agent <command> --help` for the latest flags.
128
+
129
+ ### Generate Code from Templates
130
+
131
+ | Scenario | Command | Key Flags |
132
+ |---|---|---|
133
+ | Generate Apex class | `sf apex generate class` | `--name`, `--output-dir`, `--template` |
134
+ | Generate Apex trigger | `sf apex generate trigger` | `--name`, `--sobject`, `--output-dir` |
135
+ | Generate LWC | `sf lightning generate component` | `--name`, `--type lwc` |
136
+ | Generate Aura component | `sf lightning generate component` | `--name`, `--type aura` |
137
+ | Generate Lightning event | `sf lightning generate event` | `--name`, `--output-dir` |
138
+ | Generate SObject | `sf schema generate sobject` | `--label`, `--output-dir` |
139
+ | Generate field | `sf schema generate field` | `--label`, `--object` |
140
+ | Generate platform event | `sf schema generate platformevent` | `--label`, `--output-dir` |
141
+ | Generate project | `sf project generate` | `--name`, `--template` |
142
+
143
+ ### Other Utilities
144
+
145
+ | Scenario | Command | Key Flags |
146
+ |---|---|---|
147
+ | Set default org | `sf config set` | `target-org=myOrg` |
148
+ | List config values | `sf config list` | |
149
+ | Set alias | `sf alias set` | `myAlias=user@org.com` |
150
+ | Describe SObject | `sf sobject describe` | `--sobject`, `--target-org` |
151
+ | List SObjects | `sf sobject list` | `--sobject-type`, `--target-org` |
152
+ | REST API request | `sf api request rest` | (URL path), `--method`, `--body` |
153
+ | GraphQL request | `sf api request graphql` | `--body` |
154
+ | Run Flow tests | `sf logic run test` | `--target-org` |
155
+ | Diagnose CLI issues | `sf doctor` | |
156
+ | Install plugin | `sf plugins install` | (plugin name) |
157
+ | Update CLI | `sf update` | |
158
+ | Show release notes | `sf info releasenotes display` | |
159
+
160
+ ---
161
+
162
+ ## Workflow Patterns
163
+
164
+ ### Authentication + Deploy
165
+
166
+ ```bash
167
+ # Login and deploy source
168
+ sf org login web --alias myOrg --set-default
169
+ sf project deploy start --source-dir force-app --target-org myOrg --wait 30
170
+ ```
171
+
172
+ ### CI/CD: Validate Then Quick Deploy
173
+
174
+ ```bash
175
+ # Authenticate in CI
176
+ sf org login jwt \
177
+ --client-id $SF_CLIENT_ID \
178
+ --jwt-key-file server.key \
179
+ --username $SF_USERNAME \
180
+ --alias prod
181
+
182
+ # Validate (runs tests without committing)
183
+ sf project deploy validate \
184
+ --source-dir force-app \
185
+ --test-level RunLocalTests \
186
+ --target-org prod \
187
+ --wait 60
188
+
189
+ # Quick deploy after successful validation (use job ID from validation output)
190
+ sf project deploy quick --job-id $JOB_ID --target-org prod
191
+ ```
192
+
193
+ ### Scratch Org Development Cycle
194
+
195
+ ```bash
196
+ # Create scratch org
197
+ sf org create scratch \
198
+ --definition-file config/project-scratch-def.json \
199
+ --alias dev \
200
+ --duration-days 7 \
201
+ --set-default
202
+
203
+ # Push source and assign permissions
204
+ sf project deploy start --source-dir force-app --target-org dev
205
+ sf org assign permset --name MyPermSet --target-org dev
206
+
207
+ # Import sample data
208
+ sf data import tree --plan data/sample-data-plan.json --target-org dev
209
+
210
+ # Run tests
211
+ sf apex run test --test-level RunLocalTests --target-org dev --code-coverage
212
+
213
+ # Clean up
214
+ sf org delete scratch --target-org dev --no-prompt
215
+ ```
216
+
217
+ ---
218
+
219
+ ## Related
220
+
221
+ - **Skill**: `sf-deployment` -- detailed deployment strategies and error resolution
222
+ - **Skill**: `sf-devops-ci-cd` -- CI/CD pipeline setup with GitHub Actions
223
+ - **Skill**: `sf-debugging` -- debug log setup and analysis with CLI commands
224
+ - **Skill**: `sf-metadata-management` -- metadata types and source tracking
225
+ - **Skill**: `sf-docs-lookup` -- web search for official Salesforce documentation