Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

licli

licli is a CLI for Li Auto (LiXiang) vehicle APIs. It covers auth, real-time status, travel history, control commands, an HTTP API server, and an MCP server.

Run it without installing anything (PyPI via uvx, or npm via npx):

alias licli='uvx liauto'
licli help

# or

alias licli='npx -y @liauto/cli'
licli version

Commands

licli activate          # activate the current device (first activation or re-activation)
licli login             # device login, prints an OAuth URL, then persists the pasted token JSON
licli vehicles          # list cached vehicles
licli status <VIN>      # query vehicle state (--json/--raw)
licli travel <VIN> [YYYY-MM]   # monthly travel history; with YYYY-MM, that month's detail
licli control <VIN> <action>   # lock/unlock/find/wake + ac <on|off|auto|temp|fast-cool|fast-heat> + seat-vent/seat-heat [pos] <1-3|off> + wheel-heat <on|off> + window [pos] <0-99> + trunk <open|close> (action: result <id>)
licli version           # print version
licli serve             # HTTP API server (default 127.0.0.1:18001; --addr/--token/--allow-control)
licli mcp               # MCP server, stdio (default) or --transport http (default 127.0.0.1:18002)

Run licli with no arguments (or licli <unknown>) to print the command list.

Global flags: --json (JSON output), -v / --verbose (verbose logging to stderr).

Exit codes: 0 success, 1 user input error, 2 network failure, 3 HTTP non-200, 4 activation failure, 5 config permission/corrupt, 6 missing/invalid/expired activation code.

Activation code

Running any licli command except version requires a valid activation code, set as an environment variable:

export LICLI_CODE=<activation code>
licli login
licli vehicles    # list vehicles

A code is issued by the tool's publisher (offline license-keygen). It is an Ed25519-signed token: the binary only verifies it with the built-in public key and cannot forge codes. Missing/invalid/expired codes exit with code 6.

HTTP API server (serve)

licli serve runs a foreground HTTP server (default 127.0.0.1:18001, override with --addr) exposing JSON endpoints for the vehicles/status/travel/control surface. Bind to a loopback address, set --token, or pass --allow-control to enable the control endpoints.

MCP server (mcp)

licli mcp serves the Model Context Protocol over stdio (default) or Streamable HTTP (--transport http, default 127.0.0.1:18002). It exposes six tools: vehicles, status, travel_months, travel_month, control, control_result. The two control* tools are enabled by default under stdio; under --transport http they require --allow-control or --token.

Register it with Claude Code (no install needed):

claude mcp add licli -- uvx liauto mcp

Configuration

Credentials are stored under the XDG config directory (~/.config/licli by default, or $XDG_CONFIG_HOME/licli) with 0700 directory and 0600 file permissions:

  • device.json — activated device + key suite
  • auth.json — API token, ID token, refresh token, expiry

Docker Compose deployment

Run the HTTP API server (serve) and MCP server (mcp) in containers sharing the host config:

services:
  licli-api: &licli
    build:
      dockerfile_inline: |
        FROM ghcr.io/astral-sh/uv:python3.13-alpine
        RUN uv tool install liauto
        ENV PATH="/root/.local/bin:$${PATH}"
        ENV XDG_CONFIG_HOME=/config
        ENV LICLI_SERVE_ADDR=0.0.0.0:18001
        ENV LICLI_MCP_ADDR=0.0.0.0:18002
        ENV LICLI_MCP_TRANSPORT=http
        ENTRYPOINT ["liauto"]
    command: ["serve", "--allow-control"]
    ports:
      - "18001:18001"
    environment:
      LICLI_CODE: ${LICLI_CODE:-}
      LICLI_SERVE_TOKEN: ${LICLI_SERVE_TOKEN:-}
    volumes:
      - ${LICLI_CONFIG_DIR:-~/.config/licli}:/config/licli
    restart: unless-stopped

  licli-mcp:
    <<: *licli
    command: ["mcp", "--allow-control"]
    ports:
      - "18002:18002"

licli-api shares its build, env, volume and restart policy with licli-mcp via the &licli anchor. Both read the same host credentials (auth.json / device.json under ~/.config/licli, or $LICLI_CONFIG_DIR). The containers bind non-loopback addresses, so --allow-control enables the control endpoints and LICLI_SERVE_TOKEN gates them behind a bearer token.

Release files for liauto 0.1.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for liauto 0.1.0b2
File
liauto-0.1.0b2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
liauto-0.1.0b2-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
liauto-0.1.0b2-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
liauto-0.1.0b2-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
liauto-0.1.0b2-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details

Total release size: 34.6 MB

Release files / liauto-0.1.0b2-py3-none-win_amd64.whl

Download URL liauto-0.1.0b2-py3-none-win_amd64.whl
Size 7.7 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
0b7c546fd12469278f01368be4e4d6388ac339ecd8eafe36d3a8100ec2a644e3
BLAKE2b-256 checksum
How to use checksums
d9277ebcfa6caf63ff2fda847ff573d4ef1f8c9720d6cb4f101774aa78248bf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / liauto-0.1.0b2-py3-none-manylinux_2_17_x86_64.whl

Download URL liauto-0.1.0b2-py3-none-manylinux_2_17_x86_64.whl
Size 7.0 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
b7eb9e3d7cd6fc50caf8f126f3f825e8821a1603a45acaa712900f914846a2dd
BLAKE2b-256 checksum
How to use checksums
49cbb1043a7d855929a8a821ed54db9211e56a4f82064d54e97fda0acfcaf103
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / liauto-0.1.0b2-py3-none-manylinux_2_17_aarch64.whl

Download URL liauto-0.1.0b2-py3-none-manylinux_2_17_aarch64.whl
Size 6.3 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e04fd766128d8de8f938c96b14e0ee19dc0c7d9137a3613e8975e5ca725eb21a
BLAKE2b-256 checksum
How to use checksums
b0d54e3e23b29c76804866983e7c305c29b1b4d94cab7869a321ba23937b8441
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / liauto-0.1.0b2-py3-none-macosx_11_0_arm64.whl

Download URL liauto-0.1.0b2-py3-none-macosx_11_0_arm64.whl
Size 6.6 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
de3897ee8adc82893bf7d6c03e133e284b65b2c0787679b41452f77fb270af32
BLAKE2b-256 checksum
How to use checksums
a5fbc2640f16aa3b23943765029f033e167ec3f211754bf93ef1ab65a5891951
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / liauto-0.1.0b2-py3-none-macosx_10_9_x86_64.whl

Download URL liauto-0.1.0b2-py3-none-macosx_10_9_x86_64.whl
Size 7.1 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
d4cd67aedacdcce8f7dfed7509e30ed7592196199fdb34bac3740eee9a18d282
BLAKE2b-256 checksum
How to use checksums
13085ab002f2d2b8131f746dccc5769f2252374af418d18c6124a171b4bc9149
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page