{"id":47793242,"url":"https://github.com/zcaceres/crt-cli","last_synced_at":"2026-04-03T15:56:20.228Z","repository":{"id":344478215,"uuid":"1181325914","full_name":"zcaceres/crt-cli","owner":"zcaceres","description":"Search Certificate Transparency logs via crt.sh — CLI, MCP server, and TypeScript library","archived":false,"fork":false,"pushed_at":"2026-03-14T22:15:06.000Z","size":59,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-15T07:42:50.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zcaceres.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-14T02:04:42.000Z","updated_at":"2026-03-14T22:14:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zcaceres/crt-cli","commit_stats":null,"previous_names":["zcaceres/crt-cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zcaceres/crt-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaceres%2Fcrt-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaceres%2Fcrt-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaceres%2Fcrt-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaceres%2Fcrt-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zcaceres","download_url":"https://codeload.github.com/zcaceres/crt-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zcaceres%2Fcrt-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31362035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T15:19:21.178Z","status":"ssl_error","status_checked_at":"2026-04-03T15:19:20.670Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-03T15:56:19.698Z","updated_at":"2026-04-03T15:56:20.213Z","avatar_url":"https://github.com/zcaceres.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crt-cli\n\nSearch [Certificate Transparency](https://certificate.transparency.dev/) logs via [crt.sh](https://crt.sh). Available as a CLI, an MCP server, or a TypeScript library.\n\nBuilt with [Bun](https://bun.sh).\n\n## Install\n\n```bash\nbun install\n```\n\n## CLI\n\n```bash\ncrt \u003ccommand\u003e [args] [flags]\n```\n\n### Commands\n\n**search** — Search CT logs for certificates matching a domain.\n\n```bash\ncrt search example.com\ncrt search example.com example.org\ncrt search example.com -w -e -d\ncrt search example.com --format csv\n```\n\n| Flag | Alias | Description |\n|------|-------|-------------|\n| `--wildcard` | `-w` | Prefix query with `%.` for subdomain search |\n| `--exclude-expired` | `-e` | Exclude expired certificates |\n| `--dedupe` | `-d` | Deduplicate results by serial number |\n| `--format \u003cfmt\u003e` | `-f` | Output format: `json` (default), `table`, `csv`, `subdomains` |\n\n**subdomains** — Find unique subdomains for a domain. Shortcut for `search -w --format subdomains`.\n\n```bash\ncrt subdomains example.com\ncrt subdomains example.com -e\n```\n\n**cert** — Look up a specific certificate by its crt.sh ID.\n\n```bash\ncrt cert 12345678\n```\n\n### Global flags\n\n| Flag | Alias | Description |\n|------|-------|-------------|\n| `--version` | `-V` | Print version |\n| `--describe` | | Output JSON schema of all commands (see below) |\n| `--help` | `-h` | Show help |\n\n### Machine-readable description\n\n```bash\ncrt --describe\n```\n\nOutputs a JSON schema of all commands, arguments, and flags. Useful for agent tool discovery.\n\n## MCP Server\n\nThe MCP server exposes the same functionality over the [Model Context Protocol](https://modelcontextprotocol.io/) via stdio transport.\n\n```bash\nbun run src/mcp.ts\n```\n\n### Tools\n\n| Tool | Description |\n|------|-------------|\n| `search_certificates` | Search CT logs. Accepts `domain` or `domains` (array), `wildcard`, `excludeExpired`, `dedupe`, `format`. |\n| `find_subdomains` | Find unique subdomains for a domain (wildcard search). |\n| `lookup_cert` | Look up a certificate by crt.sh ID. |\n\n### Configuration\n\nAdd to your MCP client config:\n\n```json\n{\n  \"mcpServers\": {\n    \"crt-sh\": {\n      \"command\": \"bun\",\n      \"args\": [\"run\", \"/path/to/crt-cli/src/mcp.ts\"]\n    }\n  }\n}\n```\n\n## Library\n\nImport directly into your TypeScript/Bun project:\n\n```ts\nimport {\n  searchCertificates,\n  extractSubdomains,\n  dedupeBySerial,\n  createServer,\n} from \"crt-cli\";\n```\n\n### API\n\n```ts\n// Search for certificates\nconst certs = await searchCertificates(\"example.com\", {\n  wildcard: true,\n  excludeExpired: true,\n});\n\n// Extract unique subdomains\nconst subs = extractSubdomains(certs);\n\n// Deduplicate by serial number\nconst unique = dedupeBySerial(certs);\n\n// Embed the MCP server in your own application\nconst server = createServer();\n```\n\n### Exports\n\n| Export | Type | Description |\n|--------|------|-------------|\n| `searchCertificates` | function | Query crt.sh and return parsed results |\n| `dedupeBySerial` | function | Deduplicate entries by serial number |\n| `extractSubdomains` | function | Extract sorted unique subdomains from entries |\n| `buildUrl` | function | Build a crt.sh query URL |\n| `validateCertId` | function | Validate a certificate ID string |\n| `validateDomain` | function | Validate a domain string (rejects invalid characters, missing dots, etc.) |\n| `CrtShError` | class | Error class with code (`NETWORK_ERROR`, `SERVER_ERROR`, `HTTP_ERROR`, `PARSE_ERROR`, `VALIDATION_ERROR`, `INVALID_ARG`, `INVALID_DOMAIN`) |\n| `formatJson` | function | Format entries as pretty-printed JSON |\n| `formatTable` | function | Format entries as an ASCII table |\n| `formatCsv` | function | Format entries as RFC 4180 CSV |\n| `formatSubdomains` | function | Format subdomains as a newline-separated list |\n| `formatMultiDomainJson` | function | Format multi-domain results as grouped JSON |\n| `formatMultiDomainResults` | function | Format multi-domain results with domain headers |\n| `formatError` | function | Format an error as JSON |\n| `searchMultipleDomains` | function | Search multiple domains with sequential delay |\n| `MultiDomainResult` | type | Result type for multi-domain search |\n| `createServer` | function | Create an MCP server instance |\n| `CrtShEntrySchema` | Zod schema | Schema for a single crt.sh entry |\n| `CrtShResponseSchema` | Zod schema | Schema for an array of entries |\n| `CrtShEntry` | type | TypeScript type for a certificate entry |\n| `CrtShResponse` | type | TypeScript type for the response array |\n\n## Testing\n\n```bash\nbun test\n```\n\n150+ tests across 11 files covering the CLI, API, formatters, argument parsing, schema validation, library exports, MCP server, CSV integration, and multi-domain pipelines.\n\n## Linting\n\n```bash\nbun run check        # lint and format check\nbun run check:fix    # auto-fix\n```\n\nUses [Biome](https://biomejs.dev/) for linting and formatting.\n\n## CI/CD\n\nGitHub Actions runs lint and tests on every push and PR to `main`. On push to `main`, if the version in `package.json` has changed, it builds standalone binaries for Linux (x64, arm64), macOS (x64, arm64), and Windows (x64) and creates a GitHub release.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcaceres%2Fcrt-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzcaceres%2Fcrt-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzcaceres%2Fcrt-cli/lists"}