|
| 1 | +# atmos-cli |
| 2 | + |
| 3 | +atmos-cli is a CLI to fetch divelogs from ATMOS Platform. |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +## Syntax |
| 8 | + |
| 9 | +```bash |
| 10 | +$ atmos |
| 11 | +NAME: |
| 12 | + atmos - Client for ATMOS Platform |
| 13 | + |
| 14 | +USAGE: |
| 15 | + atmos COMMAND [options...] |
| 16 | + |
| 17 | +VERSION: |
| 18 | + 0.1.0 |
| 19 | + |
| 20 | +COMMANDS: |
| 21 | + profile, p, pr, pro, prof Fetch my profile. |
| 22 | + divelog, d, di, div, dive Fetch my divelogs. |
| 23 | + help, h Shows a list of commands or help for one command |
| 24 | + |
| 25 | +GLOBAL OPTIONS: |
| 26 | + --server value, -s value URI to ATMOS API (default: "https://localhost/") [$ATMOS_API] |
| 27 | + --help, -h show help (default: false) |
| 28 | + --version, -v print the version (default: false) |
| 29 | +``` |
| 30 | + |
| 31 | +- Environment Variables |
| 32 | + |
| 33 | + | Environment Varible | Alternative to | Description | |
| 34 | + | ------------------- | ------------------- | ------------------------------------ | |
| 35 | + | ATMOS_API | --server (-s) | URI of ATMOS Platform API. | |
| 36 | + | ATMOS_USERID | --user-id (-i) | Unique ID in ATMOS Platform. | |
| 37 | + | ATMOS_TOKEN | --access-token (-t) | The token to use ATMOS Platform API. | |
| 38 | + |
| 39 | +## Usage |
| 40 | + |
| 41 | +### Tutorial |
| 42 | + |
| 43 | +- Show the latest 10 dive-logs in pretty format. |
| 44 | + |
| 45 | + ```bash |
| 46 | + atmos divelog --pretty |
| 47 | + ``` |
| 48 | + |
| 49 | +- Show the latest 5 dive-logs in pretty format. |
| 50 | + |
| 51 | + ```bash |
| 52 | + atmos divelog --pretty --limit 5 |
| 53 | + ``` |
| 54 | + |
| 55 | +- Show the cursor at end of latest 10 dive-logs. |
| 56 | + |
| 57 | + ```bash |
| 58 | + atmos divelog | jq -r '.response.page_info.end_cursor' |
| 59 | + ``` |
| 60 | + |
| 61 | +- Show 10 dive-logs after selected cursor in pretty format. |
| 62 | + |
| 63 | + ```bash |
| 64 | + atmos divelog --pretty --cursor $END_CURSOR_NAME |
| 65 | + ``` |
| 66 | + |
| 67 | +## Advanced |
| 68 | + |
| 69 | +- `atmos divelog --divelog-id` shows the detail of a divelog. |
| 70 | + |
| 71 | + ```bash |
| 72 | + atmos divelog --divelog-id <randomChar> | jq . |
| 73 | + ``` |
| 74 | + |
| 75 | + ```bash |
| 76 | + { |
| 77 | + "code": "0000000", |
| 78 | + "message": "", |
| 79 | + "response": { |
| 80 | + "divelog": { |
| 81 | + "air_in": 0, |
| 82 | + "air_in_text": "0", |
| 83 | + "air_out": 0, |
| 84 | + "air_out_text": "0", |
| 85 | + "air_temperature": "27.1", |
| 86 | + <snip> |
| 87 | + } |
| 88 | + } |
| 89 | + } |
| 90 | + ``` |
| 91 | + |
| 92 | +- `atmos profile` shows user profile. |
| 93 | + |
| 94 | + ```bash |
| 95 | + atmos profile | jq . |
| 96 | + ``` |
| 97 | + |
| 98 | + ```bash |
| 99 | + { |
| 100 | + "code": "0000000", |
| 101 | + "message": "", |
| 102 | + "response": { |
| 103 | + "user": { |
| 104 | + "user_name": "umatare5", |
| 105 | + "status": "active", |
| 106 | + <snip> |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | + ``` |
| 111 | + |
| 112 | +- `atmos profile --statistics` shows user statistics. |
| 113 | + |
| 114 | + ```bash |
| 115 | + atmos divelog --statistics | jq . |
| 116 | + ``` |
| 117 | + |
| 118 | + ```bash |
| 119 | + { |
| 120 | + "code": "0000000", |
| 121 | + "message": "", |
| 122 | + "response": { |
| 123 | + "dive_time": 140437, |
| 124 | + "divelog_count": 42, |
| 125 | + "follower_count": 0, |
| 126 | + "following_count": 0, |
| 127 | + <snip> |
| 128 | + } |
| 129 | + } |
| 130 | + ``` |
0 commit comments