seer-cli 0.1.83

Interactive CLI for Seer domain name utilities
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# Seer

A multi-interface domain name utility tool for querying domain registration information, DNS records, and network data. Seer provides a unified interface across CLI, Python library, REST API, and MCP (Model Context Protocol) server.

## Features

- **WHOIS Lookups** - Query domain registrant and registrar information
- **RDAP Lookups** - Modern Registration Data Access Protocol queries for domains, IPs, and ASNs
- **DNS Resolution** - Query DNS records (A, AAAA, MX, TXT, NS, SOA, CNAME, CAA, PTR, SRV, DNSKEY, DS)
- **DNS Propagation Checking** - Monitor global DNS propagation across multiple nameservers
- **Domain Status** - Quick health check: HTTP status, site title, SSL certificate info, expiration dates
- **Smart Lookups** - Intelligent fallback that tries RDAP first, then falls back to WHOIS
- **Bulk Operations** - Process multiple domains/queries concurrently with rate limiting
- **Multiple Interfaces** - CLI, Python library, REST API, and MCP server

## Installation

### Prerequisites

- [Rust]https://rustup.rs/ 1.70+ (required for CLI and building Python bindings)
- Python 3.9+ (required for Python library, REST API, and MCP server)
- [uv]https://docs.astral.sh/uv/ (recommended Python package manager)

### CLI Only

Install from [crates.io](https://crates.io/crates/seer-cli):

```bash
cargo install seer-cli
```

This installs the `seer` binary to `~/.cargo/bin/`, which is typically already in your PATH if you have Rust installed.

### Full Installation (CLI + Python Library + REST API + MCP Server)

```bash
# Clone the repository
git clone https://github.com/TheZacillac/seer.git
cd seer

# Install CLI to PATH
cargo install --path seer-cli

# Install maturin (needed to build Python bindings)
uv pip install maturin

# Build and install Python bindings (required before installing the API)
cd seer-py
maturin develop --release
cd ..

# Install REST API and MCP server
cd seer-api
uv pip install -e .
cd ..
```

After installation, you'll have access to:
- `seer` - CLI tool
- `seer-api` - REST API server
- `seer-mcp` - MCP server for AI assistants

### Individual Components

#### Python Library Only

```bash
git clone https://github.com/TheZacillac/seer.git
cd seer/seer-py
uv pip install maturin
maturin develop --release
```

Or build a wheel for distribution:

```bash
maturin build --release
uv pip install target/wheels/seer-*.whl
```

#### REST API & MCP Server

> **Note:** The Python library must be installed first (see above).

```bash
cd seer-api
uv pip install -e .
```

This provides two commands:
- `seer-api` - Start the REST API server
- `seer-mcp` - Start the MCP server

## Usage

### CLI

#### Command Mode

```bash
# Smart lookup (RDAP with WHOIS fallback)
seer lookup example.com

# WHOIS lookup
seer whois example.com

# RDAP lookups
seer rdap example.com          # Domain
seer rdap 8.8.8.8              # IP address
seer rdap AS15169              # ASN

# DNS queries
seer dig example.com           # A records (default)
seer dig example.com MX        # MX records
seer dig example.com A @8.8.8.8  # Custom nameserver

# DNS propagation check
seer propagation example.com A

# Domain status check (HTTP, SSL, expiration)
seer status example.com

# Bulk operations
seer bulk lookup domains.txt
seer bulk whois domains.txt
seer bulk dig domains.txt A
seer bulk status domains.txt
```

#### Output Formats

```bash
# Human-readable output (default)
seer lookup example.com --format human

# JSON output
seer lookup example.com --format json
```

#### Interactive REPL

Launch the interactive shell by running `seer` without arguments:

```bash
$ seer
seer> lookup example.com
seer> whois google.com
seer> dig github.com MX
seer> status cloudflare.com
seer> set output json
seer> help
seer> exit
```

REPL features:
- Command history (saved to `~/.seer_history`)
- Tab completion
- Loading spinners for long operations

### Python Library

```python
import seer

# Smart lookup
result = seer.lookup("example.com")

# WHOIS lookup
whois = seer.whois("example.com")

# RDAP lookups
rdap_domain = seer.rdap_domain("example.com")
rdap_ip = seer.rdap_ip("8.8.8.8")
rdap_asn = seer.rdap_asn("AS15169")

# DNS queries
dns = seer.dig("example.com", record_type="A")
dns_custom = seer.dig("example.com", record_type="MX", nameserver="8.8.8.8")

# DNS propagation
propagation = seer.propagation("example.com", record_type="A")

# Domain status (HTTP, SSL, expiration)
status = seer.status("example.com")

# Bulk operations
results = seer.bulk_lookup(["example.com", "google.com"], concurrency=10)
results = seer.bulk_whois(["example.com", "google.com"])
results = seer.bulk_dig(["example.com", "google.com"], record_type="A")
results = seer.bulk_status(["example.com", "google.com"])
```

### REST API

Start the server:

```bash
seer-api
```

The API runs on `http://localhost:8000` with auto-reload enabled.

#### Endpoints

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/` | GET | List available endpoints |
| `/health` | GET | Health check |
| `/lookup/{domain}` | GET | Smart lookup |
| `/lookup/bulk` | POST | Bulk smart lookups |
| `/whois/{domain}` | GET | WHOIS lookup |
| `/rdap/domain/{domain}` | GET | RDAP domain lookup |
| `/rdap/ip/{ip}` | GET | RDAP IP lookup |
| `/rdap/asn/{asn}` | GET | RDAP ASN lookup |
| `/dns/{domain}/{record_type}` | GET | DNS query |
| `/propagation/{domain}/{record_type}` | GET | Propagation check |
| `/status/{domain}` | GET | Domain status check |
| `/status/bulk` | POST | Bulk status checks |

#### Examples

```bash
# Smart lookup
curl http://localhost:8000/lookup/example.com

# WHOIS lookup
curl http://localhost:8000/whois/example.com

# DNS query
curl http://localhost:8000/dns/example.com/MX

# Domain status
curl http://localhost:8000/status/example.com

# Bulk lookup
curl -X POST http://localhost:8000/lookup/bulk \
  -H "Content-Type: application/json" \
  -d '{"domains": ["example.com", "google.com"]}'
```

API documentation is available at:
- Swagger UI: `http://localhost:8000/docs`
- ReDoc: `http://localhost:8000/redoc`

#### CORS Configuration

Set allowed origins via environment variable:

```bash
export SEER_CORS_ORIGINS="https://example.com,https://app.example.com"
seer-api
```

### MCP Server

Start the MCP server for AI assistant integration:

```bash
seer-mcp
```

The MCP server exposes these tools:
- `seer_lookup` - Smart domain lookup
- `seer_whois` - WHOIS lookup
- `seer_rdap_domain` / `seer_rdap_ip` / `seer_rdap_asn` - RDAP lookups
- `seer_dig` - DNS queries
- `seer_propagation` - Propagation checking
- `seer_status` - Domain status (HTTP, SSL, expiration)
- `seer_bulk_lookup` / `seer_bulk_whois` / `seer_bulk_dig` / `seer_bulk_status` - Bulk operations

## Project Structure

```
seer/
├── seer-core/          # Core Rust library
│   └── src/
│       ├── lib.rs      # Module exports
│       ├── error.rs    # Error types
│       ├── lookup.rs   # Smart lookup implementation
│       ├── bulk/       # Bulk operation executor
│       ├── dns/        # DNS resolver and propagation
│       ├── whois/      # WHOIS client and parser
│       ├── rdap/       # RDAP client
│       ├── status/     # Domain status checker
│       └── output/     # Output formatters
│
├── seer-cli/           # CLI application
│   └── src/
│       ├── main.rs     # Entry point with clap commands
│       ├── display/    # Spinner and display utilities
│       └── repl/       # Interactive REPL
│
├── seer-py/            # Python bindings (PyO3)
│   ├── pyproject.toml  # Maturin build config
│   └── src/lib.rs      # Python module definitions
│
└── seer-api/           # FastAPI REST server + MCP
    └── seer_api/
        ├── main.py     # FastAPI app
        ├── routers/    # API endpoints
        └── mcp/        # MCP server
```

## Configuration

### Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `RUST_LOG` | Logging level (trace, debug, info, warn, error) | - |
| `SEER_CORS_ORIGINS` | Comma-separated list of allowed CORS origins | `*` (all) |

### Bulk Operations

Bulk operations support:
- Plain text files (one domain per line)
- Comments (lines starting with `#`)
- CSV files (uses first column)

Default concurrency: 10 (max: 50)

## Supported DNS Record Types

- `A` - IPv4 address
- `AAAA` - IPv6 address
- `MX` - Mail exchange
- `TXT` - Text records
- `NS` - Nameserver
- `SOA` - Start of authority
- `CNAME` - Canonical name
- `CAA` - Certification authority authorization
- `PTR` - Pointer record
- `SRV` - Service locator
- `DNSKEY` - DNSSEC public key
- `DS` - Delegation signer (DNSSEC)
- `ANY` - All available records

## Global DNS Servers for Propagation Checks

Propagation checks query these nameservers:
- Google DNS (8.8.8.8, 8.8.4.4)
- Cloudflare DNS (1.1.1.1, 1.0.0.1)
- OpenDNS (208.67.222.222, 208.67.220.220)
- Quad9 (9.9.9.9)
- Level3 (4.2.2.1, 4.2.2.2)
- Comodo (8.26.56.26)
- DNS.Watch (84.200.69.80)

## Development

### Prerequisites

- Rust 1.70+
- Python 3.9+
- [maturin]https://github.com/PyO3/maturin (for Python bindings)

### Building

```bash
# Build all Rust packages
cargo build --release

# Build Python bindings
cd seer-py && maturin develop --release

# Install API package
cd seer-api && pip install -e .
```

### Running Tests

```bash
# Rust tests
cargo test

# Python tests
cd seer-api && pytest
```

### Logging

Enable debug logging:

```bash
RUST_LOG=debug seer lookup example.com
```

## Technology Stack

**Core (Rust)**
- Tokio - Async runtime
- Reqwest - HTTP client
- Hickory-resolver - DNS resolution
- Serde - Serialization

**Data Sources**
- WHOIS server list sourced from [WooMai/whois-servers]https://github.com/WooMai/whois-servers (auto-synced with IANA Root Zone Database)

**CLI**
- Clap - Command-line parsing
- Rustyline - REPL line editing
- Indicatif - Progress indicators
- Colored - Terminal colors

**Python**
- PyO3 - Rust/Python bindings
- FastAPI - REST API framework
- Pydantic - Data validation
- MCP - Model Context Protocol

## License

MIT License

Copyright (c) 2026 Zac Roach

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.