Skip to content

Commit 7695d34

Browse files
umair-ablyclaude
andcommitted
docs: document ably init and use it across getting-started pages
Add a reference page for the new `ably init` command, link it from the CLI index and platform nav, and replace the two-step install/login snippet across getting-started, chat, and push pages with the single `npx -p @ably/cli init` command. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b785f42 commit 7695d34

33 files changed

Lines changed: 181 additions & 297 deletions

src/data/nav/platform.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ export default {
394394
link: '/docs/cli',
395395
index: true,
396396
},
397+
{ name: 'Init', link: '/docs/cli/init' },
397398
{ name: 'Login', link: '/docs/cli/login' },
398399
{
399400
name: 'Accounts',

src/pages/docs/chat/getting-started/android.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,11 @@ implementation("com.ably.chat:chat-extensions-compose:1.2.0")
4444

4545
Use the [Ably CLI](https://github.com/ably/cli) as an additional client to quickly test chat features. It can simulate other users by sending messages, entering presence, and acting as another user typing a message.
4646

47-
1. Install the Ably CLI:
47+
Install the Ably CLI, log in to your Ably account, and set the default app and API key in a single command:
4848

4949
<Code>
5050
```shell
51-
npm install -g @ably/cli
52-
```
53-
</Code>
54-
55-
2. Run the following to log in to your Ably account and set the default app and API key:
56-
57-
<Code>
58-
```shell
59-
ably login
51+
npx -p @ably/cli ably init
6052
```
6153
</Code>
6254

src/pages/docs/chat/getting-started/javascript.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,11 @@ echo "ABLY_API_KEY={{API_KEY}}" > .env
6262

6363
Use the [Ably CLI](https://github.com/ably/cli) as an additional client to quickly test chat features. It can simulate other users by sending messages, entering presence, and acting as another user typing a message.
6464

65-
1. Install the Ably CLI:
65+
Install the Ably CLI, log in to your Ably account, and set the default app and API key in a single command:
6666

6767
<Code>
6868
```shell
69-
npm install -g @ably/cli
70-
```
71-
</Code>
72-
73-
2. Run the following to log in to your Ably account and set the default app and API key:
74-
75-
<Code>
76-
```shell
77-
ably login
69+
npx -p @ably/cli ably init
7870
```
7971
</Code>
8072

src/pages/docs/chat/getting-started/jvm.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,11 @@ implementation("org.slf4j:slf4j-nop:2.0.17")
5959

6060
Use the [Ably CLI](https://github.com/ably/cli) as an additional client to quickly test chat features. It can simulate other users by sending messages, entering presence, and acting as another user typing a message.
6161

62-
1. Install the Ably CLI:
62+
Install the Ably CLI, log in to your Ably account, and set the default app and API key in a single command:
6363

6464
<Code>
6565
```shell
66-
npm install -g @ably/cli
67-
```
68-
</Code>
69-
70-
2. Run the following to log in to your Ably account and set the default app and API key:
71-
72-
<Code>
73-
```shell
74-
ably login
66+
npx -p @ably/cli ably init
7567
```
7668
</Code>
7769

src/pages/docs/chat/getting-started/react-native.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,11 @@ cd ios && pod install && cd ..
5353

5454
Use the [Ably CLI](https://github.com/ably/cli) as an additional client to quickly test chat features. It can simulate other users by sending messages, entering presence, and acting as another user typing a message.
5555

56-
1. Install the Ably CLI:
56+
Install the Ably CLI, log in to your Ably account, and set the default app and API key in a single command:
5757

5858
<Code>
5959
```shell
60-
npm install -g @ably/cli
61-
```
62-
</Code>
63-
64-
2. Run the following to log in to your Ably account and set the default app and API key:
65-
66-
<Code>
67-
```shell
68-
ably login
60+
npx -p @ably/cli ably init
6961
```
7062
</Code>
7163

src/pages/docs/chat/getting-started/react-ui-kit.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,11 @@ That's all the setup you need—the kit's CSS is automatically bundled by Vite a
6767

6868
Use the [Ably CLI](https://github.com/ably/cli) as an additional client to quickly test chat features. It can simulate other users by sending messages, entering presence, and acting as another user typing a message.
6969

70-
1. Install the Ably CLI:
70+
Install the Ably CLI, log in to your Ably account, and set the default app and API key in a single command:
7171

7272
<Code>
7373
```shell
74-
npm install -g @ably/cli
75-
```
76-
</Code>
77-
78-
2. Run the following to log in to your Ably account and set the default app and API key:
79-
80-
<Code>
81-
```shell
82-
ably login
74+
npx -p @ably/cli ably init
8375
```
8476
</Code>
8577

src/pages/docs/chat/getting-started/react.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,11 @@ echo "VITE_ABLY_API_KEY={{API_KEY}}" > .env
6060

6161
Use the [Ably CLI](https://github.com/ably/cli) as an additional client to quickly test chat features. It can simulate other users by sending messages, entering presence, and acting as another user typing a message.
6262

63-
1. Install the Ably CLI:
63+
Install the Ably CLI, log in to your Ably account, and set the default app and API key in a single command:
6464

6565
<Code>
6666
```shell
67-
npm install -g @ably/cli
68-
```
69-
</Code>
70-
71-
2. Run the following to log in to your Ably account and set the default app and API key:
72-
73-
<Code>
74-
```shell
75-
ably login
67+
npx -p @ably/cli ably init
7668
```
7769
</Code>
7870

src/pages/docs/chat/getting-started/swift-async-sequence.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,11 @@ Using an AI coding assistant? [Teach it Ably](/docs/platform/ai-llms#agent-skill
2525

2626
Use the [Ably CLI](https://github.com/ably/cli) as an additional client to quickly test chat features. It can simulate other users by sending messages, entering presence, and acting as another user typing a message.
2727

28-
1. Install the Ably CLI:
28+
Install the Ably CLI, log in to your Ably account, and set the default app and API key in a single command:
2929

3030
<Code>
3131
```shell
32-
npm install -g @ably/cli
33-
```
34-
</Code>
35-
36-
2. Run the following to log in to your Ably account and set the default app and API key:
37-
38-
<Code>
39-
```shell
40-
ably login
32+
npx -p @ably/cli ably init
4133
```
4234
</Code>
4335

src/pages/docs/chat/getting-started/swift.mdx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,11 @@ Using an AI coding assistant? [Teach it Ably](/docs/platform/ai-llms#agent-skill
2525

2626
Use the [Ably CLI](https://github.com/ably/cli) as an additional client to quickly test chat features. It can simulate other users by sending messages, entering presence, and acting as another user typing a message.
2727

28-
1. Install the Ably CLI:
28+
Install the Ably CLI, log in to your Ably account, and set the default app and API key in a single command:
2929

3030
<Code>
3131
```shell
32-
npm install -g @ably/cli
33-
```
34-
</Code>
35-
36-
2. Run the following to log in to your Ably account and set the default app and API key:
37-
38-
<Code>
39-
```shell
40-
ably login
32+
npx -p @ably/cli ably init
4133
```
4234
</Code>
4335

src/pages/docs/cli/index.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ The following top-level commands are available in the Ably CLI:
2828

2929
| Command | Description |
3030
| ------- | ----------- |
31+
| [`ably init`](/docs/cli/init) | Set up the Ably CLI in one command: install, authenticate, and install [Agent Skills](https://github.com/ably/agent-skills) into your AI coding tools |
3132
| [`ably login`](/docs/cli/login) | Log in to your Ably account (alias for "ably accounts login") |
3233
| [`ably accounts`](/docs/cli/accounts) | Manage Ably accounts and your configured access tokens |
3334
| [`ably apps`](/docs/cli/apps) | Manage Ably apps |

0 commit comments

Comments
 (0)