asciinema-session(1)
πΈ NAME πΈ
okay bestie, meet asciinema-session(1) from the General Commands Manual β the page for the asciinema-session command, and its whole thing is: Record and stream a terminal session. Itβs giving record-and-broadcast main character energy, and yes, it does both at once π.
β¨ SYNOPSIS β¨
asciinema session [-o|--output-file] [-f|--output-format]
[-l|--stream-local] [-r|--stream-remote] [-c|--command]
[-I|--capture-input] [--capture-env] [-a|--append] [--overwrite]
[-t|--title] [--description] [--visibility] [--audio-url]
[-i|--idle-time-limit] [--headless] [--window-size] [--return]
[--log-file] [--server-url] [-q|--quiet] [-h|--help] [ENV]
π DESCRIPTION π
Record and stream a terminal session simultaneously. It combines the functionality of the record and stream commands, so you can save a recording to a file while also broadcasting it live to viewers. multitasking icon behavior β¨.
Press Ctrl+D or type exit to end the session. Press Ctrl+\ to pause/resume capture of the session.
During the session, the ASCIINEMA_SESSION environment variable is set to a unique session ID. Cute little name tag for your session π.
π OPTIONS π
-o,--output-file=PATHβ Save the session to a file at the specified path. Can be combined with local and remote streaming.-f,--output-format=FORMATβ Specify the format for the output file when saving is enabled with--output-file. The default isasciicast-v3. If the output file path ends with.txt, thetxtformat will be selected automatically unless this option is explicitly specified. Possible values:asciicast-v3: Full-featured session format, with timing and metadata (current generation) βhttps://docs.asciinema.org/manual/asciicast/v3/asciicast-v2: Full-featured session format, with timing and metadata (previous generation) βhttps://docs.asciinema.org/manual/asciicast/v2/raw: Raw terminal output, including control sequences, without timing and metadatatxt: Plain text without colors or control sequences, human-readable
-l,--stream-local=IP:PORTβ Start the local HTTP server to stream the session in real-time. Creates a web interface accessible via browser where viewers can watch the terminal session live. Optionally specify the bind address asIP:PORT(e.g.,0.0.0.0:8080to allow external connections). If no address is provided, it listens on an automatically assigned ephemeral port on127.0.0.1. Can be combined with remote streaming and file output.-r,--stream-remote=STREAM-ID|WS-URLβ Stream the session to a remote asciinema server for public viewing. This allows sharing your session on the web with anyone who has the stream URL. You can provide either a stream ID of an existing stream configuration in your asciinema server account, or a direct WebSocket URL (ws://orwss://) for custom servers. Omitting the value for this option lets the asciinema server allocate a new stream ID automatically. Can be combined with local streaming and file output.-c,--command=COMMANDβ Specify the command to execute in the session. If not provided, asciinema will use your default shell from the$SHELLenvironment variable. This can be any command with arguments, for example:--command "python script.py"or--command "bash -l". Can also be set via the config file optionsession.command.-I,--capture-inputβ Enable recording of keyboard input in addition to terminal output. When enabled, both what you type and what appears on the screen will be captured. Note that sensitive input like passwords will also be recorded when this option is enabled. If the server has stream recording enabled then keyboard input will be included in the recording file created on the server side. Can also be set via the config file optionsession.capture_input.
β οΈ bestie, this means passwords too β do not enable this unless youβre okay with that being captured π.
--capture-env=VARSβ Specify which environment variables to capture and include in the session metadata. Provide a comma-separated list of variable names, for example:--rec-env "USER,SHELL,TERM". If not specified, only theSHELLvariable is captured by default. If the server has stream recording enabled then these environment variables will be included in the recording file created on the server side. Can also be set via the config file optionsession.capture_env.-a,--appendβ Append the new session to an existing recording file instead of creating a new one. This allows you to continue a previous recording session. The timing will be adjusted to maintain continuity from where the previous recording ended. Cannot be used together with--overwrite. Only applies when--output-fileis specified.--overwriteβ Overwrite the output file if it already exists. By default, asciinema will refuse to overwrite existing files to prevent accidental data loss. Cannot be used together with--append. Only applies when--output-fileis specified.-t,--title=TITLEβ Set a title for the session that will be stored in the recording metadata and displayed to stream viewers (when doing remote streaming with--remote). For example:--title "Installing Podman on Ubuntu". If the server has stream recording enabled then the title will be included in the recording file created on the server side.--description=DESCRIPTIONβ Set a description for the session. This description is displayed on the stream page (applies only to remote streaming with--stream-remote) and can include formatting, links, and code blocks. Useful for providing context, instructions, or documentation for viewers.--visibility=VISIBILITYβ Set the visibility level for the stream (applies only to remote streaming with--stream-remote). Public streams appear in listings and on your profile page. Unlisted streams are accessible via a direct URL but donβt appear in listings. Private streams are only accessible to the owner.
possible values: public, unlisted, private
--audio-url=URLβ Specify the URL of a live audio stream (e.g., Icecast MP3/OGG) to synchronize with the terminal stream (applies only to remote streaming with--stream-remote). When set, viewers can listen to audio commentary while watching the terminal. The audio URL is stored in the stream metadata and used by the player for synchronized playback. For example:--audio-url https://icecast.example.com/live.mp3-i,--idle-time-limit=SECSβ Limit the maximum idle time recorded between terminal events to the specified number of seconds. Long pauses (such as when you step away from the terminal) will be capped at this duration in the recording, making playback more watchable. For example,--idle-time-limit 2.0will ensure no pause longer than 2 seconds appears in the recording. Only applies when--output-fileis specified. Note that this option doesnβt alter the original (captured) timing information and instead, it embeds the idle time limit value in the metadata, which is interpreted by session players at playback time. This allows tweaking of the limit after recording. Can also be set via the config file optionsession.idle_time_limit.--headlessβ Run the session in headless mode without using the terminal for input/output. This is useful for automated or scripted sessions where you donβt want asciinema to interfere with the current terminal session. The session command will still execute normally and be recorded/streamed, but wonβt be displayed in your local terminal. Headless mode is enabled automatically when running in an environment where a terminal is not available.--window-size=COLSxROWSβ Override the terminal window size used for the session. Specify dimensions asCOLSxROWS(e.g.,80x24for 80 columns by 24 rows). You can specify just columns (80x) or just rows (x24) to override only one dimension. This is useful for ensuring consistent recording dimensions regardless of your current terminal size.--returnβ Make the asciinema command exit with the same status code as the session command. By default, asciinema exits with status0regardless of what happens in the session. With this option, if the session command exits with a non-zero status, asciinema will also exit with that same status.--log-file=PATHβ Enable logging of internal events to a file at the specified path. Useful for debugging I/O issues (connection errors, disconnections, file write errors, etc.).--server-url=URLβ Specify a custom asciinema server URL for streaming to self-hosted servers. Use the base server URL (e.g.,https://asciinema.example.com). Can also be set via environment variableASCIINEMA_SERVER_URLor config file optionserver.url. If no server URL is configured via this option, environment variable, or config file, you will be prompted to choose one (defaulting toasciinema.org), which will be saved as a default.-q,--quietβ Suppress diagnostic messages and progress indicators. Only error messages will be displayed.-h,--helpβ Print help (see a summary with-h).
π¦ EXTRA π¦
Examples, bestie β copy these exactly, theyβre sacred β¨:
- ```bash asciinema session --output-file demo.cast --stream-local
Records a shell session to a file and streams it via the local HTTP server listening on an ephemeral port on `127.0.0.1`.
2. ```bash
asciinema session -o demo.cast --stream-remote
Records to a file and streams via an asciinema server for public viewing.
- ```bash asciinema session --stream-local --stream-remote
Streams both locally and remotely simultaneously, without saving to a file.
4. ```bash
asciinema session -o demo.cast -l -r -t "Live coding"
Records + streams locally + streams remotely, setting the title of the recording/stream.
- ```bash asciinema session -o demo.cast --idle-time-limit 1.5
Records to a file with idle time capped at 1.5 seconds.
6. ```bash
asciinema session -o demo.cast -l 0.0.0.0:9000 -r <ID>
Records + streams locally on port 9000 + streams remotely, reusing existing stream ID.
cute sign-off time: this is the session page from asciinema-session(1), and the footer only gave us session + asciinema-session(1) β no version/date crumbs β so take this sparkly little ending instead, bestie π«Άπ
β¨.
π¦ where this page comes from
- alpine 3.24: asciinema-doc 3.2.0-r0 Β· GPL-3.0-or-later
- arch rolling: asciinema 3.2.1-1 Β· GPL-3.0-only
- nixos 26.05: asciinema 3.2.0
- nixpkgs unstable: asciinema 3.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms