superacli 1.1.5 → 1.1.6

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.
Files changed (191) hide show
  1. package/__tests__/resend-plugin.test.js +22 -1
  2. package/package.json +1 -1
  3. package/plugins/plugins.json +2 -2
  4. package/plugins/resend/plugin.json +279 -2
  5. package/plugins/resend/skills/quickstart/SKILL.md +32 -13
  6. package/temp_resend_cli/repo/.github/scripts/pr-title-check.js +34 -0
  7. package/temp_resend_cli/repo/.github/workflows/ci.yml +67 -0
  8. package/temp_resend_cli/repo/.github/workflows/post-release.yml +51 -0
  9. package/temp_resend_cli/repo/.github/workflows/pr-title-check.yml +13 -0
  10. package/temp_resend_cli/repo/.github/workflows/release.yml +175 -0
  11. package/temp_resend_cli/repo/.github/workflows/test-install-unix.yml +34 -0
  12. package/temp_resend_cli/repo/.github/workflows/test-install-windows.yml +48 -0
  13. package/temp_resend_cli/repo/CHANGELOG.md +31 -0
  14. package/temp_resend_cli/repo/LICENSE +21 -0
  15. package/temp_resend_cli/repo/README.md +450 -0
  16. package/temp_resend_cli/repo/biome.json +36 -0
  17. package/temp_resend_cli/repo/install.ps1 +141 -0
  18. package/temp_resend_cli/repo/install.sh +301 -0
  19. package/temp_resend_cli/repo/package.json +61 -0
  20. package/temp_resend_cli/repo/pnpm-lock.yaml +2439 -0
  21. package/temp_resend_cli/repo/renovate.json +4 -0
  22. package/temp_resend_cli/repo/src/cli.ts +98 -0
  23. package/temp_resend_cli/repo/src/commands/api-keys/create.ts +114 -0
  24. package/temp_resend_cli/repo/src/commands/api-keys/delete.ts +47 -0
  25. package/temp_resend_cli/repo/src/commands/api-keys/index.ts +26 -0
  26. package/temp_resend_cli/repo/src/commands/api-keys/list.ts +35 -0
  27. package/temp_resend_cli/repo/src/commands/api-keys/utils.ts +8 -0
  28. package/temp_resend_cli/repo/src/commands/auth/index.ts +20 -0
  29. package/temp_resend_cli/repo/src/commands/auth/login.ts +234 -0
  30. package/temp_resend_cli/repo/src/commands/auth/logout.ts +105 -0
  31. package/temp_resend_cli/repo/src/commands/broadcasts/create.ts +196 -0
  32. package/temp_resend_cli/repo/src/commands/broadcasts/delete.ts +46 -0
  33. package/temp_resend_cli/repo/src/commands/broadcasts/get.ts +59 -0
  34. package/temp_resend_cli/repo/src/commands/broadcasts/index.ts +43 -0
  35. package/temp_resend_cli/repo/src/commands/broadcasts/list.ts +60 -0
  36. package/temp_resend_cli/repo/src/commands/broadcasts/send.ts +56 -0
  37. package/temp_resend_cli/repo/src/commands/broadcasts/update.ts +95 -0
  38. package/temp_resend_cli/repo/src/commands/broadcasts/utils.ts +35 -0
  39. package/temp_resend_cli/repo/src/commands/contact-properties/create.ts +118 -0
  40. package/temp_resend_cli/repo/src/commands/contact-properties/delete.ts +48 -0
  41. package/temp_resend_cli/repo/src/commands/contact-properties/get.ts +46 -0
  42. package/temp_resend_cli/repo/src/commands/contact-properties/index.ts +48 -0
  43. package/temp_resend_cli/repo/src/commands/contact-properties/list.ts +68 -0
  44. package/temp_resend_cli/repo/src/commands/contact-properties/update.ts +88 -0
  45. package/temp_resend_cli/repo/src/commands/contact-properties/utils.ts +17 -0
  46. package/temp_resend_cli/repo/src/commands/contacts/add-segment.ts +78 -0
  47. package/temp_resend_cli/repo/src/commands/contacts/create.ts +122 -0
  48. package/temp_resend_cli/repo/src/commands/contacts/delete.ts +49 -0
  49. package/temp_resend_cli/repo/src/commands/contacts/get.ts +53 -0
  50. package/temp_resend_cli/repo/src/commands/contacts/index.ts +58 -0
  51. package/temp_resend_cli/repo/src/commands/contacts/list.ts +57 -0
  52. package/temp_resend_cli/repo/src/commands/contacts/remove-segment.ts +48 -0
  53. package/temp_resend_cli/repo/src/commands/contacts/segments.ts +39 -0
  54. package/temp_resend_cli/repo/src/commands/contacts/topics.ts +45 -0
  55. package/temp_resend_cli/repo/src/commands/contacts/update-topics.ts +90 -0
  56. package/temp_resend_cli/repo/src/commands/contacts/update.ts +77 -0
  57. package/temp_resend_cli/repo/src/commands/contacts/utils.ts +119 -0
  58. package/temp_resend_cli/repo/src/commands/doctor.ts +216 -0
  59. package/temp_resend_cli/repo/src/commands/domains/create.ts +83 -0
  60. package/temp_resend_cli/repo/src/commands/domains/delete.ts +42 -0
  61. package/temp_resend_cli/repo/src/commands/domains/get.ts +47 -0
  62. package/temp_resend_cli/repo/src/commands/domains/index.ts +35 -0
  63. package/temp_resend_cli/repo/src/commands/domains/list.ts +53 -0
  64. package/temp_resend_cli/repo/src/commands/domains/update.ts +75 -0
  65. package/temp_resend_cli/repo/src/commands/domains/utils.ts +44 -0
  66. package/temp_resend_cli/repo/src/commands/domains/verify.ts +38 -0
  67. package/temp_resend_cli/repo/src/commands/emails/batch.ts +140 -0
  68. package/temp_resend_cli/repo/src/commands/emails/get.ts +44 -0
  69. package/temp_resend_cli/repo/src/commands/emails/index.ts +30 -0
  70. package/temp_resend_cli/repo/src/commands/emails/list.ts +84 -0
  71. package/temp_resend_cli/repo/src/commands/emails/receiving/attachment.ts +55 -0
  72. package/temp_resend_cli/repo/src/commands/emails/receiving/attachments.ts +68 -0
  73. package/temp_resend_cli/repo/src/commands/emails/receiving/get.ts +58 -0
  74. package/temp_resend_cli/repo/src/commands/emails/receiving/index.ts +28 -0
  75. package/temp_resend_cli/repo/src/commands/emails/receiving/list.ts +59 -0
  76. package/temp_resend_cli/repo/src/commands/emails/receiving/utils.ts +38 -0
  77. package/temp_resend_cli/repo/src/commands/emails/send.ts +189 -0
  78. package/temp_resend_cli/repo/src/commands/open.ts +27 -0
  79. package/temp_resend_cli/repo/src/commands/segments/create.ts +50 -0
  80. package/temp_resend_cli/repo/src/commands/segments/delete.ts +47 -0
  81. package/temp_resend_cli/repo/src/commands/segments/get.ts +38 -0
  82. package/temp_resend_cli/repo/src/commands/segments/index.ts +36 -0
  83. package/temp_resend_cli/repo/src/commands/segments/list.ts +58 -0
  84. package/temp_resend_cli/repo/src/commands/segments/utils.ts +7 -0
  85. package/temp_resend_cli/repo/src/commands/teams/index.ts +10 -0
  86. package/temp_resend_cli/repo/src/commands/teams/list.ts +35 -0
  87. package/temp_resend_cli/repo/src/commands/teams/remove.ts +86 -0
  88. package/temp_resend_cli/repo/src/commands/teams/switch.ts +76 -0
  89. package/temp_resend_cli/repo/src/commands/topics/create.ts +73 -0
  90. package/temp_resend_cli/repo/src/commands/topics/delete.ts +47 -0
  91. package/temp_resend_cli/repo/src/commands/topics/get.ts +42 -0
  92. package/temp_resend_cli/repo/src/commands/topics/index.ts +42 -0
  93. package/temp_resend_cli/repo/src/commands/topics/list.ts +34 -0
  94. package/temp_resend_cli/repo/src/commands/topics/update.ts +59 -0
  95. package/temp_resend_cli/repo/src/commands/topics/utils.ts +16 -0
  96. package/temp_resend_cli/repo/src/commands/webhooks/create.ts +128 -0
  97. package/temp_resend_cli/repo/src/commands/webhooks/delete.ts +49 -0
  98. package/temp_resend_cli/repo/src/commands/webhooks/get.ts +42 -0
  99. package/temp_resend_cli/repo/src/commands/webhooks/index.ts +42 -0
  100. package/temp_resend_cli/repo/src/commands/webhooks/list.ts +55 -0
  101. package/temp_resend_cli/repo/src/commands/webhooks/listen.ts +379 -0
  102. package/temp_resend_cli/repo/src/commands/webhooks/update.ts +83 -0
  103. package/temp_resend_cli/repo/src/commands/webhooks/utils.ts +36 -0
  104. package/temp_resend_cli/repo/src/commands/whoami.ts +71 -0
  105. package/temp_resend_cli/repo/src/lib/actions.ts +157 -0
  106. package/temp_resend_cli/repo/src/lib/client.ts +37 -0
  107. package/temp_resend_cli/repo/src/lib/config.ts +217 -0
  108. package/temp_resend_cli/repo/src/lib/files.ts +15 -0
  109. package/temp_resend_cli/repo/src/lib/help-text.ts +38 -0
  110. package/temp_resend_cli/repo/src/lib/output.ts +56 -0
  111. package/temp_resend_cli/repo/src/lib/pagination.ts +36 -0
  112. package/temp_resend_cli/repo/src/lib/prompts.ts +149 -0
  113. package/temp_resend_cli/repo/src/lib/spinner.ts +100 -0
  114. package/temp_resend_cli/repo/src/lib/table.ts +57 -0
  115. package/temp_resend_cli/repo/src/lib/tty.ts +28 -0
  116. package/temp_resend_cli/repo/src/lib/update-check.ts +169 -0
  117. package/temp_resend_cli/repo/src/lib/version.ts +4 -0
  118. package/temp_resend_cli/repo/tests/commands/api-keys/create.test.ts +196 -0
  119. package/temp_resend_cli/repo/tests/commands/api-keys/delete.test.ts +157 -0
  120. package/temp_resend_cli/repo/tests/commands/api-keys/list.test.ts +134 -0
  121. package/temp_resend_cli/repo/tests/commands/auth/login.test.ts +153 -0
  122. package/temp_resend_cli/repo/tests/commands/auth/logout.test.ts +153 -0
  123. package/temp_resend_cli/repo/tests/commands/broadcasts/create.test.ts +454 -0
  124. package/temp_resend_cli/repo/tests/commands/broadcasts/delete.test.ts +183 -0
  125. package/temp_resend_cli/repo/tests/commands/broadcasts/get.test.ts +147 -0
  126. package/temp_resend_cli/repo/tests/commands/broadcasts/list.test.ts +199 -0
  127. package/temp_resend_cli/repo/tests/commands/broadcasts/send.test.ts +162 -0
  128. package/temp_resend_cli/repo/tests/commands/broadcasts/update.test.ts +288 -0
  129. package/temp_resend_cli/repo/tests/commands/contact-properties/create.test.ts +251 -0
  130. package/temp_resend_cli/repo/tests/commands/contact-properties/delete.test.ts +184 -0
  131. package/temp_resend_cli/repo/tests/commands/contact-properties/get.test.ts +145 -0
  132. package/temp_resend_cli/repo/tests/commands/contact-properties/list.test.ts +181 -0
  133. package/temp_resend_cli/repo/tests/commands/contact-properties/update.test.ts +217 -0
  134. package/temp_resend_cli/repo/tests/commands/contacts/add-segment.test.ts +189 -0
  135. package/temp_resend_cli/repo/tests/commands/contacts/create.test.ts +271 -0
  136. package/temp_resend_cli/repo/tests/commands/contacts/delete.test.ts +193 -0
  137. package/temp_resend_cli/repo/tests/commands/contacts/get.test.ts +149 -0
  138. package/temp_resend_cli/repo/tests/commands/contacts/list.test.ts +176 -0
  139. package/temp_resend_cli/repo/tests/commands/contacts/remove-segment.test.ts +167 -0
  140. package/temp_resend_cli/repo/tests/commands/contacts/segments.test.ts +168 -0
  141. package/temp_resend_cli/repo/tests/commands/contacts/topics.test.ts +164 -0
  142. package/temp_resend_cli/repo/tests/commands/contacts/update-topics.test.ts +248 -0
  143. package/temp_resend_cli/repo/tests/commands/contacts/update.test.ts +206 -0
  144. package/temp_resend_cli/repo/tests/commands/doctor.test.ts +164 -0
  145. package/temp_resend_cli/repo/tests/commands/domains/create.test.ts +193 -0
  146. package/temp_resend_cli/repo/tests/commands/domains/delete.test.ts +157 -0
  147. package/temp_resend_cli/repo/tests/commands/domains/get.test.ts +138 -0
  148. package/temp_resend_cli/repo/tests/commands/domains/list.test.ts +165 -0
  149. package/temp_resend_cli/repo/tests/commands/domains/update.test.ts +224 -0
  150. package/temp_resend_cli/repo/tests/commands/domains/verify.test.ts +118 -0
  151. package/temp_resend_cli/repo/tests/commands/emails/batch.test.ts +324 -0
  152. package/temp_resend_cli/repo/tests/commands/emails/get.test.ts +132 -0
  153. package/temp_resend_cli/repo/tests/commands/emails/receiving/attachment.test.ts +141 -0
  154. package/temp_resend_cli/repo/tests/commands/emails/receiving/attachments.test.ts +169 -0
  155. package/temp_resend_cli/repo/tests/commands/emails/receiving/get.test.ts +141 -0
  156. package/temp_resend_cli/repo/tests/commands/emails/receiving/list.test.ts +182 -0
  157. package/temp_resend_cli/repo/tests/commands/emails/send.test.ts +312 -0
  158. package/temp_resend_cli/repo/tests/commands/segments/create.test.ts +164 -0
  159. package/temp_resend_cli/repo/tests/commands/segments/delete.test.ts +183 -0
  160. package/temp_resend_cli/repo/tests/commands/segments/get.test.ts +138 -0
  161. package/temp_resend_cli/repo/tests/commands/segments/list.test.ts +174 -0
  162. package/temp_resend_cli/repo/tests/commands/teams/list.test.ts +62 -0
  163. package/temp_resend_cli/repo/tests/commands/teams/remove.test.ts +110 -0
  164. package/temp_resend_cli/repo/tests/commands/teams/switch.test.ts +103 -0
  165. package/temp_resend_cli/repo/tests/commands/topics/create.test.ts +192 -0
  166. package/temp_resend_cli/repo/tests/commands/topics/delete.test.ts +157 -0
  167. package/temp_resend_cli/repo/tests/commands/topics/get.test.ts +126 -0
  168. package/temp_resend_cli/repo/tests/commands/topics/list.test.ts +125 -0
  169. package/temp_resend_cli/repo/tests/commands/topics/update.test.ts +178 -0
  170. package/temp_resend_cli/repo/tests/commands/webhooks/create.test.ts +225 -0
  171. package/temp_resend_cli/repo/tests/commands/webhooks/delete.test.ts +157 -0
  172. package/temp_resend_cli/repo/tests/commands/webhooks/get.test.ts +126 -0
  173. package/temp_resend_cli/repo/tests/commands/webhooks/list.test.ts +178 -0
  174. package/temp_resend_cli/repo/tests/commands/webhooks/update.test.ts +207 -0
  175. package/temp_resend_cli/repo/tests/commands/whoami.test.ts +98 -0
  176. package/temp_resend_cli/repo/tests/e2e/smoke.test.ts +93 -0
  177. package/temp_resend_cli/repo/tests/helpers.ts +86 -0
  178. package/temp_resend_cli/repo/tests/lib/client.test.ts +71 -0
  179. package/temp_resend_cli/repo/tests/lib/config.test.ts +451 -0
  180. package/temp_resend_cli/repo/tests/lib/files.test.ts +73 -0
  181. package/temp_resend_cli/repo/tests/lib/help-text.test.ts +97 -0
  182. package/temp_resend_cli/repo/tests/lib/output.test.ts +136 -0
  183. package/temp_resend_cli/repo/tests/lib/prompts.test.ts +185 -0
  184. package/temp_resend_cli/repo/tests/lib/spinner.test.ts +166 -0
  185. package/temp_resend_cli/repo/tests/lib/table.test.ts +63 -0
  186. package/temp_resend_cli/repo/tests/lib/tty.test.ts +89 -0
  187. package/temp_resend_cli/repo/tests/lib/update-check.test.ts +179 -0
  188. package/temp_resend_cli/repo/tsconfig.json +14 -0
  189. package/temp_resend_cli/repo/vitest.config.e2e.ts +8 -0
  190. package/temp_resend_cli/repo/vitest.config.ts +10 -0
  191. package/tests/test-resend-smoke.sh +7 -3
@@ -0,0 +1,301 @@
1
+ #!/usr/bin/env bash
2
+ # Resend CLI installer
3
+ #
4
+ # Usage:
5
+ # curl -fsSL https://resend.com/install.sh | bash
6
+ # curl -fsSL https://resend.com/install.sh | bash -s v0.1.0
7
+ #
8
+ # Environment variables:
9
+ # RESEND_INSTALL - Custom install directory (default: ~/.resend)
10
+ # GITHUB_BASE - Custom GitHub base URL (default: https://github.com)
11
+
12
+ # Wrap everything in a function to protect against partial download.
13
+ # If the connection drops mid-transfer, bash won't execute a truncated script.
14
+ main() {
15
+
16
+ set -euo pipefail
17
+
18
+ # ─── Colors (only when outputting to a terminal) ─────────────────────────────
19
+
20
+ Color_Off='' Red='' Green='' Dim='' Bold='' Blue='' Yellow=''
21
+
22
+ if [[ -t 1 ]]; then
23
+ Color_Off='\033[0m'
24
+ Red='\033[0;31m'
25
+ Green='\033[0;32m'
26
+ Yellow='\033[0;33m'
27
+ Dim='\033[0;2m'
28
+ Bold='\033[1m'
29
+ Blue='\033[0;34m'
30
+ fi
31
+
32
+ # ─── Helpers ─────────────────────────────────────────────────────────────────
33
+
34
+ error() {
35
+ printf "%b\n" "${Red}error${Color_Off}: $*" >&2
36
+ exit 1
37
+ }
38
+
39
+ warn() {
40
+ printf "%b\n" "${Yellow}warn${Color_Off}: $*" >&2
41
+ }
42
+
43
+ info() {
44
+ printf "%b\n" "${Dim}$*${Color_Off}"
45
+ }
46
+
47
+ success() {
48
+ printf "%b\n" "${Green}$*${Color_Off}"
49
+ }
50
+
51
+ bold() {
52
+ printf "%b\n" "${Bold}$*${Color_Off}"
53
+ }
54
+
55
+ tildify() {
56
+ if [[ $1 == "$HOME"/* ]]; then
57
+ echo "~${1#"$HOME"}"
58
+ else
59
+ echo "$1"
60
+ fi
61
+ }
62
+
63
+ # ─── Dependency checks ──────────────────────────────────────────────────────
64
+
65
+ command -v curl >/dev/null 2>&1 || error "curl is required but not found. Install it and try again."
66
+ command -v tar >/dev/null 2>&1 || error "tar is required but not found. Install it and try again."
67
+
68
+ # ─── OS / Architecture detection ────────────────────────────────────────────
69
+
70
+ platform=$(uname -ms)
71
+
72
+ case $platform in
73
+ 'Darwin x86_64') target=darwin-x64 ;;
74
+ 'Darwin arm64') target=darwin-arm64 ;;
75
+ 'Linux aarch64') target=linux-arm64 ;;
76
+ 'Linux arm64') target=linux-arm64 ;;
77
+ 'Linux x86_64') target=linux-x64 ;;
78
+ *)
79
+ error "Unsupported platform: ${platform}.
80
+
81
+ Resend CLI supports:
82
+ - macOS (Apple Silicon / Intel)
83
+ - Linux (x64 / arm64)
84
+
85
+ For Windows, run this in PowerShell:
86
+ irm https://resend.com/install.ps1 | iex"
87
+ ;;
88
+ esac
89
+
90
+ # Detect Rosetta 2 on macOS — prefer native arm64 binary
91
+ if [[ $target == "darwin-x64" ]]; then
92
+ if [[ $(sysctl -n sysctl.proc_translated 2>/dev/null || echo 0) == "1" ]]; then
93
+ target=darwin-arm64
94
+ info " Rosetta 2 detected — installing native arm64 binary"
95
+ fi
96
+ fi
97
+
98
+ # Detect musl (Alpine Linux) — glibc binaries won't work
99
+ if [[ $target == linux-* ]]; then
100
+ if ldd --version 2>&1 | grep -qi musl 2>/dev/null; then
101
+ error "Alpine Linux (musl) is not currently supported.
102
+
103
+ The compiled binary requires glibc. Use one of these alternatives:
104
+ - pnpm add -g resend-cli
105
+ - Run in a glibc-based container (e.g., ubuntu, debian)"
106
+ fi
107
+ fi
108
+
109
+ # ─── Version + Download URL ─────────────────────────────────────────────────
110
+
111
+ GITHUB_BASE=${GITHUB_BASE:-"https://github.com"}
112
+
113
+ # Validate GITHUB_BASE is HTTPS to prevent download from arbitrary sources
114
+ case "$GITHUB_BASE" in
115
+ https://*) ;;
116
+ *) error "GITHUB_BASE must start with https:// (got: ${GITHUB_BASE})" ;;
117
+ esac
118
+
119
+ REPO="${GITHUB_BASE}/resend/resend-cli"
120
+
121
+ VERSION=${1:-}
122
+
123
+ # Validate version format if provided
124
+ if [[ -n $VERSION ]]; then
125
+ # Strip leading 'v' if present, then re-add for the tag
126
+ VERSION="${VERSION#v}"
127
+ if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then
128
+ error "Invalid version format: ${VERSION}
129
+
130
+ Expected: semantic version like 0.1.0 or 1.2.3-beta.1
131
+ Usage: curl -fsSL https://resend.com/install.sh | bash -s v0.1.0"
132
+ fi
133
+ url="${REPO}/releases/download/v${VERSION}/resend-${target}.tar.gz"
134
+ else
135
+ url="${REPO}/releases/latest/download/resend-${target}.tar.gz"
136
+ fi
137
+
138
+ # ─── Install directory ──────────────────────────────────────────────────────
139
+
140
+ install_dir="${RESEND_INSTALL:-$HOME/.resend}"
141
+ bin_dir="${install_dir}/bin"
142
+ exe="${bin_dir}/resend"
143
+
144
+ mkdir -p "$bin_dir" || error "Failed to create install directory: ${bin_dir}"
145
+
146
+ # ─── Download + Extract ─────────────────────────────────────────────────────
147
+
148
+ echo ""
149
+ bold " Installing Resend CLI..."
150
+ echo ""
151
+
152
+ tmpdir=$(mktemp -d) || error "Failed to create temporary directory"
153
+ trap 'rm -rf "$tmpdir"' EXIT INT TERM
154
+
155
+ tmpfile="${tmpdir}/resend.tar.gz"
156
+
157
+ info " Downloading from ${url}"
158
+ echo ""
159
+
160
+ curl --fail --location --progress-bar --output "$tmpfile" "$url" ||
161
+ error "Download failed.
162
+
163
+ Possible causes:
164
+ - No internet connection
165
+ - The version does not exist: ${VERSION:-latest}
166
+ - GitHub is unreachable
167
+
168
+ URL: ${url}"
169
+
170
+ tar -xzf "$tmpfile" -C "$bin_dir" ||
171
+ error "Failed to extract archive. The download may be corrupted — try again."
172
+
173
+ chmod +x "$exe" || error "Failed to make binary executable"
174
+
175
+ # Strip macOS Gatekeeper quarantine flag (set automatically on curl downloads)
176
+ # Without this, macOS will block the binary: "cannot be opened because Apple
177
+ # cannot check it for malicious software"
178
+ if [[ $(uname -s) == "Darwin" ]]; then
179
+ xattr -d com.apple.quarantine "$exe" 2>/dev/null || true
180
+ fi
181
+
182
+ # ─── Verify installation ────────────────────────────────────────────────────
183
+
184
+ installed_version=$("$exe" --version 2>/dev/null || echo "unknown")
185
+
186
+ echo ""
187
+ success " Resend CLI ${installed_version} installed successfully!"
188
+ echo ""
189
+ info " Binary: $(tildify "$exe")"
190
+
191
+ # ─── PATH setup ─────────────────────────────────────────────────────────────
192
+
193
+ # Check if already on PATH
194
+ if command -v resend >/dev/null 2>&1; then
195
+ existing=$(command -v resend)
196
+ if [[ "$existing" == "$exe" ]]; then
197
+ echo ""
198
+ bold " Run ${Blue}resend --help${Color_Off}${Bold} to get started${Color_Off}"
199
+ echo ""
200
+ exit 0
201
+ else
202
+ warn "another 'resend' was found at ${existing}"
203
+ info " The new installation at $(tildify "$exe") may be shadowed."
204
+ fi
205
+ fi
206
+
207
+ # Check if bin_dir is already in PATH
208
+ if echo "$PATH" | tr ':' '\n' | grep -qxF "${bin_dir}" 2>/dev/null; then
209
+ echo ""
210
+ bold " Run ${Blue}resend --help${Color_Off}${Bold} to get started${Color_Off}"
211
+ echo ""
212
+ exit 0
213
+ fi
214
+
215
+ # Determine shell config file
216
+ shell_name=$(basename "${SHELL:-}")
217
+ config=""
218
+ shell_line=""
219
+
220
+ # Build a $HOME-relative path for shell config (~ doesn't expand inside quotes)
221
+ if [[ $bin_dir == "$HOME"/* ]]; then
222
+ shell_bin_dir="\$HOME${bin_dir#"$HOME"}"
223
+ else
224
+ shell_bin_dir="$bin_dir"
225
+ fi
226
+
227
+ case $shell_name in
228
+ zsh)
229
+ config="${ZDOTDIR:-$HOME}/.zshrc"
230
+ shell_line="export PATH=\"${shell_bin_dir}:\$PATH\""
231
+ ;;
232
+ bash)
233
+ # macOS bash opens login shells — .bash_profile is loaded, not .bashrc.
234
+ # Linux bash opens non-login interactive shells — .bashrc is preferred.
235
+ if [[ $(uname -s) == "Darwin" ]]; then
236
+ if [[ -f "$HOME/.bash_profile" ]]; then
237
+ config="$HOME/.bash_profile"
238
+ elif [[ -f "$HOME/.bashrc" ]]; then
239
+ config="$HOME/.bashrc"
240
+ else
241
+ config="$HOME/.bash_profile"
242
+ fi
243
+ else
244
+ if [[ -f "$HOME/.bashrc" ]]; then
245
+ config="$HOME/.bashrc"
246
+ elif [[ -f "$HOME/.bash_profile" ]]; then
247
+ config="$HOME/.bash_profile"
248
+ else
249
+ config="$HOME/.bashrc"
250
+ fi
251
+ fi
252
+ shell_line="export PATH=\"${shell_bin_dir}:\$PATH\""
253
+ ;;
254
+ fish)
255
+ config="${XDG_CONFIG_HOME:-$HOME/.config}/fish/conf.d/resend.fish"
256
+ mkdir -p "$(dirname "$config")"
257
+ shell_line="fish_add_path ${shell_bin_dir}"
258
+ ;;
259
+ esac
260
+
261
+ if [[ -n $config ]]; then
262
+ # Check if PATH entry already exists (check both tildified and absolute)
263
+ if [[ -f "$config" ]] && (grep -qF "$(tildify "$bin_dir")" "$config" 2>/dev/null || grep -qF "$bin_dir" "$config" 2>/dev/null); then
264
+ info " PATH already configured in $(tildify "$config")"
265
+ elif [[ -w "${config%/*}" ]] || [[ -w "$config" ]]; then
266
+ {
267
+ echo ""
268
+ echo "# Resend CLI"
269
+ echo "$shell_line"
270
+ } >> "$config"
271
+ info " Added $(tildify "$bin_dir") to \$PATH in $(tildify "$config")"
272
+ echo ""
273
+ info " To start using Resend CLI, run:"
274
+ echo ""
275
+ bold " source $(tildify "$config")"
276
+ bold " resend --help"
277
+ else
278
+ echo ""
279
+ info " Manually add to your shell config:"
280
+ echo ""
281
+ bold " ${shell_line}"
282
+ fi
283
+ else
284
+ echo ""
285
+ info " Add to your shell config:"
286
+ echo ""
287
+ bold " export PATH=\"${shell_bin_dir}:\$PATH\""
288
+ fi
289
+
290
+ echo ""
291
+ info " Next steps:"
292
+ echo ""
293
+ bold " export RESEND_API_KEY=re_..."
294
+ bold " resend --help"
295
+ echo ""
296
+
297
+ }
298
+
299
+ # Run the installer — this line MUST be the last line in the file.
300
+ # If the download is interrupted, bash will not execute an incomplete function.
301
+ main "$@"
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "resend-cli",
3
+ "version": "1.2.2",
4
+ "description": "The official CLI for Resend",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/resend/resend-cli"
9
+ },
10
+ "homepage": "https://github.com/resend/resend-cli#readme",
11
+ "keywords": [
12
+ "cli",
13
+ "resend",
14
+ "email",
15
+ "api"
16
+ ],
17
+ "engines": {
18
+ "node": ">=20"
19
+ },
20
+ "packageManager": "pnpm@10.11.0",
21
+ "files": [
22
+ "dist/cli.cjs"
23
+ ],
24
+ "type": "module",
25
+ "bin": {
26
+ "resend": "./dist/cli.cjs"
27
+ },
28
+ "scripts": {
29
+ "dev": "tsx src/cli.ts",
30
+ "dev:watch": "tsx --watch src/cli.ts",
31
+ "build": "esbuild src/cli.ts --bundle --platform=node --format=cjs --minify --outfile=dist/cli.cjs",
32
+ "build:bin": "pnpm build && pkg dist/cli.cjs --compress Brotli --target node24 --output dist/resend",
33
+ "lint": "biome check",
34
+ "format": "biome format --write",
35
+ "typecheck": "tsc --noEmit",
36
+ "test": "vitest run",
37
+ "test:e2e": "vitest run --config vitest.config.e2e.ts"
38
+ },
39
+ "dependencies": {
40
+ "@clack/prompts": "1.1.0",
41
+ "@commander-js/extra-typings": "14.0.0",
42
+ "commander": "14.0.3",
43
+ "picocolors": "^1.1.1",
44
+ "resend": "6.9.3"
45
+ },
46
+ "pnpm": {
47
+ "onlyBuiltDependencies": [
48
+ "esbuild",
49
+ "@biomejs/biome"
50
+ ]
51
+ },
52
+ "devDependencies": {
53
+ "@biomejs/biome": "2.4.6",
54
+ "@types/node": "22.19.15",
55
+ "esbuild": "0.27.3",
56
+ "tsx": "4.19.4",
57
+ "typescript": "5.9.3",
58
+ "vitest": "3.1.4",
59
+ "@yao-pkg/pkg": "6.14.1"
60
+ }
61
+ }