> ## Documentation Index
> Fetch the complete documentation index at: https://docs.buttons.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI buttons

> Wrap a shell command as a button — one line, no separate script file.

A "CLI button" is just a shell-runtime button whose body is the command you want to run. There's no special flag for it: `buttons create` scaffolds a shell button by default, and `--code` lets you pass the command inline so you never open an editor.

```bash theme={null}
buttons create tail-logs --code 'openclaw tail --service api --env production'
buttons create git-status --code 'git status --short'
```

`--code` writes the command straight into the button's `main.sh` and skips the placeholder scaffold. `--runtime` defaults to `shell`, so you don't pass it for a portable CLI command; use `bash`, `python`, or `node` when the body requires that interpreter. Press it like any other button:

```bash theme={null}
buttons press git-status
```

## Without `--code`

Run `buttons create <name>` with no shortcut flags and it scaffolds a shell button with a placeholder `main.sh` you then edit:

```bash theme={null}
buttons create deploy-check
# edit .buttons/buttons/deploy-check/main.sh
```

To start from an existing script file instead of inline code, use `-f, --file`:

```bash theme={null}
buttons create deploy-check --file ./scripts/deploy-check.sh
```

## Adding args

Declare typed args with `--arg name:type:required|optional` (repeatable). Each is injected into the press as `$BUTTONS_ARG_<NAME>`:

```bash theme={null}
buttons create tail-logs \
  --code 'openclaw tail --service "$BUTTONS_ARG_SERVICE" --env "$BUTTONS_ARG_ENV"' \
  --arg service:string:required \
  --arg env:enum:required:staging|production

buttons press tail-logs --arg service=api --arg env=production
```

Add `-d, --description` for what shows in `buttons list`, and `--timeout <secs>` to override the default press timeout.

See [Code buttons](/buttons/code) for the full `buttons create` flag set (runtimes, HTTP buttons, batteries, and more).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.