@usetransactional/cli 0.1.0

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,161 @@
1
+ # transactional-cli
2
+
3
+ Official command-line interface for [Transactional](https://usetransactional.com) - manage email, SMS, forms, and more from your terminal.
4
+
5
+ [![npm version](https://badge.fury.io/js/transactional-cli.svg)](https://www.npmjs.com/package/transactional-cli)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install -g transactional-cli
12
+ ```
13
+
14
+ Or using npx without installation:
15
+
16
+ ```bash
17
+ npx transactional-cli login
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ 1. **Authenticate**
23
+ ```bash
24
+ transactional login
25
+ ```
26
+ This opens your browser to authenticate and link the CLI to your Transactional organization.
27
+
28
+ 2. **Send an email**
29
+ ```bash
30
+ transactional email send \
31
+ --from "sender@example.com" \
32
+ --to "recipient@example.com" \
33
+ --subject "Hello from CLI" \
34
+ --text "This is a test email"
35
+ ```
36
+
37
+ 3. **Check your user info**
38
+ ```bash
39
+ transactional whoami
40
+ ```
41
+
42
+ ## Commands
43
+
44
+ ### Authentication
45
+
46
+ | Command | Description |
47
+ |---------|-------------|
48
+ | `transactional login` | Authenticate with Transactional |
49
+ | `transactional logout` | Log out from all organizations |
50
+ | `transactional whoami` | Show current user and organization |
51
+ | `transactional switch [org]` | Switch to a different organization |
52
+ | `transactional orgs list` | List all authenticated organizations |
53
+
54
+ ### Email
55
+
56
+ | Command | Description |
57
+ |---------|-------------|
58
+ | `transactional email send` | Send a single email |
59
+ | `transactional email batch <file>` | Send batch emails from JSON file |
60
+ | `transactional email stats` | Get email statistics |
61
+ | `transactional email templates list` | List email templates |
62
+ | `transactional email templates get <id>` | Get template details |
63
+ | `transactional email templates create` | Create a new template |
64
+ | `transactional email domains list` | List email domains |
65
+ | `transactional email domains add <domain>` | Add a domain |
66
+ | `transactional email senders list` | List email senders |
67
+ | `transactional email suppressions list` | List suppressions |
68
+
69
+ ### Configuration
70
+
71
+ | Command | Description |
72
+ |---------|-------------|
73
+ | `transactional config show` | Show current configuration |
74
+ | `transactional config set <key> <value>` | Set a configuration value |
75
+ | `transactional config get <key>` | Get a configuration value |
76
+ | `transactional config reset` | Reset to default configuration |
77
+ | `transactional config path` | Show configuration file paths |
78
+
79
+ ## Global Options
80
+
81
+ | Option | Description |
82
+ |--------|-------------|
83
+ | `-o, --org <slug>` | Override the current organization |
84
+ | `--json` | Output results as JSON |
85
+ | `--help` | Show help for a command |
86
+ | `--version` | Show CLI version |
87
+
88
+ ## Configuration
89
+
90
+ Configuration is stored in `~/.transactional/config.json`:
91
+
92
+ | Key | Description | Default |
93
+ |-----|-------------|---------|
94
+ | `apiUrl` | API base URL | `https://api.usetransactional.com` |
95
+ | `webUrl` | Web app URL | `https://app.usetransactional.com` |
96
+ | `outputFormat` | Output format (table, json, yaml) | `table` |
97
+ | `color` | Enable color output | `true` |
98
+
99
+ ## Environment Variables
100
+
101
+ | Variable | Description |
102
+ |----------|-------------|
103
+ | `TRANSACTIONAL_API_URL` | Override API URL |
104
+ | `TRANSACTIONAL_WEB_URL` | Override web URL |
105
+ | `NO_COLOR` | Disable color output |
106
+ | `TRANSACTIONAL_NO_COLOR` | Disable color output |
107
+
108
+ ## Credentials
109
+
110
+ Credentials are stored securely in `~/.transactional/credentials.json` with file permissions set to `0600` (read/write for owner only).
111
+
112
+ ## Examples
113
+
114
+ ### Send email with template
115
+
116
+ ```bash
117
+ transactional email send \
118
+ --from "noreply@example.com" \
119
+ --to "user@example.com" \
120
+ --template-alias "welcome" \
121
+ --model '{"name": "John", "company": "Acme"}'
122
+ ```
123
+
124
+ ### Send batch emails
125
+
126
+ Create a file `emails.json`:
127
+ ```json
128
+ [
129
+ {
130
+ "from": "noreply@example.com",
131
+ "to": "user1@example.com",
132
+ "subject": "Hello User 1",
133
+ "text": "Hello from batch!"
134
+ },
135
+ {
136
+ "from": "noreply@example.com",
137
+ "to": "user2@example.com",
138
+ "subject": "Hello User 2",
139
+ "text": "Hello from batch!"
140
+ }
141
+ ]
142
+ ```
143
+
144
+ Then send:
145
+ ```bash
146
+ transactional email batch emails.json
147
+ ```
148
+
149
+ ### Get stats as JSON
150
+
151
+ ```bash
152
+ transactional email stats --period month --json
153
+ ```
154
+
155
+ ## Documentation
156
+
157
+ Full documentation is available at [usetransactional.com/docs/cli](https://usetransactional.com/docs/cli)
158
+
159
+ ## License
160
+
161
+ MIT - see [LICENSE](LICENSE) for details.