Skip to content

Commit 67fa77e

Browse files
committed
More CLI 3.0 config docs and references
1 parent 9e18bc7 commit 67fa77e

File tree

9 files changed

+132
-39
lines changed

9 files changed

+132
-39
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Configuration
2+
3+
You can configure asciinema CLI with a config file.
4+
5+
The most common use-case is setting the URL of a [self-hosted asciinema
6+
server](../../server/self-hosting/index.md):
7+
8+
=== "CLI 3.x"
9+
10+
```toml title="~/.config/asciinema/config.toml"
11+
[server]
12+
url = "https://asciinema.example.com"
13+
```
14+
15+
=== "CLI 2.x"
16+
17+
```ini title="~/.config/asciinema/config"
18+
[api]
19+
url = https://asciinema.example.com
20+
```
21+
22+
Alternatively you can set it with environment variable in your shell config
23+
file:
24+
25+
=== "CLI 3.x"
26+
27+
```sh title="~/.bashrc"
28+
export ASCIINEMA_SERVER_URL=https://asciinema.example.com
29+
```
30+
31+
=== "CLI 2.x"
32+
33+
```sh title="~/.bashrc"
34+
export ASCIINEMA_API_URL=https://asciinema.example.com
35+
```
36+
37+
There's more things you can configure. For the full list of options check out
38+
the documentation for asciinema CLI version you use:
39+
40+
- [CLI 2.x configuration](v2.md)
41+
- [CLI 3.x configuration](v3.md)

docs/manual/cli/desktop-notifications.md

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,21 @@ the state of the terminal. This works out of the box on Linux (via
2121
of a program currently running in the foreground, e.g. a shell, vim etc.
2222

2323
You can disable desktop notifications with the `notifications.enabled` option in
24-
the [config file](configuration.md):
24+
the [config file](configuration/index.md):
2525

26-
```ini title="~/.config/asciinema/config"
27-
[notifications]
28-
enabled = no
29-
```
26+
=== "CLI 3.x"
27+
28+
```toml title="~/.config/asciinema/config.toml"
29+
[notifications]
30+
enabled = false
31+
```
32+
33+
=== "CLI 2.x"
34+
35+
```ini title="~/.config/asciinema/config"
36+
[notifications]
37+
enabled = no
38+
```
3039

3140
## Custom notification command
3241

@@ -40,10 +49,19 @@ The command is executed with the following environment variables:
4049
Below is an example of [tmux](https://github.com/tmux/tmux/wiki) status bar
4150
integration:
4251

43-
```ini title="~/.config/asciinema/config"
44-
[notifications]
45-
command = tmux display-message "$TEXT"
46-
```
52+
=== "CLI 3.x"
53+
54+
```toml title="~/.config/asciinema/config.toml"
55+
[notifications]
56+
command = 'tmux display-message "$TEXT"'
57+
```
58+
59+
=== "CLI 2.x"
60+
61+
```ini title="~/.config/asciinema/config"
62+
[notifications]
63+
command = tmux display-message "$TEXT"
64+
```
4765

4866
The command is executed in a shell (`/bin/sh`), therefore it's possible to use
4967
shell constructs like pipes.

docs/manual/cli/markers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Markers can be added to a recording in two ways.
1111

1212
During a recording session, you can add markers in real-time by pressing a
1313
configured [keyboard shortcut](shortcuts.md). Set `rec.add_marker_key` [config
14-
file option](configuration.md) first as there's no default binding at the
14+
file option](configuration/index.md) first as there's no default binding at the
1515
moment. When a marker is added a [desktop
1616
notification](desktop-notifications.md) is displayed.
1717

docs/manual/cli/shortcuts.md

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,54 @@
1+
---
2+
hide:
3+
- toc
4+
---
5+
16
# Keyboard shortcuts
27

38
There are several key bindings used by the CLI during recording and playback.
4-
Most of them can be customized in the [config file](configuration.md).
9+
Most of them can be customized in the [config file](configuration/index.md).
510

611
## Recording shortcuts
712

813
The following keyboard shortcuts are available when recording with [`asciinema
914
rec`](usage.md#asciinema-rec-filename):
1015

11-
shortcut | action | config file option | notes
12-
---------|--------|---------------|------
13-
<kbd>ctrl+\</kbd> | toggle the capture of a terminal | `rec.pause_key` | similar to "mute" on an audio call
14-
<kbd>ctrl+d</kbd> | end the recording session | - | this is handled by a shell
15-
- | add a [marker](markers.md) | `rec.add_marker_key` | no default shortcut for this
16+
shortcut | action | 3.x config file option | 2.x config file option | notes
17+
---------|--------|---------------|------|---
18+
<kbd>ctrl+\</kbd> | toggle the capture of a terminal | `recording.pause_key` | `rec.pause_key` | similar to "mute" on an audio call
19+
<kbd>ctrl+d</kbd> | end the recording session | - | - | this is handled by a shell
20+
- | add a [marker](markers.md) | `recording.add_marker_key` | `rec.add_marker_key` | no default shortcut for this
1621

1722
## Playback shortcuts
1823

1924
The following keyboard shortcuts are available when replaying with [`asciinema
2025
play`](usage.md#asciinema-play-filename):
2126

22-
shortcut | action | config file option | notes
23-
---------|--------|---------------|------
24-
<kbd>space</kbd> | toggle the playback | `play.pause_key` | pauses / resumes
25-
<kbd>]</kbd> | jump to next [marker](markers.md) | `play.next_marker_key` |
26-
<kbd>.</kbd> | step (when paused) | `play.step_key` | steps through a recording<br>a frame at a time
27-
<kbd>ctrl+c</kbd> | stop | - | ends the playback
27+
shortcut | action | 3.x config file option | 2.x config file option | notes
28+
---------|--------|---------------|------|---
29+
<kbd>space</kbd> | toggle the playback | `playback.pause_key` | `play.pause_key` | pauses / resumes
30+
<kbd>]</kbd> | jump to next [marker](markers.md) | `playback.next_marker_key` | `play.next_marker_key` |
31+
<kbd>.</kbd> | step (when paused) | `playback.step_key` | `play.step_key` | steps through a recording<br>a frame at a time
32+
<kbd>ctrl+c</kbd> | stop | - | - | ends the playback
2833

2934
## Prefix key
3035

3136
You can define a "prefix key" for the recording shortcuts with `rec.prefix_key`
3237
option in the config file:
3338

34-
```ini title="~/.config/asciinema/config"
35-
[rec]
36-
prefix_key = C-a
37-
```
39+
=== "CLI 3.x"
40+
41+
```toml title="~/.config/asciinema/config.toml"
42+
[recording]
43+
prefix_key = "C-a"
44+
```
45+
46+
=== "CLI 2.x"
47+
48+
```ini title="~/.config/asciinema/config"
49+
[rec]
50+
prefix_key = C-a
51+
```
3852

3953
This works similarly to a prefix key in [GNU
4054
screen](https://www.gnu.org/software/screen/) or

docs/manual/cli/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can temporarily pause the capture of your terminal by pressing
1818
that must not be captured (e.g. pasting secrets). It's an equivalent of the
1919
"mute" functionality in an audio call. Resume the capture by pressing
2020
<kbd>ctrl+\</kbd> again. This shortcut (and [other shortcuts](shortcuts.md)) can
21-
be customized in the [config file](configuration.md). Capture state changes are
21+
be customized in the [config file](configuration/index.md). Capture state changes are
2222
signaled via [desktop notifications](desktop-notifications.md).
2323

2424
Recording session ends when you exit the shell, which can be done either by
@@ -175,7 +175,7 @@ This command uploads a terminal session recorded with `rec` to [asciinema
175175
server](../server/index.md) instance, where it can be viewed and shared with a
176176
wider audience. Default upload target is [asciinema.org](https://asciinema.org),
177177
but it can be easily changed to [point to another server
178-
instance](configuration.md#asciinema_api_url).
178+
instance](configuration/v3.md#asciinema_server_url).
179179

180180
It's likely that you would want to manage this and other uploaded recordings at
181181
some point, e.g. set a title or change terminal color theme. See [asciinema

docs/manual/player/markers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ definitions:
7171
[17.389425, "o", "..."]
7272
```
7373

74-
asciinema recorder can be [configured](../cli/configuration.md) to have a
74+
asciinema recorder can be [configured](../cli/configuration/index.md) to have a
7575
keyboard shortcut for adding markers during the recording session. If you have
7676
an existing recording you can edit the file with your favourite editor and
7777
insert marker lines as shown in the above example.

docs/manual/server/self-hosting/index.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,22 @@ secure asciinema server easily.
3232

3333
Once your server is up and running, you'll be able to upload your recordings by
3434
pointing [asciinema CLI](../../cli/index.md) to the server using the
35-
`ASCIINEMA_API_URL` environment variable:
35+
`ASCIINEMA_SERVER_URL` environment variable:
36+
37+
=== "CLI 3.x"
38+
39+
```sh
40+
export ASCIINEMA_SERVER_URL=https://asciinema.example.com
41+
asciinema upload demo.cast
42+
```
43+
44+
=== "CLI 2.x"
45+
46+
```sh
47+
export ASCIINEMA_API_URL=https://asciinema.example.com
48+
asciinema upload demo.cast
49+
```
3650

37-
```sh
38-
export ASCIINEMA_API_URL=https://asciinema.example.com
39-
asciinema upload demo.cast
40-
```
4151

4252
If you need help with installation or maintenance feel free to ask on [asciinema
4353
forum](https://discourse.asciinema.org) or in [asciinema Matrix

docs/manual/server/self-hosting/quick-start.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,19 @@ Congratulations! You have your own asciinema server instance 🎉
174174
Now, point asciinema CLI to your server by setting `ASCIINEMA_API_URL`, and
175175
upload a recording:
176176

177-
```sh
178-
export ASCIINEMA_API_URL=https://asciinema.example.com
179-
asciinema upload demo.cast
180-
```
177+
=== "CLI 3.x"
178+
179+
```sh
180+
export ASCIINEMA_SERVER_URL=https://asciinema.example.com
181+
asciinema upload demo.cast
182+
```
183+
184+
=== "CLI 2.x"
185+
186+
```sh
187+
export ASCIINEMA_API_URL=https://asciinema.example.com
188+
asciinema upload demo.cast
189+
```
181190

182-
Check the [CLI configuration](../../cli/configuration.md) section for
191+
Check the [CLI configuration](../../cli/configuration/index.md) section for
183192
information on how to set the server URL permanently via the configuration file.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ nav:
6161
- manual/cli/installation.md
6262
- manual/cli/usage.md
6363
- Configuration:
64+
- manual/cli/configuration/index.md
6465
- manual/cli/configuration/v2.md
6566
- manual/cli/configuration/v3.md
6667
- manual/cli/markers.md

0 commit comments

Comments
 (0)