Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Dec 20, 2024
1 parent a6191f5 commit ce36abc
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions examples/bash/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Electric Bash Client

A simple bash client for consuming Electric shape logs. This client can connect to any Electric shape URL and stream updates in real-time.

## Requirements

- bash
- curl
- jq (for JSON processing)

## Usage

```bash
./client.bash 'YOUR_SHAPE_URL'
```

For example:
```bash
./client.bash 'http://localhost:3000/v1/shape?table=notes'
```

## Example Output

When first connecting, you'll see the initial shape data:
```json
[
{
"key": "\"public\".\"notes\"/\"1\"",
"value": {
"id": "1",
"title": "Example Note",
"created_at": "2024-12-05 01:43:05.219957+00"
},
"headers": {
"operation": "insert",
"relation": [
"public",
"notes"
]
},
"offset": "0_0"
}
]
```

Once caught up, the client switches to live mode and streams updates:
```
Found control message
Control value: up-to-date
Shape is up to date, switching to live mode
```

Any changes to the shape will be streamed in real-time.

0 comments on commit ce36abc

Please sign in to comment.