Metadata-Version: 2.4
Name: ChatDNS
Version: 0.1.2
Summary: ChatDNS: ChatArch DNS record, DDNS, and provider helper extracted from ChatTool.
Author-email: ChatArch <1073853456@qq.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/ChatArch/ChatDNS
Project-URL: Repository, https://github.com/ChatArch/ChatDNS
Project-URL: Documentation, https://ChatArch.github.io/ChatDNS
Keywords: chatdns,chatarch,cli
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0
Requires-Dist: chatstyle<0.2.0,>=0.1.0
Requires-Dist: chatenv<0.3.0,>=0.2.2
Requires-Dist: aiohttp>=3.8
Requires-Dist: netifaces
Requires-Dist: alibabacloud_alidns20150109>=3.5.10
Requires-Dist: alibabacloud_tea_openapi>=0.3.0
Requires-Dist: tencentcloud-sdk-python
Requires-Dist: requests>=2.31
Requires-Dist: cryptography>=41
Provides-Extra: dev
Requires-Dist: build; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"
Requires-Dist: twine; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.4.0; extra == "docs"
Requires-Dist: mkdocs-material>=9.0.0; extra == "docs"
Requires-Dist: mike>=2.0.0; extra == "docs"
Provides-Extra: mcp
Requires-Dist: fastmcp; python_version >= "3.10" and extra == "mcp"
Dynamic: license-file

<p align="center">
    <a href="https://pypi.python.org/pypi/ChatDNS">
        <img src="https://img.shields.io/pypi/v/ChatDNS.svg" alt="PyPI version" />
    </a>
    <a href="https://github.com/ChatArch/ChatDNS/actions/workflows/ci.yml">
        <img src="https://github.com/ChatArch/ChatDNS/actions/workflows/ci.yml/badge.svg" alt="Tests" />
    </a>
    <a href="https://ChatArch.github.io/ChatDNS">
        <img src="https://img.shields.io/badge/docs-latest-blue.svg" alt="Docs" />
    </a>
</p>

# ChatDNS

ChatDNS is a ChatArch DNS helper extracted from ChatTool. It provides a standalone `chatdns` CLI and importable Python API for DNS record management, DDNS updates, provider clients, IP detection, DNS-01 certificate automation, and MCP registration.

## Commands

```bash
chatdns --help
chatdns list
chatdns --env work list --provider tencent
chatdns records example.com
chatdns records test.example.com
chatdns set test.example.com -t A -v 1.2.3.4
chatdns delete test.example.com -t A -v 1.2.3.4 --yes
chatdns ip
chatdns cert apply -d example.com -d '*.example.com' -e admin@example.com --provider aliyun
chatdns cert check example.com
```

Supported providers in this release:

- Aliyun DNS
- Tencent Cloud DNSPod

Certificate management from the old `chattool dns cert` surface is now available as `chatdns cert`. It uses ACME DNS-01 validation and writes TXT records through the configured DNS provider. Treat live certificate issuance as an external side effect: test with `--staging` first and verify provider credentials before production use.

## Configuration

ChatDNS reads provider credentials and defaults from environment / ChatEnv-compatible config fields:

- `CHATDNS_PROVIDER` (default DNS provider/channel: `aliyun` or `tencent`)
- `ALIBABA_CLOUD_ACCESS_KEY_ID`
- `ALIBABA_CLOUD_ACCESS_KEY_SECRET`
- `ALIBABA_CLOUD_REGION_ID`
- `TENCENT_SECRET_ID`
- `TENCENT_SECRET_KEY`
- `TENCENT_REGION_ID`

Active ChatEnv profiles are loaded automatically from `$CHATARCH_HOME/envs` (default: `~/.chatarch/envs`). Use the global `--env/-e` option before the command to select a named provider profile, for example `chatdns --env work list -p tencent`.

Provider aliases are registered through the package's `chatenv.configs` entry point as `chatdns.config`.

## Development

```bash
python -m pytest -q
chatpypi build --project-dir .
chatpypi check --project-dir .
PYTHONPATH=src python -m chatdns.cli --help
```
