> ## Documentation Index
> Fetch the complete documentation index at: https://s2.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Create an S2 account, install the CLI, and start appending and reading streams right away.

## Onboarding

**First**, log in to the [dashboard](https://s2.dev/dashboard) and create a new organization.

## Get started with the CLI

**1. Install the S2 CLI**

> [tab] Using Homebrew
>
> This method works on macOS and Linux distributions with
> [Homebrew](https://brew.sh) installed.
>
> Homebrew 6.0 and later require explicit [tap trust](https://docs.brew.sh/Tap-Trust) for third-party taps. Installing with the fully qualified name trusts only the S2 formula:
>
> ```bash theme={null}
> brew install s2-streamstore/s2/s2
> ```
>
> > [!NOTE]
> >
> > The fully qualified name (`s2-streamstore/s2/s2`) scopes trust to that formula only. To trust every current and future package in the tap instead, run `brew trust s2-streamstore/s2` before installing.

> [tab] Using Cargo
>
> This method works on any system with [Rust](https://www.rust-lang.org/)
> and [Cargo](https://doc.rust-lang.org/cargo/) installed.
>
> ```bash theme={null}
> cargo install --locked s2-cli
> ```

> [tab] From Release Binaries
>
> Check out the [S2 CLI Releases](https://github.com/s2-streamstore/s2/releases?q=s2-cli\&expanded=true)
> for prebuilt binaries for many different architectures and operating systems.
>
> Linux and macOS users can download the release binary using:
>
> ```bash theme={null}
> curl -fsSL s2.dev/install.sh | bash
> ```
>
> > [!NOTE]
> >
> > The script will install the binary in `~/.s2/bin` and modify
> > the shell profile file to add it to the path. Make sure to
> > reload the shell or open up a new terminal after completing
> > the installation.

The binary should be installed as `s2`.

**2. Authenticate the CLI**

> [tab] Browser login
>
> ```bash theme={null}
> s2 login
> ```

> [tab] Access token
>
> Issue an access token from the [dashboard](https://s2.dev/dashboard), then store it with:
>
> ```bash theme={null}
> s2 auth access-token set
> ```

**3. Create a new basin**

> [!TIP]
>
> Basin names must be globally unique. Try creating a basin with your
> GitHub handle, something like `username-first-basin`.

> [!NOTE]
>
> A basin name must be between 8 and 48 characters long and comprise
> lowercase letters, numbers and hyphens. It cannot begin or end with a
> hyphen.

```bash theme={null}
export BASIN="YOUR_BASIN_NAME"
s2 basin create ${BASIN}
```

Let's double-check that the new basin exists. You should see its name in the list, with its location:

```bash theme={null}
s2 basin list
```

**4. Grab your popcorn!**

Nothing better than Star Wars to give us a good sense of how we can exercise `append` and `read` sessions, and see what **data in motion** looks like.

We will start by creating a new stream called `starwars`.

```bash theme={null}
s2 stream create s2://${BASIN}/starwars
```

Some of you may have watched the movie in ASCII over telnet from `towel.blinkenlights.nl`!

We will do the same, except we will "append" the movie to our `starwars` stream while we also tail it.

Start by creating a read session like so:

```bash theme={null}
s2 read s2://${BASIN}/starwars 2> /dev/null
```

Open another terminal and start an append session:

```bash theme={null}
export BASIN="YOUR_BASIN_NAME" # Set the basin name for new terminal
nc starwars.s2.dev 23 | s2 append s2://${BASIN}/starwars
```

Go back to the previous terminal with the read session to enjoy the movie:

## What You Just Used

You just created a [basin](https://s2.dev/docs/concepts/basins.md), wrote to a [stream](https://s2.dev/docs/concepts/streams.md), and moved [records](https://s2.dev/docs/concepts/records.md) with [appends](https://s2.dev/docs/concepts/appends.md) and [reads](https://s2.dev/docs/concepts/reads.md).

> [card] [Explore S2 concepts](https://s2.dev/docs/concepts/records.md)
>
> Start with records, then follow the model through streams, basins, appends, and reads.

> [card] [Try more demos](https://s2.dev/docs/demos.md)
>
> Explore the playground, resumable AI chat, live sandbox logs, and collaborative editing.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.