A Rust CLI for publishing thought records. Designed to work with thought.stream.
at main 152 lines 3.4 kB view raw view rendered
1# Thought CLI 2 3A terminal UI for real-time streaming and posting to the ATProto network using `stream.thought.blip` records. 4 5Currently, this functions basically like IRC. I recommend entering the full TUI experience with 6 7``` 8./target/release/thought stream 9``` 10 11## Features 12 13- **Real-time TUI**: Live terminal interface showing all blips flowing through the network 14- **Interactive posting**: Post your thoughts directly from the TUI 15- **Jetstream integration**: Connect to the ATProto firehose for real-time updates 16- **Secure credentials**: Store your Bluesky credentials safely on your system 17- **Handle resolution**: Automatically resolve DIDs to readable handles 18- **Duplicate filtering**: Smart filtering to avoid showing your own posts twice 19 20## Quick Start 21 22### 1. Install 23```bash 24cargo build --release 25``` 26 27### 2. Login 28```bash 29./target/release/thought login 30``` 31Enter your Bluesky handle/email and app password when prompted. 32 33### 3. Stream Your Thoughts 34```bash 35./target/release/thought stream 36``` 37This launches the full TUI experience where you can see all blips in real-time and post your own. 38 39## Commands 40 41### thought 42The main CLI tool with multiple modes: 43 44```bash 45# Login to Bluesky 46thought login 47 48# Post a single blip 49thought "Your thought here" 50 51# Enter simple REPL mode 52thought interactive 53 54# Enter full TUI mode with live feed 55thought stream 56 57# Logout and clear credentials 58thought logout 59``` 60 61 62## TUI Interface 63 64The terminal UI shows: 65- **Messages area**: Scrollable feed of all blips with timestamps 66- **Status bar**: Connection status and message count 67- **Input field**: Type your thoughts and press Enter to post 68 69### TUI Controls 70- **Type + Enter**: Post a blip 71- **↑/↓**: Scroll through message history 72- **PageUp/PageDown**: Fast scroll 73- **Esc or Ctrl+C**: Exit TUI 74 75## Installation 76 77### Prerequisites 78- Rust 1.70+ 79- A Bluesky account with an app password 80 81### From Source 82```bash 83git clone git@tangled.sh:cameron.pfiffer.org/think 84cd think 85cargo build --release 86``` 87 88The binary will be available at: 89- `target/release/thought` 90 91### App Password Setup 921. Go to [Bluesky Settings](https://bsky.app/settings/app-passwords) 932. Generate a new app password 943. Use this password (not your main password) when running `thought login` 95 96## Configuration 97 98Credentials are securely stored in your system's configuration directory: 99- **macOS**: `~/Library/Application Support/com.thoughtstream.think/` 100- **Linux**: `~/.config/thoughtstream/think/` 101- **Windows**: `%APPDATA%\thoughtstream\think\` 102 103## Architecture 104 105- **ATProto Integration**: Uses the ATProto API for authentication and posting 106- **Jetstream Connection**: WebSocket connection to the real-time firehose 107- **Custom Records**: Posts using the `stream.thought.blip` record type 108- **TUI Framework**: Built with ratatui for a responsive terminal interface 109 110## Examples 111 112### Post a quick thought 113```bash 114thought "Just built something cool!" 115``` 116 117### Start a streaming session 118```bash 119thought stream 120# See all blips in real-time, post your own thoughts 121``` 122 123### Interactive REPL 124```bash 125thought interactive 126# Enter multiple thoughts line by line 127``` 128 129## Development 130 131### Building 132```bash 133cargo build 134``` 135 136### Running Tests 137```bash 138cargo test 139``` 140 141### Linting 142```bash 143cargo clippy 144``` 145 146## Contributing 147 148This is part of the larger `stream.thought` ecosystem for decentralized social communication on ATProto. 149 150## License 151 152MIT License - see LICENSE file for details.