{"id":22736836,"url":"https://github.com/xwjdsh/lunar","last_synced_at":"2026-02-28T11:04:26.196Z","repository":{"id":47862968,"uuid":"387440769","full_name":"xwjdsh/lunar","owner":"xwjdsh","description":"A command-line tool for searching and converting the lunar calendar [1901~2100]","archived":false,"fork":false,"pushed_at":"2022-01-27T02:49:16.000Z","size":1322,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-13T09:54:55.772Z","etag":null,"topics":["calendar","cli","lunar-calendar"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xwjdsh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-19T11:29:28.000Z","updated_at":"2024-08-21T10:02:28.000Z","dependencies_parsed_at":"2022-08-29T14:10:08.845Z","dependency_job_id":null,"html_url":"https://github.com/xwjdsh/lunar","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xwjdsh/lunar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwjdsh%2Flunar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwjdsh%2Flunar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwjdsh%2Flunar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwjdsh%2Flunar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xwjdsh","download_url":"https://codeload.github.com/xwjdsh/lunar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xwjdsh%2Flunar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29931168,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T09:58:13.507Z","status":"ssl_error","status_checked_at":"2026-02-28T09:57:57.047Z","response_time":90,"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":["calendar","cli","lunar-calendar"],"created_at":"2024-12-10T22:07:37.744Z","updated_at":"2026-02-28T11:04:26.159Z","avatar_url":"https://github.com/xwjdsh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lunar\n\n`lunar` 是一个命令行下的阴历阳历查询转换工具 (支持时间段范围[1901~2100])。\n\n![](https://raw.githubusercontent.com/xwjdsh/lunar/main/screenshot.png)\n\n## 安装\n### Homebrew\n```\nbrew tap xwjdsh/tap\nbrew install xwjdsh/tap/lunar\n```\n### Go\n\u003e 仅支持 `go1.16` 及以上版本\n\nif go_version == 1.16.x\n```\ngo get -u github.com/xwjdsh/lunar/cmd/lunar\n```\nelse\n```\ngo install github.com/xwjdsh/lunar/cmd/lunar\n```\n\n### Docker\n```\nalias lunar='docker run -it --rm wendellsun/lunar'\n\n# 挂载自定义配置\nalias lunar='docker run -it -v $PATH_TO_YOUR_CONFIG:/root/.config/lunar/lunar.yml --rm wendellsun/lunar'\n```\n\n### Manual\n从 [releases](https://github.com/xwjdsh/lunar/releases) 下载对应的可执行文件并将其放到 PATH 环境变量对应的路径中。\n\n## 使用\n```\n\u003e lunar -h\nNAME:\n   lunar - lunar is a command line tool for conversion between Gregorian calendar and lunar calendar.(1901~2100)\n\nUSAGE:\n   lunar [global options] command [command options] [arguments...]\n\nCOMMANDS:\n   alias, a        Show alias date info\n   solar-term, st  Get solar term info\n   config, c       Display config\n   help, h         Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --format value, -f value  Output date format (default: \"2006-01-02\")\n   --config value, -c value  Custom config path (default: \"$HOME/.config/lunar/lunar.yml\")\n   --year value, -y value    Target year (default: $THIS_YEAR)\n   --reverse, -r             Reverse mode, query date by lunar date (default: false)\n   --help, -h                show help (default: false)\n```\n\n### 阳历转阴历\n```\n\u003e # lunar -y 2022       # 指定年份，月日为今日\n\u003e # lunar -y 2022 0701  # 指定年月日\n\u003e lunar                 # 不带参数年月日为今日\n```\n|    阳历    |    阴历    |  星期  | 距今 | 节气 | 别名 | 标签 |\n|  ----  | ----  |  ----  | ----  |  ----  | ----  |  ----  |\n| 2022-01-26 | 2021-12-24 | 星期三 | 今天 |      |      |      |\n\n\n### 阴历转阳历\n```\n\u003e # lunar -r -y 2022      # 查询阴历，指定年份\n\u003e # lunar -r -y 2022 0701 # 查询阴历，指定年月日\n\u003e lunar -r                # 查询阴历，不带参数年月日为阴历今日\n```\n|    阳历    |    阴历    |  星期  |    距今    | 节气 | 别名 | 标签 |\n|  ----  | ----  |  ----  | ----  |  ----  | ----  |  ----  |\n| 2022-02-26 | 2022-01-26 | 星期六 | 还有 31 天 |      |      |      |\n\n### 自定义配置别名\n```\n\u003e # lunar config -d                            # 显示默认配置，默认加入了一些常见节日的别名\n\u003e lunar config -d \u003e ~/.config/lunar/lunar.yml  # 导出默认配置，自定义修改\n\u003e # lunar config                               # 显示当前配置\n```\n例如修改为如下，\n```yml\naliases:\n    - name: xx的生日\n      disable: false\n      date:\n        year: 0\n        month: 5\n        day: 7\n      is_lunar_date: true\n      leap_month_limit: 0\n      tags:\n        - birthday\n```\n|    阳历    |    阴历    |  星期  |    距今     | 节气 |   别名   |   标签   |\n|  ----  | ----  |  ----  | ----  |  ----  | ----  |  ----  |\n| 2022-06-05 | 2022-05-07 | 星期日 | 还有 130 天 |      | xx的生日 | birthday |\n\n\n### 查询别名\n```\n\u003e # lunar a 春节 中秋   # 查询指定别名\n\u003e # lunar -y 2022 a    # 指定年份\n\u003e lunar a              # 列出所有别名日期\n```\n|    阳历    |    阴历    |  星期  |     距今     | 节气 | 别名 |  标签   |\n|  ----  | ----  |  ----  | ----  |  ----  | ----  |  ----  |\n| 2022-01-01 | 2021-11-29 | 星期六 | 已过去 25 天 |      | 元旦 | holiday |\n| 2022-01-10 | 2021-12-08 | 星期一 | 已过去 16 天 |      | 腊八 |         |\n| 2022-02-01 | 2022-01-01 | 星期二 | 还有 6 天    |      | 春节 | holiday |\n| 2022-02-15 | 2022-01-15 | 星期二 | 还有 20 天   |      | 元宵 |         |\n| 2022-04-04 | 2022-03-04 | 星期一 | 还有 68 天   |      | 清明 | holiday |\n| 2022-05-01 | 2022-04-01 | 星期日 | 还有 95 天   |      | 劳动 | holiday |\n| 2022-06-03 | 2022-05-05 | 星期五 | 还有 128 天  |      | 端午 | holiday |\n| 2022-08-04 | 2022-07-07 | 星期四 | 还有 190 天  |      | 七夕 |         |\n| 2022-08-12 | 2022-07-15 | 星期五 | 还有 198 天  |      | 中元 |         |\n| 2022-09-10 | 2022-08-15 | 星期六 | 还有 227 天  |      | 中秋 | holiday |\n| 2022-10-01 | 2022-09-06 | 星期六 | 还有 248 天  |      | 国庆 | holiday |\n| 2022-10-04 | 2022-09-09 | 星期二 | 还有 251 天  |      | 重阳 |         |\n| 2022-12-30 | 2022-12-08 | 星期五 | 还有 338 天  |      | 腊八 |         |\n\n### 查询标签\n```\n\u003e lunar a -t birthday # 查询自定义标签\n\u003e lunar a -t holiday  # 查询标签\n```\n|    阳历    |    阴历    |  星期  |     距今     | 节气 | 别名 |  标签   |\n|  ----  | ----  |  ----  | ----  |  ----  | ----  |  ----  |\n| 2022-01-01 | 2021-11-29 | 星期六 | 已过去 25 天 |      | 元旦 | holiday |\n| 2022-02-01 | 2022-01-01 | 星期二 | 还有 6 天    |      | 春节 | holiday |\n| 2022-04-04 | 2022-03-04 | 星期一 | 还有 68 天   |      | 清明 | holiday |\n| 2022-05-01 | 2022-04-01 | 星期日 | 还有 95 天   |      | 劳动 | holiday |\n| 2022-06-03 | 2022-05-05 | 星期五 | 还有 128 天  |      | 端午 | holiday |\n| 2022-09-10 | 2022-08-15 | 星期六 | 还有 227 天  |      | 中秋 | holiday |\n| 2022-10-01 | 2022-09-06 | 星期六 | 还有 248 天  |      | 国庆 | holiday |\n\n\n### 查询节气\n```\n\u003e # lunar -y 2022 st # 指定年份\n\u003e # lunar st         # 查询所有节气\n\u003e lunar st 冬至    # 查询指定节气\n```\n|    阳历    |    阴历    |  星期  |    距今     | 节气 | 别名 | 标签 |\n|  ----  | ----  |  ----  | ----  |  ----  | ----  |  ----  |\n| 2022-12-22 | 2022-11-29 | 星期四 | 还有 330 天 | 冬至 |      |      |\n\n## 协议\n[MIT License](https://github.com/xwjdsh/lunar/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwjdsh%2Flunar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxwjdsh%2Flunar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxwjdsh%2Flunar/lists"}