@hasna/domains 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +119 -0
  2. package/dist/cli/commands/alerts.d.ts +3 -0
  3. package/dist/cli/commands/alerts.d.ts.map +1 -0
  4. package/dist/cli/commands/brandsight.d.ts +3 -0
  5. package/dist/cli/commands/brandsight.d.ts.map +1 -0
  6. package/dist/cli/commands/dns.d.ts +3 -0
  7. package/dist/cli/commands/dns.d.ts.map +1 -0
  8. package/dist/cli/commands/domains.d.ts +3 -0
  9. package/dist/cli/commands/domains.d.ts.map +1 -0
  10. package/dist/cli/commands/providers.d.ts +3 -0
  11. package/dist/cli/commands/providers.d.ts.map +1 -0
  12. package/dist/cli/index.d.ts +3 -0
  13. package/dist/cli/index.d.ts.map +1 -0
  14. package/dist/cli/index.js +13793 -0
  15. package/dist/db/alerts.d.ts +21 -0
  16. package/dist/db/alerts.d.ts.map +1 -0
  17. package/dist/db/database.d.ts +7 -0
  18. package/dist/db/database.d.ts.map +1 -0
  19. package/dist/db/dns-records.d.ts +46 -0
  20. package/dist/db/dns-records.d.ts.map +1 -0
  21. package/dist/db/dns-tools.d.ts +62 -0
  22. package/dist/db/dns-tools.d.ts.map +1 -0
  23. package/dist/db/domain-records.d.ts +97 -0
  24. package/dist/db/domain-records.d.ts.map +1 -0
  25. package/dist/db/domains.d.ts +17 -0
  26. package/dist/db/domains.d.ts.map +1 -0
  27. package/dist/db/migrations.d.ts +7 -0
  28. package/dist/db/migrations.d.ts.map +1 -0
  29. package/dist/db/monitoring.d.ts +25 -0
  30. package/dist/db/monitoring.d.ts.map +1 -0
  31. package/dist/index.d.ts +9 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +10376 -0
  34. package/dist/lib/brandsight.d.ts +55 -0
  35. package/dist/lib/brandsight.d.ts.map +1 -0
  36. package/dist/lib/godaddy.d.ts +70 -0
  37. package/dist/lib/godaddy.d.ts.map +1 -0
  38. package/dist/lib/namecheap.d.ts +89 -0
  39. package/dist/lib/namecheap.d.ts.map +1 -0
  40. package/dist/lib/registrar.d.ts +71 -0
  41. package/dist/lib/registrar.d.ts.map +1 -0
  42. package/dist/mcp/index.d.ts +3 -0
  43. package/dist/mcp/index.d.ts.map +1 -0
  44. package/dist/mcp/index.js +15499 -0
  45. package/package.json +71 -0
package/README.md ADDED
@@ -0,0 +1,119 @@
1
+ # @hasna/domains
2
+
3
+ Domain portfolio and DNS management for AI agents — CLI + MCP server with SQLite.
4
+
5
+ ## Features
6
+
7
+ - **Domain portfolio management** — track registrar, expiry, SSL, nameservers, status
8
+ - **DNS record CRUD** — A, AAAA, CNAME, MX, TXT, NS, SRV records
9
+ - **Expiry alerts** — set alerts for domain expiry and SSL certificate expiry
10
+ - **WHOIS lookup** — query and store registrar/expiry info from WHOIS
11
+ - **SSL certificate check** — verify SSL issuer and expiry
12
+ - **DNS propagation check** — query Google, Cloudflare, Quad9, OpenDNS
13
+ - **Zone file export/import** — BIND-format zone files
14
+ - **Subdomain discovery** — via crt.sh certificate transparency logs
15
+ - **DNS validation** — detect CNAME conflicts, missing MX, and more
16
+ - **Portfolio export** — CSV or JSON with all domain data
17
+ - **Registrar sync** — Namecheap and GoDaddy integration
18
+ - **Brand monitoring** — typosquat/threat detection via Brandsight API
19
+ - **MCP server** — full Model Context Protocol support for AI agents
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ npm install -g @hasna/domains
25
+ ```
26
+
27
+ Data is stored at `~/.hasna/domains/domains.db`. Override with `HASNA_DOMAINS_DIR` or `DOMAINS_DIR` env var.
28
+
29
+ ## CLI Usage
30
+
31
+ ```bash
32
+ # Domain management
33
+ domains add --name example.com --registrar Namecheap --expires-at 2025-01-01
34
+ domains list
35
+ domains list --status active --registrar Namecheap
36
+ domains get <id>
37
+ domains update <id> --notes "renewed"
38
+ domains delete <id>
39
+ domains search example
40
+ domains stats
41
+
42
+ # Expiry monitoring
43
+ domains expiring --days 30
44
+ domains ssl --days 30
45
+
46
+ # WHOIS / SSL checks
47
+ domains whois example.com
48
+ domains ssl-check example.com
49
+ domains check-all
50
+
51
+ # Portfolio export
52
+ domains export --format csv --output portfolio.csv
53
+ domains export --format json
54
+
55
+ # DNS record management
56
+ domains dns list <domain-id>
57
+ domains dns add --domain <id> --type A --name @ --value 1.2.3.4
58
+ domains dns update <record-id> --value 5.6.7.8
59
+ domains dns remove <record-id>
60
+ domains dns check-propagation example.com --record A
61
+ domains dns export <domain-id>
62
+ domains dns import <domain-id> --file zone.txt
63
+ domains dns discover-subdomains example.com
64
+ domains dns validate <domain-id>
65
+
66
+ # Alerts
67
+ domains alert set --domain <id> --type expiry --days-before 30
68
+ domains alert list <domain-id>
69
+ domains alert remove <alert-id>
70
+
71
+ # Registrar integration
72
+ domains providers
73
+ domains sync --provider namecheap
74
+ domains sync --provider godaddy
75
+ domains sync --all
76
+ domains renew example.com --provider namecheap
77
+ domains check example.com
78
+
79
+ # Brand monitoring
80
+ domains monitor mybrand
81
+ domains similar example.com
82
+ domains threats example.com
83
+ ```
84
+
85
+ ## MCP Server
86
+
87
+ ```bash
88
+ domains-mcp
89
+ ```
90
+
91
+ Add to your Claude/agent config:
92
+
93
+ ```json
94
+ {
95
+ "mcpServers": {
96
+ "domains": {
97
+ "command": "domains-mcp"
98
+ }
99
+ }
100
+ }
101
+ ```
102
+
103
+ ## Environment Variables
104
+
105
+ | Variable | Description |
106
+ |----------|-------------|
107
+ | `HASNA_DOMAINS_DIR` | Override database directory |
108
+ | `DOMAINS_DIR` | Override database directory (fallback) |
109
+ | `NAMECHEAP_API_KEY` | Namecheap API key |
110
+ | `NAMECHEAP_USERNAME` | Namecheap account username |
111
+ | `NAMECHEAP_CLIENT_IP` | Namecheap whitelisted IP |
112
+ | `NAMECHEAP_SANDBOX` | Use Namecheap sandbox API |
113
+ | `GODADDY_API_KEY` | GoDaddy API key |
114
+ | `GODADDY_API_SECRET` | GoDaddy API secret |
115
+ | `BRANDSIGHT_API_KEY` | Brandsight API key |
116
+
117
+ ## License
118
+
119
+ Apache-2.0
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerAlertCommands(program: Command): void;
3
+ //# sourceMappingURL=alerts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alerts.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/alerts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA+D5D"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerBrandsightCommands(program: Command): void;
3
+ //# sourceMappingURL=brandsight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brandsight.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/brandsight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkFjE"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerDnsCommands(program: Command): void;
3
+ //# sourceMappingURL=dns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAczC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmO1D"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerDomainCommands(program: Command): void;
3
+ //# sourceMappingURL=domains.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domains.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/domains.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAkBzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8U7D"}
@@ -0,0 +1,3 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerProviderCommands(program: Command): void;
3
+ //# sourceMappingURL=providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBzC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoM/D"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bun
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":""}