Files
dm-cli/README.en.md
2025-12-10 13:10:47 +03:00

100 lines
2.2 KiB
Markdown

# dm-cli
CLI client for apostol-dm - command line interface for access to BitDeals deal module.
## Description
`dm-cli` provides command line for work with deal module (apostol-dm) of BitDeals payment processing service. The application supports all deal module main functions via convenient command line interface.
## Building
```bash
cd dm-cli/dm-cli
make
```
```bash
mv dm-cli /usr/local/bin/
```
## Usage
### Main syntax
```bash
Usage: dm-cli [global] <group> [<args>]
Global options:
--bitdeals BitDeals server address
--debug print debug information, input and output API requests
--address <ip:port> address of the bitdeals dm, default: 127.0.0.1:4999
--help print condensed help for all subcommands
--version print version string
dm-cli account status <bitcoin_address>
Show account data details
dm-cli account update [options]
Update your account data
dm-cli deal create
Create a new deal
dm-cli deal status
Show deal data details
dm-cli deal complete
Complete deal
dm-cli deal cancel
Cancel deal
dm-cli deal negative
Leave negative feedback
```
### Debug mode
In debug mode curl POST and GET requests to apostol-dm API are displayed.
```bash
dm-cli --debug account status 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
```
### Localization
The application define a language via the `LANG` variable:
```bash
# Русский язык
export LANG=ru_RU.UTF-8
dm-cli --help
# English languge (default)
export LANG=en_US.UTF-8
dm-cli --help
```
## Usage examples
### Create deal
```bash
dm-cli deal create \
--at "https://testnet-dm.bitdeals.org" \
--seller miuwWQrUc6EFWiUBTi2rMyiEaJSeacn2zo \
--customer mraXx7JrmAmuKypdJ1vseQBXySsdRZE5AC \
--type prepayment \
--sum 0.0052 \
--pay 2025-09-20 \
--leave-before 2025-10-03
```
### Check deal status
```bash
dm-cli deal status 6e90c7d6ef823e41257cbcc16cd2e318fd578970
```
### Check deal payment
```bash
dm-cli deal status --is-paid 6e90c7d6ef823e41257cbcc16cd2e318fd578970
echo $? # 0 if paid, 1 if no
```