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

# CLI & Lua development

> Develop Lua tools for your Atonom agents using the CLI and your coding assistant.

Write Lua in your editor, test its behavior, and make it available to your Atonom agent. The CLI connects your local scripts to the tools in your Atonom environment.

<CardGroup cols={2}>
  <Card title="Install the CLI" icon="terminal" href="/atonom-script/cli/install">
    Get the binary from the Atonom team and connect your workspace.
  </Card>

  <Card title="Build your first tool" icon="code" href="/atonom-script/cli/first-tool">
    Create a tool, write a transform, and verify its result.
  </Card>

  <Card title="Work with a coding agent" icon="robot" href="/atonom-script/cli/agents">
    Use a ready-to-copy task brief and development workflow.
  </Card>

  <Card title="Choose what to script" icon="minimize" href="/atonom-script/prompt-reduction">
    Move repeatable rules and logic out of your agent's prompt.
  </Card>
</CardGroup>

## The development loop

```sh theme={null}
atonom list --json
atonom pull 42
# Edit the file returned by pull.
atonom diff 42 --json
atonom push 42 --json
atonom run 42 --no-save --inputs '{"qty":2}' --json
```

`42` is an example **tool ID**. Use an ID from your own `list` output. If you have [sandbox access](/atonom-script/cli/install#connect-the-sandbox-optional), use `eval` to test local changes before saving.

<Warning>
  **Know which command saves**

  `push` saves your local script. `run` also saves by default, then executes it. Use `eval` to test a local file without saving, or `run --no-save` to execute the body already stored on the platform.
</Warning>

## How the pieces fit

**The CLI** connects your local `.lua` files to stored Lua script tools. Use it to download scripts, review changes, and test your tools from the terminal.

**A coding agent** works in your repository: it reads the contract, edits files, invokes the CLI, and inspects JSON results. No agent-specific integration is required beyond access to the CLI and workspace.

**An Atonom agent** owns and uses the Lua tool. It is distinct from the coding agent that helps you author the script.

**The sandbox** lets you test Lua with sample inputs and simulated tool responses. During a sandbox test, the CLI supplies those responses. During platform execution, Atonom handles calls to available tools and returns their results to your script.

## A small authoring contract

```lua theme={null}
function transform(context)
  local qty = context.qty or 0
  return { total = qty * 2 }
end
```

A stored script defines `transform(context)`. Inputs become `context`; the return value becomes the tool's JSON result. The [Lua guide](/atonom-script/cli/lua) covers validation, JSON helpers, and runtime limits.

## Find what you need

* **New environment:** [Install and connect](/atonom-script/cli/install).
* **Existing script:** [Sync changes and resolve conflicts](/atonom-script/cli/sync).
* **Tool calls:** [Test with mocked host responses](/atonom-script/cli/testing).
* **Flags and output:** [CLI reference](/atonom-script/cli/commands).
* **Something failed:** [Troubleshooting](/atonom-script/cli/troubleshooting).

Use the site search to find commands and examples. Use `atonom --help` to see the commands available in your installed version.


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