Antom CLI user guide
Antom CLI is a command-line tool provided by Antom. It helps merchant developers complete operations such as login authorization, merchant profile management, report queries, and payment integration diagnostics directly from the terminal.
Features
- Browser-based authorization login: Supports login through the default browser, as well as non-interactive login suitable for Agent/CI scenarios.
- Multiple profile management: Supports saving multiple merchant profiles on the same machine and switching the current active profile.
- Test/Live environment switching: Uses the test environment by default. Use
--liveto switch to the live environment. - Report queries: Supports querying bill file download URLs for a specified date or date range, as well as querying details of a single transaction.
- Integration diagnostics: Supports diagnosing the cause of failed payment requests based on the paymentRequestId in the payment request.
- Dual output modes: Outputs human-readable text by default, and also supports structured JSON output with
--json.
Before you begin
Before using Antom CLI, make sure you meet the following requirements:
- You already have an Antom merchant account. If you do not have an account yet, go to the Contact us to register or contact Antom technical support.
- You have enabled Antom CLI login authorization permission. This feature is currently available only to selected allowlisted merchants. To request CLI access, contact pub_antom_integration_service@antom.com.
Installation
Currently, the Antom CLI installation script only supports macOS.
Install via script
Run the following command in your terminal:
curl -fsSL https://mdn.alipayobjects.com/portal_4vwbay/uri/file/as/release/antom-cli-install.sh | bashAfter installation, run the following commands to verify the installation:
antom version
antom --helpIf the version number or help information is displayed correctly, the installation is successful. If your terminal reports that the antom command does not exist, run the following command to ensure that the installation directory has been added to PATH:
export PATH="$HOME/.local/bin:$PATH"Quick start
Step 1: Login authorization
Antom CLI provides multiple login methods for different scenarios:
Recommended for local development environments. After the command is executed, the CLI opens your default browser and guides you through Antom authorization.
antom loginStep 2: View current identity
Use the following command to view the current merchant identity and login environment:
antom whoamiStep 3: Query report download URLs
Antom CLI supports querying report download URLs within a specified date range. The returned links can be used directly to download reconciliation reports.
# Query bills for a specified date
antom report download-list --date 20260601 --bill-type SETTLEMENT_DETAIL
# Query bills for a date range
antom report download-list --date 20260601-20260630 --bill-type SETTLEMENT_DETAILStep 4: Diagnose failed payment requests
When a payment request fails, you can use the following command to quickly diagnose the cause. This is useful during development and debugging.
antom integration diagnose --request-id PAY_202606151234Command reference
Global parameters
The following parameters apply to all Antom CLI commands for controlling general behavior and environment settings:
Parameter | Description |
| Specify the profile to use for the current command. If not provided, the active profile is used. |
| Use the live environment. The test environment is used by default. |
| Output JSON that can be parsed by programs. |
| Outputs diagnostic logs to stderr. You can also enable this by setting |
| Control color output. The default value is |
| Display command help. |
Login commands
login (Login Authorization
Used to complete login authorization for the Antom CLI. Command format:
antom login [flags]Include the following parameters:
Parameter | Description |
| Initiate a non-interactive browser authorization, output the authorization information, and then exit. |
| Complete a pending authorization initiated via |
| Log in using manual credentials. |
The login process is as follows:
- The CLI starts browser authorization or reads the manual credentials entered by the user.
- The user completes authorization in the browser, or enters the client ID and the merchant RSA private key.
- The CLI verifies the authorization or credentials.
- After authorization succeeds, the CLI saves the profile and credentials locally.
- The newly logged-in profile becomes the active profile.
logout (Logout)
Used to delete the local profile and clear local credentials.
antom logout
antom logout --allNote:
- If
--allis not specified, the current active profile is deleted.- If
--allis specified, all local profiles are deleted.
whoami (Current identity)
Used to display the current local Antom CLI identity.
antom whoami
antom whoami --jsonlogin list (Profile list)
Used to list all local profiles.
antom login list
antom login list --jsonlogin switch (Switch profile)
Used to switch the active profile. Subsequent commands that do not explicitly specify --profile will use this profile.
antom login switch my-merchantReport commands
report download-list (Report download URLs)
Used to query the downloadable billing file URLs for a specified date or date range. The bill type must be specified using --bill-type.
antom report download-list --date 20260601 --bill-type SETTLEMENT_DETAIL
antom report download-list --date 20260601-20260630 --bill-type SETTLEMENT_DETAIL
antom report download-list --date 20260601 --bill-type SETTLEMENT_SUMMARY --jsonInclude the following parameters:
Parameter | Description |
| Billing date, in the format |
| Bill type, such as |
| Displays the complete results in user-facing output. |
report transaction-detail (Transaction details)
Used to query the details of a single Antom transaction.
antom report transaction-detail --transaction-id 20260518993030096600502796446525944
antom report transaction-detail -t 20260518993030096600502796446525944 --jsonInclude the following parameters:
Parameter | Description |
| The transaction ID to query. |
Integration commands
integration diagnose (Integration diagnosis)
Diagnose the cause of an error in a payment request. The input parameter is the paymentRequestId from the payment request, passed using --request-id.
antom integration diagnose --request-id PAY_202606151234
antom integration diagnose --live --request-id PAY_202606151234
antom integration diagnose --request-id PAY_202606151234 --jsonInclude the following parameters:
Parameter | Description |
| The paymentRequestId from the payment request. |
Other commands
open (Open Antom Dashboard)
Quickly open the Antom Dashboard in the default browser, making it easy to view business data and manage configurations online.
antom openversion (Version information)
Used to view the currently installed Antom CLI version information, which helps troubleshoot compatibility issues or confirm tool updates.
antom version
antom version --jsonTroubleshooting
Common troubleshooting methods for Antom CLI include adjusting CLI behavior through environment variables, viewing command help, and enabling debug logs to locate issues.
Environment variables
The following environment variables can be used to control the default profile, debug logs, and color output of Antom CLI.
Variable | Description |
| Specify the default profile name. |
| Enable debug logs. |
| Disable color output. |
| Force color output to be enabled. |
View command help
If you are unsure about the usage of a command, the meaning of a parameter, or the supported options, you can use --help to view the help information.
antom --help
antom login --help
antom report download-list --help
antom integration diagnose --helpEnable debug mode
When you need to troubleshoot command execution errors or view more detailed diagnostic information, you can enable debug mode using the --debug parameter.
antom report download-list --date 20260601 --bill-type SETTLEMENT_DETAIL --debugYou can also enable debug logs by setting the ANTOM_DEBUG=1 environment variable:
ANTOM_DEBUG=1 antom whoamiFAQs
After installation, the command antom is not found. What should I do?
Verify that Antom CLI's installation directory has been added to your PATH.
export PATH="$HOME/.local/bin:$PATH"
antom versionWhy is authorization not completed after running non-interactive login?
Non-interactive login requires you to first initiate authorization and then complete it.
# Step 1: Initiate non-interactive authorization
antom login --non-interactive
# Step 2: Complete the pending authorization
antom login --completeWhat should I do if the profile does not exist?
First check the list of merchant profiles saved locally, and then switch to an existing profile.
# View local profiles
antom login list
# Switch to an existing profile
antom login switch my-merchantHow can I make commands output JSON for easier script analysis?
Commands that support structured output can use --json, which makes them easier to parse in scripts.
antom whoami --json
antom report download-list --date 20260601 --bill-type SETTLEMENT_DETAIL --json
antom integration diagnose --request-id PAY_202606151234 --json