1010<br />
1111
1212<div align =" center " >
13- <h3 align =" center " >SMS Gateway for Android™ CLI</h3 >
13+ <h3 align =" center " >SMSGate CLI</h3 >
1414
1515 <p align =" center " >
16- A command-line interface for interacting with the SMS Gateway for Android API
16+ A command-line interface for interacting with the SMSGate API
1717 <br />
1818 <a href="https://docs.sms-gate.app/integration/cli/"><strong>Explore the docs »</strong></a>
1919 <br />
4040 - [ Commands] ( #commands )
4141 - [ Exit codes] ( #exit-codes )
4242 - [ Examples] ( #examples )
43+ - [ Sending messages] ( #sending-messages )
44+ - [ Getting message status] ( #getting-message-status )
45+ - [ Getting logs] ( #getting-logs )
4346 - [ Output formats] ( #output-formats-1 )
4447- [ 👥 Contributing] ( #-contributing )
4548- [ ©️ License] ( #️-license )
@@ -130,10 +133,11 @@ smsgate [global options] command [command options] [arguments...]
130133
131134### Commands
132135
133- The CLI offers two main groups of commands:
136+ The CLI offers three main groups of commands:
134137
135138- ** Messages** : Commands for sending messages and checking their status.
136139- ** Webhooks** : Commands for managing webhooks, including creating, updating, and deleting them.
140+ - ** Logs** : Commands for retrieving logs for a specific time range.
137141
138142For a complete list of available commands, you can:
139143- Run ` smsgate help ` or ` smsgate --help ` in your terminal.
@@ -152,6 +156,14 @@ The CLI uses exit codes to indicate the outcome of operations:
152156
153157For security reasons, it is recommended to pass credentials using environment variables or a ` .env ` file.
154158
159+ Credentials can also be passed via CLI options:
160+
161+ ``` bash
162+ smsgate -u < username> -p < password> send --phones ' +12025550123' ' Hello, Dr. Turk!'
163+ ```
164+
165+ #### Sending messages
166+
155167``` bash
156168# Send a message
157169smsgate send --phones ' +12025550123' ' Hello, Dr. Turk!'
@@ -160,15 +172,28 @@ smsgate send --phones '+12025550123' 'Hello, Dr. Turk!'
160172smsgate send --phones ' +12025550123' --phones ' +12025550124' ' Hello, doctors!'
161173# or
162174smsgate send --phones ' +12025550123,+12025550124' ' Hello, doctors!'
175+ ```
163176
177+ #### Getting message status
178+
179+ ``` bash
164180# Get the status of a sent message
165181smsgate status zXDYfTmTVf3iMd16zzdBj
166182```
167183
168- Credentials can also be passed via CLI options:
184+ #### Getting logs
185+
186+ The ` logs ` command retrieves logs for a specific time range. Dates should be in RFC3339 format (e.g., ` 2024-01-15T10:30:00Z ` ).
169187
170188``` bash
171- smsgate -u < username> -p < password> send --phones ' +12025550123' ' Hello, Dr. Turk!'
189+ # Get logs for the last 24 hours (default)
190+ smsgate logs
191+
192+ # Get logs for a specific time range
193+ smsgate logs --from ' 2024-01-15T00:00:00Z' --to ' 2024-01-15T23:59:59Z'
194+
195+ # Get logs with custom time range and output format
196+ smsgate --format json logs --from ' 2024-01-15T10:00:00+07:00' --to ' 2024-01-15T18:00:00+07:00'
172197```
173198
174199#### Output formats
0 commit comments