Home Explore Blog CI



nushell

commands/docs/input.md
36844630a10f3e46801cbadd8b247285e50650379a7dad5b000000030000067d
---
title: input
categories: |
  platform
version: 0.104.0
platform: |
  Get input from the user.
usage: |
  Get input from the user.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

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

<div class='command-title'>Get input from the user.</div>

## Signature

```> input {flags} (prompt)```

## Flags

 -  `--bytes-until-any, -u {string}`: read bytes (not text) until any of the given stop bytes is seen
 -  `--numchar, -n {int}`: number of characters to read; suppresses output
 -  `--default, -d {string}`: default value if no input is provided
 -  `--suppress-output, -s`: don't print keystroke values

## Parameters

 -  `prompt`: Prompt to show the user.


## Input/output types:

| input   | output |
| ------- | ------ |
| nothing | any    |
## Examples

Get input from the user, and assign to a variable
```nu
> let user_input = (input)

```

Get two characters from the user, and assign to a variable
```nu
> let user_input = (input --numchar 2)

```

Get input from the user with default value, and assign to a variable
```nu
> let user_input = (input --default 10)

```


## Subcommands:

| name                                             | description                      | type     |
| ------------------------------------------------ | -------------------------------- | -------- |
| [`input list`](/commands/docs/input_list.md)     | Interactive list selection.      | built-in |
| [`input listen`](/commands/docs/input_listen.md) | Listen for user interface event. | built-in |

Chunks
6dd303cc (1st chunk of `commands/docs/input.md`)
Title: input Command Documentation
Summary
This document describes the `input` command in Nushell, which allows you to get input from the user. It covers the command's signature, flags (such as `--bytes-until-any`, `--numchar`, `--default`, and `--suppress-output`), parameters (the prompt), input/output types, and provides examples of how to use the command to get user input and assign it to a variable. It also lists the available subcommands like `input list` and `input listen`.