{"id":21228401,"url":"https://github.com/zuisong/rs-fortune","last_synced_at":"2026-03-06T02:36:41.849Z","repository":{"id":169639582,"uuid":"645636101","full_name":"zuisong/rs-fortune","owner":"zuisong","description":"Command-line tool that prints random fortune entries. rust version of fortune","archived":false,"fork":false,"pushed_at":"2026-02-20T06:55:18.000Z","size":148,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-20T11:21:07.325Z","etag":null,"topics":["cli","commandline-tool","fortune","fortune-cookie"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/zuisong.png","metadata":{"files":{"readme":"readme-cn.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,"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":"2023-05-26T05:18:31.000Z","updated_at":"2026-02-20T06:55:22.000Z","dependencies_parsed_at":"2023-11-30T15:27:00.496Z","dependency_job_id":"55f54da3-1b7b-437b-95b7-a6a035280166","html_url":"https://github.com/zuisong/rs-fortune","commit_stats":null,"previous_names":["zuisong/rs-fortune"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/zuisong/rs-fortune","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuisong%2Frs-fortune","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuisong%2Frs-fortune/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuisong%2Frs-fortune/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuisong%2Frs-fortune/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zuisong","download_url":"https://codeload.github.com/zuisong/rs-fortune/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuisong%2Frs-fortune/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30159650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T22:39:40.138Z","status":"online","status_checked_at":"2026-03-06T02:00:08.268Z","response_time":250,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cli","commandline-tool","fortune","fortune-cookie"],"created_at":"2024-11-20T23:18:37.774Z","updated_at":"2026-03-06T02:36:41.820Z","avatar_url":"https://github.com/zuisong.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rs-fortune\n\n`rs-fortune`是一个简单的Rust命令行工具,用于打印随机的fortune条目。  \n\n## 安装  \n\n- 可以从 Release 页面下载安装\n- 可以通过Cargo安装:  \n\n    ```bash\n    cargo install --git https://github.com/zuisong/rs-fortune\n    ```\n\n- MacOS 可以通过homebrew 安装\n\n    ```bash\n    brew install zuisong/tap/rs-fortune\n    ```\n\n## 用法\n\n```txt\nA rust version of fortune\n\nUsage: rs-fortune [FORTUNE_FILE] [COMMAND]\n\nCommands:\n  completions  Generate tab-completion scripts for your shell\n  help         Print this message or the help of the given subcommand(s)\n\nArguments:\n  [FORTUNE_FILE]  The fortune cookie file path [env: FORTUNE_FILE=/Users/chen/.config/fish/kindle.txt]\n\nOptions:\n  -h, --help     Print help\n  -V, --version  Print version\n```\n\n`\u003cfortune文件\u003e` 是包含 fortune 条目的文本文件, 每条 fortune 之间用独占一行的一个 % 分隔。\n\n`rs-fortune` 也支持从 `FORTUNE_FILE` 环境变量中读取 `\u003cfortune文件\u003e` 路径:\n\n```bash\nFORTUNE_FILE=fortunes.txt rs-fortune\n```\n\n如果同时传入了命令行参数和环境变量,命令行参数的优先级更高。\n\n例如,一个fortune文件fortunes.txt的内容可以是:\n\n```txt\nFortune favors the bold.\n%\nThe early bird gets the worm.\n%\nSlow and steady wins the race.\n```\n\n然后你可以这样使用:\n\n```bash\nrs-fortune fortunes.txt\n# 可能输出  \n# Fortune favors the bold  \n\n### 也可以从环境变量读取 fortune 文件路径\nFORTUNE_FILE=fortunes.txt rs-fortune  \n\n### 也可以从管道中读取 fortunes\ncat fortunes.txt | rs-fortune  \n\n# 打印帮助信息\nrs-fortune --help  \n```\n\n如果不传入 `\u003cfortune文件\u003e` 或 `FORTUNE_FILE` 环境变量,将打印一条默认的 fortune\n\n这是一个简单实用的命令行工具,可以用来打印随机的名言警句等。欢迎提出改进意见和建议!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuisong%2Frs-fortune","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuisong%2Frs-fortune","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuisong%2Frs-fortune/lists"}