@trycourier/cli 3.1.4 → 3.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.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Courier CLI
2
+
3
+ The official CLI for the [Courier REST API](https://www.courier.com/docs). Manage notifications, templates, users, and more from the command line.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install -g @trycourier/cli
9
+ ```
10
+
11
+ ### Other install methods
12
+
13
+ - **Homebrew**: `brew install trycourier/courier/courier`
14
+ - **Go**: `go install github.com/trycourier/courier-cli/cmd/courier@latest`
15
+ - **Binary**: [GitHub Releases](https://github.com/trycourier/courier-cli/releases)
16
+
17
+ ## Usage
18
+
19
+ ```sh
20
+ export COURIER_API_KEY=your_api_key
21
+
22
+ courier send message --message.to.email "user@example.com" --message.template "my-template"
23
+ courier messages list
24
+ courier profiles retrieve --user-id "user-123"
25
+ ```
26
+
27
+ For details about specific commands, use `courier --help`.
28
+
29
+ ## How it works
30
+
31
+ This package downloads the platform-specific Courier CLI binary from [GitHub Releases](https://github.com/trycourier/courier-cli/releases) during `npm install`. No Node.js runtime dependency at execution time.
32
+
33
+ ## Documentation
34
+
35
+ - [Courier Docs](https://www.courier.com/docs)
36
+ - [CLI Repository](https://github.com/trycourier/courier-cli)
37
+ - [API Reference](https://www.courier.com/docs/reference)
package/bin/courier.js ADDED
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env node
2
+
3
+ "use strict";
4
+
5
+ const path = require("path");
6
+ const { execFileSync } = require("child_process");
7
+
8
+ const binary = process.platform === "win32" ? "courier.exe" : "courier";
9
+ const binPath = path.join(__dirname, binary);
10
+
11
+ try {
12
+ execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
13
+ } catch (err) {
14
+ if (err.status !== undefined) {
15
+ process.exit(err.status);
16
+ }
17
+ console.error(`Failed to run Courier CLI: ${err.message}`);
18
+ console.error(`Expected binary at: ${binPath}`);
19
+ console.error(`Try reinstalling: npm install -g @trycourier/cli`);
20
+ process.exit(1);
21
+ }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@trycourier/cli",
3
- "version": "3.1.4",
3
+ "version": "3.1.6",
4
4
  "description": "Courier CLI – manage notifications from the command line",
5
5
  "bin": {
6
- "courier": "./bin/courier"
6
+ "courier": "./bin/courier.js"
7
7
  },
8
8
  "scripts": {
9
9
  "postinstall": "node install.js"