{"id":48883076,"url":"https://github.com/lessup/build-your-own-tools","last_synced_at":"2026-04-16T04:01:01.581Z","repository":{"id":325116745,"uuid":"1099585820","full_name":"LessUp/build-your-own-tools","owner":"LessUp","description":"Rebuild Common CLI Tools from Scratch in Rust/Go (dos2unix, gzip, htop) — Low-Level Practice | 用 Rust/Go 手写常用命令行工具（dos2unix、gzip、htop），练习底层实现与跨语言对比","archived":false,"fork":false,"pushed_at":"2026-04-15T18:58:20.000Z","size":1808,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-15T20:34:45.137Z","etag":null,"topics":["cli","command-line-tools","cross-platform","go","golang","learning","rust","systems-programming"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LessUp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2025-11-19T07:21:24.000Z","updated_at":"2026-04-15T18:58:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"ecd653cc-f03b-4bd0-a87b-5291fd15d13a","html_url":"https://github.com/LessUp/build-your-own-tools","commit_stats":null,"previous_names":["lessup/build-your-own-utils","lessup/build-your-own-tools"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/LessUp/build-your-own-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LessUp%2Fbuild-your-own-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LessUp%2Fbuild-your-own-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LessUp%2Fbuild-your-own-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LessUp%2Fbuild-your-own-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LessUp","download_url":"https://codeload.github.com/LessUp/build-your-own-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LessUp%2Fbuild-your-own-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31870516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"online","status_checked_at":"2026-04-16T02:00:06.042Z","response_time":69,"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","command-line-tools","cross-platform","go","golang","learning","rust","systems-programming"],"created_at":"2026-04-16T04:00:54.510Z","updated_at":"2026-04-16T04:01:01.567Z","avatar_url":"https://github.com/LessUp.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Build-Your-Own-Tools\n\n[![CI](https://github.com/LessUp/build-your-own-tools/actions/workflows/ci.yml/badge.svg)](https://github.com/LessUp/build-your-own-tools/actions/workflows/ci.yml)\n[![Docs](https://github.com/LessUp/build-your-own-tools/actions/workflows/pages.yml/badge.svg)](https://lessup.github.io/build-your-own-tools/)\n[![License](https://img.shields.io/badge/License-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE)\n[![Rust](https://img.shields.io/badge/Rust-1.70+-orange.svg)](https://www.rust-lang.org/)\n[![Go](https://img.shields.io/badge/Go-1.21+-00ADD8.svg)](https://golang.org/)\n\n**English** | [简体中文](README.zh-CN.md)\n\nA learning-focused repository for re-implementing common CLI tools from scratch in **Rust** and **Go**. Perfect for understanding low-level system programming, CLI design patterns, and cross-language implementation comparisons.\n\n[📖 Documentation](https://lessup.github.io/build-your-own-tools/) | [🚀 Quick Start](docs/en/GETTING-STARTED.md) | [📋 Architecture](docs/en/ARCHITECTURE.md) | [🔍 Comparison](docs/en/COMPARISON.md)\n\n---\n\n## 🚀 Quick Start\n\n```bash\n# Clone the repository\ngit clone https://github.com/LessUp/build-your-own-tools.git\ncd build-your-own-tools\n\n# Build all Rust projects\nmake build-rust\n\n# Build all Go projects\nmake build-go\n\n# Run all tests\nmake test-all\n\n# Run a tool\necho \"Hello World\" | ./target/release/dos2unix-rust\n```\n\n---\n\n## 📦 Projects\n\n| Project | Languages | Description | Status | Version |\n|---------|-----------|-------------|--------|---------|\n| [dos2unix](./dos2unix/) | Rust | CRLF → LF line ending converter | ✅ Stable | v0.2.1 |\n| [gzip](./gzip/) | Rust, Go | Gzip compression/decompression CLI | ✅ Stable | v0.3.0 |\n| [htop](./htop/) | Rust, Go | Cross-platform TUI system monitor | ✅ Stable | v0.1.5 |\n\n### Project Overview\n\n```mermaid\nflowchart LR\n    subgraph Beginner[\"⭐ Beginner\"]\n        D[dos2unix]\n    end\n    subgraph Intermediate[\"⭐⭐ Intermediate\"]\n        G[gzip]\n    end\n    subgraph Advanced[\"⭐⭐⭐ Advanced\"]\n        H[htop]\n    end\n    \n    Beginner --\u003e Intermediate --\u003e Advanced\n```\n\n---\n\n## 🎯 Features\n\n- **Multi-Language Implementation** — Same tool in Rust and Go for side-by-side comparison\n- **Cross-Platform** — Linux, macOS, Windows support\n- **Production-Ready** — Unit tests, CI/CD, automated releases\n- **Well-Documented** — Architecture docs, API references, comparison guides\n- **Learning Path** — Progressive difficulty from simple to advanced\n\n---\n\n## 🏗️ Project Structure\n\n```\nbuild-your-own-tools/\n├── 📁 docs/                      # Documentation\n│   ├── en/                      # English docs\n│   ├── zh-CN/                   # Chinese docs\n│   └── changelogs/              # Changelog index\n│\n├── 📁 dos2unix/                  # CRLF to LF converter\n│   ├── src/main.rs\n│   └── changelog/CHANGELOG.md\n│\n├── 📁 gzip/\n│   ├── go/                      # Go implementation\n│   └── rust/                    # Rust implementation\n│\n├── 📁 htop/\n│   ├── shared/                  # Shared library\n│   ├── unix/rust/               # Unix implementation\n│   └── win/                     # Windows implementations\n│\n├── Cargo.toml                   # Rust workspace\n├── go.work                      # Go workspace\n└── Makefile                     # Build automation\n```\n\n---\n\n## 🛠️ Development\n\n### Prerequisites\n\n| Tool | Version | Install |\n|------|---------|---------|\n| Rust | 1.70+ | [rustup.rs](https://rustup.rs/) |\n| Go | 1.21+ | [golang.org](https://golang.org/dl/) |\n| make | any | pre-installed |\n\n### Build Commands\n\n```bash\n# Build everything\nmake build-all\n\n# Build specific projects\nmake build-dos2unix\nmake build-gzip-rust\nmake build-gzip-go\nmake build-htop-unix-rust\nmake build-htop-win-rust\n\n# Run tests\nmake test-all\nmake test-rust\nmake test-go\n\n# Lint code\nmake lint-all\n\n# Format code\nmake fmt-all\n```\n\n### Development Workflow\n\n```bash\n# 1. Format code\nmake fmt-all\n\n# 2. Run linter\nmake lint-all\n\n# 3. Run tests\nmake test-all\n\n# 4. Build release\nmake build-all\n```\n\n---\n\n## 📖 Documentation\n\n| Document | Description |\n|----------|-------------|\n| [Getting Started](docs/en/GETTING-STARTED.md) | Environment setup and first build |\n| [Architecture Guide](docs/en/ARCHITECTURE.md) | System design and patterns |\n| [Rust vs Go Comparison](docs/en/COMPARISON.md) | Language trade-offs and benchmarks |\n| [API Reference](docs/en/API.md) | Library function documentation |\n| [Changelog](CHANGELOG.md) | Version history and changes |\n| [Migration Guide](docs/changelogs/MIGRATION.md) | Version upgrade instructions |\n\n---\n\n## 🧪 Testing\n\n```bash\n# Run all tests with verbose output\ncargo test --all -- --nocapture\ngo test -v ./...\n\n# Run specific test\ncargo test -p dos2unix-rust test_stream_large_data\ngo test -C gzip/go -run TestGzipStream\n\n# With coverage\ncargo tarpaulin --all\ngo test -cover ./...\n```\n\n---\n\n## 📊 Learning Goals\n\nEach sub-project teaches specific concepts:\n\n| Topic | dos2unix | gzip | htop |\n|-------|----------|------|------|\n| File I/O | ✅ Streaming | ✅ Streaming | - |\n| CLI Design | ✅ Manual args | ✅ clap/pflag | ✅ Interactive |\n| Error Handling | ✅ anyhow | ✅ anyhow | ✅ anyhow |\n| Compression | - | ✅ DEFLATE | - |\n| System APIs | - | - | ✅ Process info |\n| TUI | - | - | ✅ ratatui/tview |\n| Concurrency | - | ✅ goroutines | ✅ Async refresh |\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit changes (`git commit -m 'feat: add amazing feature'`)\n4. Push to branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n---\n\n## 📋 Roadmap\n\n### 2026 Q2\n\n- [ ] New tool: `cat` implementation\n- [ ] New tool: `wc` (word count)\n- [ ] Enhanced documentation with tutorials\n\n### 2026 Q3\n\n- [ ] Network monitoring in htop\n- [ ] Disk I/O monitoring\n- [ ] Plugin system exploration\n\n### Future\n\n- [ ] Container-aware process grouping\n- [ ] Remote system monitoring\n- [ ] Additional language implementations (Zig?)\n\n---\n\n## 📄 License\n\nLicensed under either of\n\n- Apache License, Version 2.0 ([LICENSE](LICENSE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT License ([LICENSE](LICENSE) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n---\n\n## 🙏 Acknowledgments\n\n- [ratatui](https://github.com/ratatui-org/ratatui) — Rust TUI framework\n- [tview](https://github.com/rivo/tview) — Go TUI framework\n- [sysinfo](https://github.com/GuillaumeGomez/sysinfo) — Rust system info\n- [gopsutil](https://github.com/shirou/gopsutil) — Go system info\n- [flate2](https://github.com/rust-lang/flate2-rs) — Rust DEFLATE compression\n- [clap](https://github.com/clap-rs/clap) — Rust CLI parser\n\n---\n\n**Last Updated**: 2026-04-16  \n**Version**: v0.2.0+\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flessup%2Fbuild-your-own-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flessup%2Fbuild-your-own-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flessup%2Fbuild-your-own-tools/lists"}