From cf28531c40d5c45e34f680f50f85ce8b95f69c48 Mon Sep 17 00:00:00 2001 From: Irina Nazarova Date: Wed, 5 Aug 2026 14:59:02 -0700 Subject: [PATCH 1/3] docs: add AnyCable+ CLI page and surface the Rails setup generator in the quickstart --- docs/.vitepress/config.mts | 1 + docs/editions.md | 3 +- docs/plus/cli.md | 62 ++++++++++++++++++++++++++++++++++++++ docs/quickstart.md | 19 ++++++++++-- docs/ruby/cli.md | 4 ++- forspell.dict | 1 + 6 files changed, 85 insertions(+), 5 deletions(-) create mode 100644 docs/plus/cli.md diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index daa81d0..b112fa3 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -123,6 +123,7 @@ export default withMermaid(defineConfig({ { text: 'Editions', link: '/editions' }, { text: 'Going Pro', link: '/pro' }, { text: 'Install Pro', link: '/pro/install' }, + { text: 'AnyCable+ CLI', link: '/plus/cli' }, ] }, { diff --git a/docs/editions.md b/docs/editions.md index 7c949fa..e3cf15f 100644 --- a/docs/editions.md +++ b/docs/editions.md @@ -9,7 +9,8 @@ integrate. - **[Pro](./pro.md)** — the same server with a denser memory model, cluster features, and extra protocols. A drop-in replacement for the open-source binary. - **[AnyCable+](https://plus.anycable.io)** — Pro as a managed service, so you do - not operate the server yourself. Free tier available. + not operate the server yourself. Free tier available. Provision servers from + the terminal with the [AnyCable+ CLI](./plus/cli.md). ## Which one diff --git a/docs/plus/cli.md b/docs/plus/cli.md new file mode 100644 index 0000000..911764c --- /dev/null +++ b/docs/plus/cli.md @@ -0,0 +1,62 @@ +# AnyCable+ CLI + +[AnyCable+](https://plus.anycable.io) is the managed AnyCable service. The +`anycable-plus` command-line tool lets you provision and manage your _cables_ +(hosted AnyCable servers) right from the terminal. + +## Installation + +```sh +curl -LSs https://anycable-plus.terminalwire.sh | bash +``` + +The script installs the CLI under `~/.terminalwire` and adds it to your PATH. +Restart your shell (or open a new terminal) and verify the installation: + +```sh +anycable-plus --help +``` + +## Log in + +```sh +anycable-plus login +``` + +This opens a browser window where you sign in to AnyCable+ via GitHub. After +that, the CLI commands operate on your account. + +## Create a cable + +Create a hosted AnyCable server with a single command: + +```sh +anycable-plus cable create my-app --public --wait +``` + +The `--wait` flag keeps the command running until the cable has finished +provisioning. The `--public` flag creates a cable that accepts connections +without authentication, which is handy for prototyping (like running a local +server with `anycable-go --public`). For production, secure your cable with +[JWT authentication](../anycable-go/jwt_identification.md) and [signed +streams](../anycable-go/signed_streams.md); the +[quick start](../quickstart.md#secure-it) walks through both. + +## Exploring commands + +The CLI is a thin client for the AnyCable+ web application (built with +[Terminalwire](https://terminalwire.com)): commands are defined on the server +and their output is streamed to your terminal. You always have the latest +command set without reinstalling anything; the flip side is that every +command, including `--help`, requires network access. + +Use the built-in help to discover available commands and options: + +```sh +anycable-plus --help +anycable-plus cable --help +``` + +> Curious how a CLI-over-WebSocket works under the hood? Read the +> [Any Cables #34](https://blog.anycable.io/p/any-cables-34-cli-over-websocket) +> issue covering the AnyCable+ CLI architecture. diff --git a/docs/quickstart.md b/docs/quickstart.md index 55544e1..bc1ff57 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -9,7 +9,8 @@ Pick your stack: - [Node.js](#nodejs) — with the serverless SDK If you do not want to run a server at all, start with the managed -[AnyCable+](https://plus.anycable.io) (free tier) and skip installation. +[AnyCable+](https://plus.anycable.io) (free tier) and skip installation: +the [AnyCable+ CLI](./plus/cli.md) creates a hosted server in one command. ## Install AnyCable {#install} @@ -34,6 +35,15 @@ anycable-go --version # AnyCable 1.6.7 ... ``` +Prefer a hosted server? The [AnyCable+ CLI](./plus/cli.md) provisions a +managed one instead: + +```sh +curl -LSs https://anycable-plus.terminalwire.sh | bash +anycable-plus login +anycable-plus cable create my-app --public --wait +``` + ## Any backend (standalone pub/sub) {#any-backend} In standalone mode AnyCable handles connections and message delivery on its own. @@ -156,10 +166,13 @@ the same. ```sh bundle add anycable-rails +bin/rails g anycable:setup ``` -Follow the [Rails getting started guide](./rails/getting_started.md) for the -full setup, then run the server alongside your app: +The generator is an interactive wizard that configures AnyCable for your +application. See the [Rails getting started +guide](./rails/getting_started.md) for the details (including manual setup), +then run the server alongside your app: ```sh anycable-go diff --git a/docs/ruby/cli.md b/docs/ruby/cli.md index 354f01a..373ac13 100644 --- a/docs/ruby/cli.md +++ b/docs/ruby/cli.md @@ -1,4 +1,6 @@ -# AnyCable CLI +# AnyCable Ruby CLI + +> This page covers the `anycable` command that ships with the AnyCable Ruby gem. Looking for the CLI of the AnyCable+ managed service? See [AnyCable+ CLI](../plus/cli.md). [AnyCable Ruby](https://github.com/anycable/anycable) comes with a gRPC server for AnyCable and a CLI to run this server along with your Ruby application. diff --git a/forspell.dict b/forspell.dict index 922b627..c041334 100644 --- a/forspell.dict +++ b/forspell.dict @@ -44,6 +44,7 @@ Protobufs Soketi Stackblitz Systemd +Terminalwire Thruster Twilio Valkey From 6ad224820c0c040b4d47f7684c49ee134a34a0a6 Mon Sep 17 00:00:00 2001 From: Irina Nazarova Date: Wed, 5 Aug 2026 15:11:21 -0700 Subject: [PATCH 2/3] docs: verify AnyCable+ CLI against a live cable and document the full command set --- docs/plus/cli.md | 79 +++++++++++++++++++++++++++++++++++++--------- docs/quickstart.md | 4 +++ 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/docs/plus/cli.md b/docs/plus/cli.md index 911764c..4f66ff3 100644 --- a/docs/plus/cli.md +++ b/docs/plus/cli.md @@ -23,8 +23,9 @@ anycable-plus --help anycable-plus login ``` -This opens a browser window where you sign in to AnyCable+ via GitHub. After -that, the CLI commands operate on your account. +This opens a browser window where you sign in to AnyCable+ via GitHub. The +session is stored on your machine; use `anycable-plus whoami` to check who you +are logged in as and `anycable-plus logout` to end the session. ## Create a cable @@ -35,28 +36,76 @@ anycable-plus cable create my-app --public --wait ``` The `--wait` flag keeps the command running until the cable has finished -provisioning. The `--public` flag creates a cable that accepts connections +provisioning and prints its connection information: + +``` +Cable my-app is being provisioned +... + +ID 42 +Name my-app +Status created +WebSocket URL wss:///cable +Broadcast URL https:///_broadcast +Secret none (public mode) +``` + +Point your client at the WebSocket URL and your backend at the broadcast URL, +and you have a working realtime setup; the [quick start](../quickstart.md) +shows the full round trip. + +The `--public` flag creates a cable that accepts connections and broadcasts without authentication, which is handy for prototyping (like running a local -server with `anycable-go --public`). For production, secure your cable with -[JWT authentication](../anycable-go/jwt_identification.md) and [signed -streams](../anycable-go/signed_streams.md); the +server with `anycable-go --public`). For production, create a cable with a +secret instead and use [JWT authentication](../anycable-go/jwt_identification.md) +and [signed streams](../anycable-go/signed_streams.md); the [quick start](../quickstart.md#secure-it) walks through both. -## Exploring commands +Other `cable create` options: -The CLI is a thin client for the AnyCable+ web application (built with -[Terminalwire](https://terminalwire.com)): commands are defined on the server -and their output is streamed to your terminal. You always have the latest -command set without reinstalling anything; the flip side is that every -command, including `--help`, requires network access. +- `--secret=SECRET`: set the AnyCable secret (for JWT, signed streams, etc.). +- `--framework=FRAMEWORK`: adjust the default configuration to your backend + framework (`rails`, `hotwire`, `js`, or `laravel`). +- `--rpc-host=RPC_HOST`: the URL of your backend for running channels + (for the [Rails setup](../rails/getting_started.md)). + +## Manage cables -Use the built-in help to discover available commands and options: +List your cables: ```sh -anycable-plus --help -anycable-plus cable --help +anycable-plus cables +``` + +Print a cable's status and connection information (URLs, secret, +configuration): + +```sh +anycable-plus cable info 42 ``` +Change the configuration, for example, rotate the secret (pass an empty +string to switch the cable to the public mode): + +```sh +anycable-plus cable update 42 --secret=new-secret +``` + +Terminate and delete a cable (asks for confirmation unless you pass `-y`): + +```sh +anycable-plus cable destroy 42 -y +``` + +## How it works + +The CLI is a thin client for the AnyCable+ web application (built with +[Terminalwire](https://terminalwire.com)): commands are defined on the server +and their output is streamed to your terminal. You always have the latest +command set without reinstalling anything; the flip side is that every +command, including `--help`, requires network access (and most require being +logged in). + > Curious how a CLI-over-WebSocket works under the hood? Read the > [Any Cables #34](https://blog.anycable.io/p/any-cables-34-cli-over-websocket) > issue covering the AnyCable+ CLI architecture. diff --git a/docs/quickstart.md b/docs/quickstart.md index bc1ff57..d604fdf 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -44,6 +44,10 @@ anycable-plus login anycable-plus cable create my-app --public --wait ``` +The last command prints your cable's WebSocket URL and broadcast URL. The +steps below work the same for a hosted server: use those two URLs in place +of the `localhost` ones (and skip running `anycable-go`). + ## Any backend (standalone pub/sub) {#any-backend} In standalone mode AnyCable handles connections and message delivery on its own. From 755da95cf83f175d5f5409642fcfcbdb291a5e54 Mon Sep 17 00:00:00 2001 From: Irina Nazarova Date: Wed, 5 Aug 2026 16:08:38 -0700 Subject: [PATCH 3/3] docs: fix the hosted-server quickstart path (shell restart after install, step 4 secret via cable update) --- docs/quickstart.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index d604fdf..ba6622c 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -40,13 +40,20 @@ managed one instead: ```sh curl -LSs https://anycable-plus.terminalwire.sh | bash +``` + +The installer adds the CLI to your PATH; restart your shell (or open a new +terminal), then log in and create a cable: + +```sh anycable-plus login anycable-plus cable create my-app --public --wait ``` -The last command prints your cable's WebSocket URL and broadcast URL. The -steps below work the same for a hosted server: use those two URLs in place -of the `localhost` ones (and skip running `anycable-go`). +The last command prints your cable's WebSocket URL and broadcast URL. Steps +1–3 below work the same for a hosted server: use those two URLs in place +of the `localhost` ones (and skip running `anycable-go`). Step 4 notes the +one difference: you set the secret on the cable rather than via server flags. ## Any backend (standalone pub/sub) {#any-backend} @@ -127,6 +134,10 @@ export ANYCABLE_SECRET=$(openssl rand -hex 32) # use a stable value in product anycable-go --streams_secret=$ANYCABLE_SECRET --broadcast_adapter=http ``` +> On a hosted [AnyCable+](./plus/cli.md) cable, set the secret on the cable +> itself: `anycable-plus cable update --secret=$ANYCABLE_SECRET`. The +> signing and client steps below stay the same. + Generate a signed name in your backend and hand it to the client. The algorithm is HMAC-SHA256, identical across languages. Node.js: