a2s¶
NAME¶
a2s
SYNOPSIS¶
a2s [OPTIONS]
DESCRIPTION¶
A command-line utility for querying and diagnosing game servers via the Steam A2S protocol. It provides server information, player lists, and rules, checks server availability, and runs a caching proxy.
OPTIONS¶
Application Options¶
| Option | Description | Default | Environment | Required |
|---|---|---|---|---|
-t, --timeout |
Set request timeout | 3s |
$A2S_TIMEOUT |
no |
-b, --buffer-size |
Set connection buffer size | 8192 |
$A2S_BUFFER_SIZE |
no |
Help Options¶
| Option | Description | Required |
|---|---|---|
-h, --help |
Show this help message | no |
-v, --version |
Show version information | no |
COMMANDS¶
Help Commands
help¶
Show help
Usage: a2s [OPTIONS] help
version¶
Show version information
Usage: a2s [OPTIONS] version [version-OPTIONS]
Show version information¶
| Option | Description | Required |
|---|---|---|
--short |
Print version number only | no |
--commit |
Print commit SHA only | no |
--json |
Print version information as JSON | no |
completion¶
Generate shell completion
Usage: a2s [OPTIONS] completion [completion-OPTIONS]
Generate shell completion¶
| Option | Description | Required |
|---|---|---|
--shell |
Shell completion format; choices: bash, zsh, pwsh |
no |
Arguments¶
| Name | Description | Required |
|---|---|---|
output |
Output file path | no |
all¶
Retrieve all available server information
Query server metadata, rules, and players in one command.
Usage: a2s [OPTIONS] all [all-OPTIONS]
Examples¶
Retrieve all available server information¶
| Option | Description | Default | Environment | Required |
|---|---|---|---|---|
-f, --format |
Output format; choices: json, table, md, html |
table |
$A2S_FORMAT |
no |
-g, --game |
Game type for more accurate results; choices: dayz, arma3 |
$A2S_GAME |
no | |
-r, --raw |
Disable parse A2S_RULES values to types | $A2S_RAW |
no |
Arguments¶
| Name | Description | Required |
|---|---|---|
host |
Server host (with optional port, e.g., 127.0.0.1:27016) | yes |
port |
Query port (if not included in host) | no |
info¶
Retrieve server information A2S_INFO
Query server metadata with A2S_INFO.
Usage: a2s [OPTIONS] info [info-OPTIONS]
Examples¶
Retrieve server information A2S_INFO¶
| Option | Description | Default | Environment | Required |
|---|---|---|---|---|
-f, --format |
Output format; choices: json, table, md, html |
table |
$A2S_FORMAT |
no |
Arguments¶
| Name | Description | Required |
|---|---|---|
host |
Server host (with optional port, e.g., 127.0.0.1:27016) | yes |
port |
Query port (if not included in host) | no |
ping¶
Ping the server with A2S_INFO
Measure server response time with repeated A2S_INFO queries.
Usage: a2s [OPTIONS] ping [ping-OPTIONS]
Examples¶
Ping the server with A2S_INFO¶
| Option | Description | Default | Environment | Required |
|---|---|---|---|---|
-q, --query |
A2S query to measure; choices: info, players, rules |
info |
$A2S_QUERY |
no |
-c, --ping-count |
Set the number of ping requests to send (0 = infinite) | 0 |
$A2S_PING_COUNT |
no |
-p, --ping-period |
Set the period between pings | 1s |
$A2S_PING_PERIOD |
no |
--compact |
Print only response times in milliseconds | $A2S_COMPACT |
no | |
--no-summary |
Disable final statistics | $A2S_NO_SUMMARY |
no |
Arguments¶
| Name | Description | Required |
|---|---|---|
host |
Server host (with optional port, e.g., 127.0.0.1:27016) | yes |
port |
Query port (if not included in host) | no |
players¶
Retrieve player list A2S_PLAYERS
Query the current player list with A2S_PLAYER.
Usage: a2s [OPTIONS] players [players-OPTIONS]
Examples¶
Retrieve player list A2S_PLAYERS¶
| Option | Description | Default | Environment | Required |
|---|---|---|---|---|
-f, --format |
Output format; choices: json, table, md, html |
table |
$A2S_FORMAT |
no |
Arguments¶
| Name | Description | Required |
|---|---|---|
host |
Server host (with optional port, e.g., 127.0.0.1:27016) | yes |
port |
Query port (if not included in host) | no |
proxy¶
Run a cached A2S proxy
Expose a cached UDP proxy for an upstream A2S server. Optional rate limits reduce application-level CPU and response traffic abuse; they do not replace host or provider DDoS protection.
Usage: a2s [OPTIONS] proxy [proxy-OPTIONS]
Examples¶
Run a cached A2S proxy¶
| Option | Description | Environment | Required |
|---|---|---|---|
-l, --listen |
Local UDP endpoint to listen on | $A2S_LISTEN |
yes |
--upstream-ping |
Forward A2A_PING instead of answering locally | $A2S_UPSTREAM_PING |
no |
Cache Options¶
| Option | Description | Default | Environment | Required |
|---|---|---|---|---|
-c, --cache |
Response types to cache; choices: info, players, rules, auto, none |
auto |
$A2S_CACHE |
no |
-T, --ttl |
Cache refresh interval | 15s |
$A2S_TTL |
no |
--inactive-ttl |
Inactive cache retry interval (0 = use TTL) | 0 |
$A2S_INACTIVE_TTL |
no |
-j, --jitter |
Maximum polling interval jitter | 1s |
$A2S_JITTER |
no |
-r, --retries |
Retries after an upstream refresh failure | 2 |
$A2S_RETRIES |
no |
Rate Limit Options¶
| Option | Description | Default | Environment | Required |
|---|---|---|---|---|
--rate-limit |
Global proxy request limit (0 = disabled) | 0 |
$A2S_RATE_LIMIT |
no |
--rate-client-limit |
Per-client proxy request limit (0 = disabled) | 0 |
$A2S_RATE_CLIENT_LIMIT |
no |
--rate-window |
Rate limit window | 1s |
$A2S_RATE_WINDOW |
no |
Arguments¶
| Name | Description | Required |
|---|---|---|
host |
Server host (with optional port, e.g., 127.0.0.1:27016) | yes |
port |
Query port (if not included in host) | no |
rules¶
Retrieve server rules A2S_RULES
Query server rules with A2S_RULES or automatic A3SB parsing.
Usage: a2s [OPTIONS] rules [rules-OPTIONS]
Examples¶
Retrieve server rules A2S_RULES¶
| Option | Description | Default | Environment | Required |
|---|---|---|---|---|
-f, --format |
Output format; choices: json, table, md, html |
table |
$A2S_FORMAT |
no |
-g, --game |
Game type for more accurate results; choices: dayz, arma3 |
$A2S_GAME |
no | |
-r, --raw |
Disable parse A2S_RULES values to types | $A2S_RAW |
no |
Arguments¶
| Name | Description | Required |
|---|---|---|
host |
Server host (with optional port, e.g., 127.0.0.1:27016) | yes |
port |
Query port (if not included in host) | no |
SEE ALSO¶
- https://github.com/woozymasta/a2s