From 57d23e6497d2a9a30545a1554a0a6997618ef6fc Mon Sep 17 00:00:00 2001 From: Aleksandr Soloshenko Date: Wed, 30 Oct 2024 14:24:26 +0700 Subject: [PATCH] [docs] restructure Usage section --- README.md | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 4a1ace6..966af47 100644 --- a/README.md +++ b/README.md @@ -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) @@ -121,9 +118,16 @@ Syntax: smsgate status 'Message ID' ``` -

(back to top)

+### 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. @@ -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 @@ -167,7 +171,7 @@ Recipients: +19162255888 Pending ``` -#### JSON +**JSON** ```json { @@ -189,7 +193,7 @@ Recipients: } ``` -#### Raw +**Raw** ```json {"id":"zXDYfTmTVf3iMd16zzdBj","state":"Pending","isHashed":false,"isEncrypted":false,"recipients":[{"phoneNumber":"+19162255887","state":"Pending"},{"phoneNumber":"+19162255888","state":"Pending"}],"states":{}} @@ -197,17 +201,6 @@ Recipients:

(back to top)

-## 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 - -

(back to top)

- ## Support For support, please contact support@sms-gate.app