Skip to content

Commit 39d4aaa

Browse files
committed
docs: improve first-stream tutorial with XS_ADDR setup instructions
Add clear prerequisites and a prominent callout explaining that XS_ADDR must be set when using a non-default store path. Also simplify xs-addr resolution by removing broken config file logic.
1 parent dc5221f commit 39d4aaa

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

docs/src/content/docs/getting-started/first-stream.mdx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ import { Link } from '../../../utils/links';
1111

1212
Let's create your first event stream.
1313

14-
<Aside>
15-
This tutorial uses commands from `xs.nu`. If you haven't installed it yet,
16-
run `xs nu --install` and then `use xs.nu *` in Nushell. See the
17-
[installation guide](../installation/) for details.
14+
<Aside type="tip" title="Prerequisites">
15+
Before starting, make sure you have:
16+
1. Run `xs nu --install` once to install the Nushell integration
17+
2. Started a new Nushell session (or run `use xs.nu *`)
18+
3. Have **two terminal windows** ready: one for the server, one for the client
19+
20+
See the [installation guide](../installation/) for details.
1821
</Aside>
1922

2023
## Serve
@@ -36,7 +39,7 @@ Start an `xs` store in a dedicated window:
3639
```
3740
3841
For a long-running setup you might run `xs serve ~/.local/share/cross.stream/store`
39-
under a process supervisor. This is also the fallback location used by
42+
under a process supervisor. This is the default location used by
4043
`xs.nu` when `$env.XS_ADDR` isn't set. Here we keep the demo scoped to `./store`.
4144
4245
To point tools at another store, set `XS_ADDR`. This can be done temporarily with `with-env`:
@@ -45,6 +48,19 @@ To point tools at another store, set `XS_ADDR`. This can be done temporarily wit
4548
with-env {XS_ADDR: "./store"} { .cat }
4649
```
4750
51+
<Aside type="caution" title="Set XS_ADDR for this tutorial">
52+
Since we're using `./store` instead of the default location, set `XS_ADDR`
53+
in your client terminal before running any commands:
54+
55+
```nushell
56+
$env.XS_ADDR = (realpath ./store)
57+
```
58+
59+
Without this, the client will try to connect to the default path
60+
(`~/.local/share/cross.stream/store`) and fail with a connection error
61+
(on Windows, this may appear as "dead network (os error 10050)").
62+
</Aside>
63+
4864
## Client
4965
5066
### `append` command

xs.nu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def conditional-pipe [
2121
}
2222

2323
export def xs-addr [] {
24-
$env | get XS_ADDR? | or-else { try { open ~/.config/cross.stream/XS_ADDR | str trim | path expand } } | or-else { "~/.local/share/cross.stream/store" | path expand }
24+
$env | get XS_ADDR? | or-else { "~/.local/share/cross.stream/store" | path expand }
2525
}
2626

2727
export def xs-context-collect [] {

0 commit comments

Comments
 (0)