towns-agent 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,140 @@
1
+ # towns-agent
2
+
3
+ CLI for creating and managing Towns Protocol bot projects.
4
+
5
+ ## Getting Started
6
+
7
+ 1. **`create`** — Create an app account. This gives you an `APP_ADDRESS` and `APP_PRIVATE_KEY`.
8
+ 2. **`init`** — Scaffold a new project. Use the app private key from step 1 to configure your server.
9
+ 3. **`setup`** — Once your app server is running, register its webhook URL and notification settings.
10
+
11
+ ## Commands
12
+
13
+ ### `init [project-name]`
14
+
15
+ Create a new bot project from a template.
16
+
17
+ ```bash
18
+ bun run cli init my-agent
19
+ bun run cli init my-agent --template quickstart
20
+ ```
21
+
22
+ Options:
23
+
24
+ - `-t, --template <name>` — Template to use (default: `quickstart`)
25
+
26
+ ### `create`
27
+
28
+ Create a new bot/app account. Prompts interactively for any values not provided as flags.
29
+
30
+ ```bash
31
+ # Interactive
32
+ bun run cli create --ownerPrivateKey 0xac09...
33
+
34
+ # Non-interactive
35
+ bun run cli create \
36
+ --ownerPrivateKey 0xac09... \
37
+ --username my-bot \
38
+ --displayName "My Bot" \
39
+ --description "A helpful bot" \
40
+ --imageUrl https://example.com/avatar.png
41
+ ```
42
+
43
+ Options:
44
+
45
+ - `-k, --ownerPrivateKey <key>` — Owner private key for authentication
46
+ - `-b, --bearerToken <token>` — Bearer token for authentication (prompted if neither key nor token provided)
47
+ - `-u, --username <name>` — Bot username
48
+ - `-n, --displayName <name>` — Bot display name
49
+ - `-d, --description <text>` — Bot description
50
+ - `-i, --imageUrl <url>` — Bot image URL
51
+
52
+ Outputs `APP_ADDRESS`, `APP_PRIVATE_KEY`, `APP_PRIVATE_DATA`, and `JWT_SECRET`.
53
+
54
+ ### `setup <appAddress>`
55
+
56
+ Register a webhook URL and configure notification settings for an app.
57
+
58
+ ```bash
59
+ # Interactive — prompts for webhook URL and notify setting
60
+ bun run cli setup 0xAPP_ADDRESS --ownerPrivateKey 0xac09...
61
+
62
+ # Non-interactive
63
+ bun run cli setup 0xAPP_ADDRESS \
64
+ --ownerPrivateKey 0xac09... \
65
+ --webhookUrl https://example.com/webhook \
66
+ --notify ALL
67
+ ```
68
+
69
+ Options:
70
+
71
+ - `-k, --ownerPrivateKey <key>` — Owner private key for authentication
72
+ - `-b, --bearerToken <token>` — Bearer token for authentication (prompted if neither key nor token provided)
73
+ - `-w, --webhookUrl <url>` — Webhook URL to register
74
+ - `--notify <value>` — Notification setting (default: `ALL`)
75
+ - `ALL` — Forward all messages
76
+ - `MENTION_REPLY_REACTION` — Forward mentions, replies, and reactions only
77
+ - `NONE` — Forward no messages
78
+
79
+ ### `metadata <view|update> <appAddress>`
80
+
81
+ View or update app metadata.
82
+
83
+ ```bash
84
+ # View metadata (no auth required)
85
+ bun run cli metadata view 0xAPP_ADDRESS
86
+
87
+ # Update interactively
88
+ bun run cli metadata update 0xAPP_ADDRESS --ownerPrivateKey 0xac09...
89
+
90
+ # Update non-interactively
91
+ bun run cli metadata update 0xAPP_ADDRESS \
92
+ --ownerPrivateKey 0xac09... \
93
+ --displayName "New Name" \
94
+ --description "Updated description"
95
+ ```
96
+
97
+ Options:
98
+
99
+ - `-k, --ownerPrivateKey <key>` — Owner private key for authentication (required for update)
100
+ - `-b, --bearerToken <token>` — Bearer token for authentication (required for update)
101
+ - `-u, --username <name>` — Username
102
+ - `-n, --displayName <name>` — Display name
103
+ - `-d, --description <text>` — Description
104
+ - `-i, --imageUrl <url>` — Image URL
105
+ - `-a, --avatarUrl <url>` — Avatar URL
106
+ - `-e, --externalUrl <url>` — External URL
107
+ - `-m, --motto <text>` — Motto
108
+
109
+ ### `update`
110
+
111
+ Update `@towns-labs/*` dependencies and skills to latest versions.
112
+
113
+ ```bash
114
+ bun run cli update
115
+ ```
116
+
117
+ Options:
118
+
119
+ - `--skip-agents-md` — Skip updating the AGENTS.md file
120
+
121
+ ### `install-skill`
122
+
123
+ Install Towns Agent Skills into the current project.
124
+
125
+ ```bash
126
+ bun run cli install-skill
127
+ ```
128
+
129
+ ## Authentication
130
+
131
+ Commands that modify app state (`create`, `setup`, `metadata update`) require authentication via one of:
132
+
133
+ - **`-k, --ownerPrivateKey`** — A hex-encoded private key that owns the app
134
+ - **`-b, --bearerToken`** — A bearer token
135
+
136
+ If neither flag is provided, the CLI will prompt for a bearer token interactively.
137
+
138
+ ## Global Options
139
+
140
+ - `-h, --help` — Show help message