# Automated Worx CLI

Run your [Automated Worx](https://automatedworx.com) AI agents from your own machine — in scripts, cron jobs, or a terminal.

## Install

```bash
# Run without installing (once published):
npx automatedworx <command>

# Or download the single file and run it directly:
curl -O https://automatedworx.com/cli/aw.mjs
node aw.mjs <command>
```

Requires Node 18+.

## Get your API key

Create a client API key at **https://automatedworx.com/api-keys.html**, then:

```bash
aw login aw_live_your_key_here
```

Your key is stored in `~/.aw/config.json`. You can also set `AW_API_KEY` in the environment instead.

## Commands

| Command | What it does |
|---|---|
| `aw login <api_key>` | Save your client API key |
| `aw whoami` | Show the saved key (masked) and API base |
| `aw agents` | List your agents (id, model, status, name) |
| `aw run <agent_id> [message]` | Run an agent — message from an argument or piped stdin |
| `aw export <agent_id> [file]` | Save an agent's portable config as JSON |
| `aw base <url>` | Point the CLI at a different API base |
| `aw help` | Show help |

## Examples

```bash
aw agents

# Run an agent with an inline message
aw run 12 "Summarize the latest changes on https://example.com"

# Pipe input from another command
cat leads.json | aw run 7

# Export an agent's config to share or self-host
aw export 12 ./billing-agent.json
```

## Notes

- The CLI talks to the same engine as the dashboard, so results are identical.
- Usage counts against your plan, just like the web app.
- Environment overrides: `AW_API_KEY`, `AW_BASE`.

MIT © Automated Worx
