You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/configuration.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,6 +153,54 @@ b2c code deploy -i staging
153
153
154
154
If no instance is specified, the config with `"active": true` is used.
155
155
156
+
### Managing Instances with the CLI
157
+
158
+
Instead of editing `dw.json` by hand, you can use `b2c setup instance` commands to create, list, remove, and switch between instance configurations.
159
+
160
+
#### Quick Setup
161
+
162
+
```bash
163
+
# Interactive — prompts for hostname, auth, and code version
164
+
b2c setup instance create staging
165
+
166
+
# Non-interactive
167
+
b2c setup instance create staging \
168
+
--hostname staging.example.com \
169
+
--client-id my-client-id \
170
+
--client-secret my-secret \
171
+
--force
172
+
```
173
+
174
+
The interactive mode auto-detects the active code version via OCAPI when OAuth credentials are provided, and the first instance you create is automatically set as active.
175
+
176
+
#### Switching Instances
177
+
178
+
```bash
179
+
# Set a different instance as the default
180
+
b2c setup instance set-active production
181
+
182
+
# Or pick interactively (shows a searchable list)
183
+
b2c setup instance set-active
184
+
185
+
# Commands now use the active instance by default
186
+
b2c code list # Uses production
187
+
b2c code list -i staging # Override for one command
188
+
```
189
+
190
+
#### Listing and Removing
191
+
192
+
```bash
193
+
# See all configured instances
194
+
b2c setup instance list
195
+
196
+
# Remove an instance
197
+
b2c setup instance remove staging
198
+
```
199
+
200
+
::: tip
201
+
For the full command reference with all flags, see [Setup Commands](/cli/setup).
0 commit comments