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
Everything in cross.stream is scoped by context - including TTLs, head tracking, and other features. This makes it easy to maintain separate streams of events while keeping them organized in the same store.
199
-
</Aside>
200
-
201
-
## Managing Contexts with .ctx Commands
202
-
203
-
When using the NuShell convenience module (`xs.nu`), you get access to
204
-
additional context management commands under the `.ctx` namespace. These provide
205
-
a more interactive way to work with contexts.
206
-
207
-
### Listing Contexts
208
-
209
-
View all available contexts and see which one is active:
210
-
211
-
<TabssyncKey="shell">
212
-
<TabItemlabel="nushell">
213
-
214
-
```nushell withOutput
215
-
> .ctx list
216
-
─#─┬───────────────id───────────────┬─active─┐
217
-
0 │ 0000000000000000000000000 │ true │
218
-
1 │ 03d4qbrxizqgav09m7hicksb0 │ false │
219
-
───┴──────────────────────────────────┴────────┘
220
-
```
221
-
222
-
</TabItem>
223
-
</Tabs>
224
-
225
-
### Switching Contexts
226
-
227
-
Change your active context:
228
-
229
-
<TabssyncKey="shell">
230
-
<TabItemlabel="nushell">
231
-
232
-
```nushell withOutput
233
-
> .ctx switch 03d4qbrxizqgav09m7hicksb0
234
-
03d4qbrxizqgav09m7hicksb0
235
-
```
236
-
237
-
You can also switch interactively:
238
-
239
-
```nushell withOutput
240
-
> .ctx switch
241
-
# (shows interactive list to select from)
242
-
03d4qbrxizqgav09m7hicksb0
243
-
```
244
-
245
-
</TabItem>
246
-
</Tabs>
247
-
248
-
### Creating a New Context
249
-
250
-
Create and automatically switch to a new context:
251
-
252
-
<TabssyncKey="shell">
253
-
<TabItemlabel="nushell">
254
-
255
-
```nushell withOutput
256
-
> .ctx new
257
-
03d4qbrxizqgav09m7hicksb0
258
-
```
259
-
260
-
</TabItem>
261
-
</Tabs>
262
-
263
-
### Viewing Current Context
264
-
265
-
Check your current context:
266
-
267
-
<TabssyncKey="shell">
268
-
<TabItemlabel="nushell">
269
-
270
-
```nushell withOutput
271
-
> .ctx
272
-
03d4qbrxizqgav09m7hicksb0
273
-
```
274
-
275
-
</TabItem>
276
-
</Tabs>
277
-
278
-
<Asidetype="note">
279
-
These `.ctx` commands modify the `$env.XS_CONTEXT` environment variable and
280
-
provide a convenient wrapper around the basic context operations. They're only
281
-
available when using NuShell with the xs.nu module loaded.
128
+
Everything in cross.stream is scoped by context - including TTLs, head tracking, and other features. Using descriptive context names helps organize your event streams.
0 commit comments