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

# Use the CLI

> Work on scripts from a terminal: scaffold a package, check it, run it with live reload, and watch what Rebind has loaded and what it logs.

The `rebind` command works next to the app. Use it when you write scripts in
your own editor and keep a terminal open beside it. This page walks through one
development loop. Every command and option is in the
[CLI reference](https://docs.rebind.gg/reference/cli.md).

Run `rebind` on its own to list the commands. The letters in parentheses are
short aliases.

![Terminal output of rebind listing commands under develop, packages, troubleshoot, scripts, and account, with aliases such as c for check and r for run](https://mintcdn.com/rebind/mk4-exzrQ1Bh6kZJ/images/app/cli-help.png?fit=max\&auto=format\&n=mk4-exzrQ1Bh6kZJ\&q=85\&s=4c1992c205892ac08bffb0c4bfe1af66)

rebind with no arguments lists the commands by task.

## Start a package

`rebind init hello` creates a `hello` folder with a manifest, a `main.luau`
that logs a line when it starts, a README, and a `.gitignore`. `rebind check`
validates it offline; [check](https://docs.rebind.gg/reference/cli.md#check) lists what it covers.

![Terminal output of rebind init hello listing the four created files, then rebind check reporting ok for manifest, modeline, require graph, compile, and permissions](https://mintcdn.com/rebind/mk4-exzrQ1Bh6kZJ/images/app/cli-init-check.png?fit=max\&auto=format\&n=mk4-exzrQ1Bh6kZJ\&q=85\&s=d8f00d45d38bedf23c11829f1ed5ace8)

Scaffold a package, then check it.

To edit in VS Code with autocomplete, see [Editor setup](https://docs.rebind.gg/getting-started/editor-setup.md).

## Run it while you edit

From the package folder, `rebind run` checks the package, loads it into the
running Rebind, and prints its log lines. When you save a change, it checks
again and reloads; [run](https://docs.rebind.gg/reference/cli.md#run) lists which files count. Below,
the logged message was edited while the script ran. `Ctrl+C` stops the script and exits.

![Terminal output of rebind run: the check passes, the script starts and logs hello started, then reloads after main.luau changed and logs hello, version 2, then stops](https://mintcdn.com/rebind/mk4-exzrQ1Bh6kZJ/images/app/cli-run.png?fit=max\&auto=format\&n=mk4-exzrQ1Bh6kZJ\&q=85\&s=5e863915e1ff96366b00818713dc473e)

rebind run reloads the script when a file changes.

## See what is loaded

`rebind ps` lists every script instance Rebind has loaded. Stop one with
`rebind script stop` and its ID or path; see [script](https://docs.rebind.gg/reference/cli.md#script).

![Terminal output of rebind ps showing two running instances, clock.luau and packages/hello/main.luau, each with an ID, uptime, heap size, and tick time](https://mintcdn.com/rebind/mk4-exzrQ1Bh6kZJ/images/app/cli-ps.png?fit=max\&auto=format\&n=mk4-exzrQ1Bh6kZJ\&q=85\&s=ac9325fb8428545f38de5378d27ef631)

Two scripts loaded from the scripts folder.

## Watch the logs

`rebind logs` streams new log lines from Rebind and every running script.
`--level` and `--script` narrow the stream; see [logs](https://docs.rebind.gg/reference/cli.md#logs).

![Terminal output of rebind logs streaming one info line per second from clock.luau](https://mintcdn.com/rebind/mk4-exzrQ1Bh6kZJ/images/app/cli-logs.png?fit=max\&auto=format\&n=mk4-exzrQ1Bh6kZJ\&q=85\&s=5088b65232a78a56bdab49312ec0bef0)

A script that logs the time every second.

## Try a line of Luau

`rebind exec` runs a chunk inside Rebind with the full SDK and prints what it
printed, then what it returned:

```
$ rebind exec 'return 19 + 23'
42
$ rebind exec 'print("hello") return rb.input.is_down("Shift")'
hello
false
```

`rebind repl` opens the same runtime as an interactive session.

## Ask the terminal agent

`rebind ai` is a coding agent for the scripts in the current folder. Describe
what you want in plain words. It shows its reasoning while it works and asks
before it writes a file or runs a command. Running Luau inside Rebind asks once
per session. Rebind's models are part of
[Rebind Pro](https://docs.rebind.gg/account/pro.md); [ai](https://docs.rebind.gg/reference/cli.md#ai) covers other models and the
session controls. Below, the request was "move my mouse in a circle".

![rebind ai at startup: the Rebind monogram, the version, the working folder, the signed-in account, the model, the keys, and the Spy panel on the right](https://mintcdn.com/rebind/mk4-exzrQ1Bh6kZJ/images/app/cli-ai-splash.png?fit=max\&auto=format\&n=mk4-exzrQ1Bh6kZJ\&q=85\&s=0d17f57d308abb78a7edd8c3d10075fb)

rebind ai opens with the folder it works in, the signed-in account, and the model.

![rebind ai showing the request move my mouse in a circle, followed by the agent's reasoning about using rb.run and rb.sleep to animate the movement](https://mintcdn.com/rebind/mk4-exzrQ1Bh6kZJ/images/app/cli-ai-thinking.png?fit=max\&auto=format\&n=mk4-exzrQ1Bh6kZJ\&q=85\&s=ec52bba3a354440da3eb501d6c9227c5)

The agent works out an approach before it acts.

![An exec\_lua approval box listing a Luau chunk that moves the pointer 80 small steps around a circle, with yes selected and no below it](https://mintcdn.com/rebind/mk4-exzrQ1Bh6kZJ/images/app/cli-ai-approve.png?fit=max\&auto=format\&n=mk4-exzrQ1Bh6kZJ\&q=85\&s=3f08e604863c3d1faca46598d560a99d)

It shows the Luau it wants to run and waits for yes or no.

![A run\_bash approval box for the command sleep 1.5, with yes and no](https://mintcdn.com/rebind/mk4-exzrQ1Bh6kZJ/images/app/cli-ai-command.png?fit=max\&auto=format\&n=mk4-exzrQ1Bh6kZJ\&q=85\&s=259985b00ad1e8febeac0af0d4b14912)

A shell command asks the same way. Here it waits for the circle to finish.

![The finished conversation: the exec\_lua call returning moving, sleep 1.5 exiting 0, a second exec\_lua call returning completed, and the reply Moved your mouse in a circle and completed the loop](https://mintcdn.com/rebind/mk4-exzrQ1Bh6kZJ/images/app/cli-ai-done.png?fit=max\&auto=format\&n=mk4-exzrQ1Bh6kZJ\&q=85\&s=7bd55eb044e1f6c15c58fea479bd4188)

Each step and its result stay in the conversation.

## Share it

When the package is ready, `rebind pack` builds a `.rbp` file you can hand to
someone, and `rebind publish` submits it to the marketplace. See
[pack](https://docs.rebind.gg/reference/cli.md#pack) and [Publishing scripts](https://docs.rebind.gg/marketplace/publishing.md).


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