Home Explore Blog CI



nushell

commands/docs/ansi_link.md
737493baedd65c7f3c21370b79076af153e56d0420c96bac0000000300000573
---
title: ansi link
categories: |
  platform
version: 0.104.0
platform: |
  Add a link (using OSC 8 escape sequence) to the given string.
usage: |
  Add a link (using OSC 8 escape sequence) to the given string.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `ansi link` for [platform](/commands/categories/platform.md)

<div class='command-title'>Add a link (using OSC 8 escape sequence) to the given string.</div>

## Signature

```> ansi link {flags} ...rest```

## Flags

 -  `--text, -t {string}`: Link text. Uses uri as text if absent. In case of
                tables, records and lists applies this text to all elements

## Parameters

 -  `...rest`: For a data structure input, add links to all strings at the given cell paths.


## Input/output types:

| input        | output       |
| ------------ | ------------ |
| list\<string\> | list\<string\> |
| record       | record       |
| string       | string       |
| table        | table        |
## Examples

Create a link to open some file
```nu
> 'file:///file.txt' | ansi link --text 'Open Me!'
Open Me!
```

Create a link without text
```nu
> 'https://www.nushell.sh/' | ansi link
https://www.nushell.sh/
```

Format a table column into links
```nu
> [[url text]; [https://example.com Text]] | ansi link url

```

Chunks
f72f1231 (1st chunk of `commands/docs/ansi_link.md`)
Title: ansi link
Summary
The `ansi link` command adds a clickable link to a given string using the OSC 8 escape sequence. It accepts a URI and optionally a text label for the link. It can also be used to format table columns into clickable links.