Skip to content

Commit

Permalink
[docs] restructure Usage section
Browse files Browse the repository at this point in the history
  • Loading branch information
capcom6 committed Oct 30, 2024
1 parent c71b93d commit 57d23e6
Showing 1 changed file with 16 additions and 23 deletions.
39 changes: 16 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ A command-line interface for working with SMS Gateway for Android.
- [Commands](#commands)
- [Send a message](#send-a-message)
- [Get the status of a sent message](#get-the-status-of-a-sent-message)
- [Usage Examples](#usage-examples)
- [Output formats](#output-formats-1)
- [Text](#text)
- [JSON](#json)
- [Raw](#raw)
- [Exit codes](#exit-codes)
- [Exit codes](#exit-codes)
- [Examples](#examples)
- [Output formats](#output-formats-1)
- [Support](#support)
- [Contributing](#contributing)
- [License](#license)
Expand Down Expand Up @@ -121,9 +118,16 @@ Syntax:
smsgate status 'Message ID'
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>
### Exit codes

## Usage Examples
The CLI uses exit codes to indicate the outcome of operations:

- `0`: success
- `1`: invalid options or arguments
- `2`: server request error
- `3`: output formatting error

### Examples

For security reasons, it is recommended to pass credentials using environment variables or a `.env` file.

Expand Down Expand Up @@ -153,9 +157,9 @@ If you prefer not to install the CLI tool locally, you can use Docker to run it:
docker run -it --rm --env-file .env ghcr.io/android-sms-gateway/cli send --phone '+19162255887' 'Hello, Dr. Turk!'
```

### Output formats
#### Output formats

#### Text
**Text**

```
ID: zXDYfTmTVf3iMd16zzdBj
Expand All @@ -167,7 +171,7 @@ Recipients:
+19162255888 Pending
```

#### JSON
**JSON**

```json
{
Expand All @@ -189,25 +193,14 @@ Recipients:
}
```

#### Raw
**Raw**

```json
{"id":"zXDYfTmTVf3iMd16zzdBj","state":"Pending","isHashed":false,"isEncrypted":false,"recipients":[{"phoneNumber":"+19162255887","state":"Pending"},{"phoneNumber":"+19162255888","state":"Pending"}],"states":{}}
```

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Exit codes

The CLI uses exit codes to indicate the outcome of operations:

- `0`: success
- `1`: invalid options or arguments
- `2`: server request error
- `3`: output formatting error

<p align="right">(<a href="#readme-top">back to top</a>)</p>

## Support

For support, please contact [email protected]
Expand Down

0 comments on commit 57d23e6

Please sign in to comment.