> For the complete documentation index, see [llms.txt](https://documentation.hak5.org/packet-squirrel/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.hak5.org/packet-squirrel/payload-development/the-button-command.md).

# The BUTTON Command

`BUTTON` is a Ducky Script command for the Packet Squirrel which pauses the payload until either the hardware push-button has been momentarily depressed, or an optionally specified time has elapsed.

In the event that a time is specified, `BUTTON` will exit with a non zero return code if the push-button is not pressed in the given time, and zero if the push-button was pressed.

```
BUTTON 1m && {
  echo "button pressed"
} || {
  echo "button not pressed"
}
```

If no time is specified the `BUTTON` command will pause indefinitely until the push-button is pressed.

During this pause, the `LED` will light the `SPECIAL` status, meaning a solid cyan color which blinks off for 100 ms every second.

Time may be specified in (s)econds, (m)inutes, (h)ours or (d)ays. For example:

```
BUTTON 10s # Wait for 10 seconds for button press
BUTTON 30m # Wait for 30 minutes for button press
BUTTON 365d # Wait 1 year for button press
BUTTON # wait indefinitely for button press
```

The special LED status light may be suppressed by setting the `NO_LED` environment variable to 1.

```
NO_LED=1 BUTTON 1m
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.hak5.org/packet-squirrel/payload-development/the-button-command.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
