A fast, concurrent documentation downloader for sosumi.ai that preserves proper markdown link relationships and supports downloading specific documentation paths or entire documentation types.
- 🚀 Concurrent downloads using async Rust with tokio
- 🔗 Link preservation - converts absolute URLs to relative paths for offline browsing
- 📚 Flexible paths - download specific documentation pages or entire documentation types
- 🎯 Precise link parsing - handles complex URLs with nested parentheses
- 🏗️ Nix-powered - reproducible builds and development environment
-
Clone the repository:
git clone <repository-url> cd sosumi-docs-downloader
-
Enter the development environment:
nix develop
-
Build the binary:
nix build
-
Run directly from nix:
nix run . -- endpointsecurity
If you have Rust installed:
cargo build --release
./target/release/sosumi-docs-downloader --helpDownload a single documentation type:
sosumi-docs-downloader endpointsecurityDownload multiple documentation types:
sosumi-docs-downloader endpointsecurity fskit sandboxingsosumi-docs-downloader [OPTIONS] <DOC_TYPES>...
# Download to specific directory
sosumi-docs-downloader -o ./docs endpointsecurity
# Limit crawl depth (default: unlimited)
sosumi-docs-downloader -d 2 endpointsecurity
# Combine options
sosumi-docs-downloader -o ./my-docs -d 3 endpointsecurity fskit-
<DOC_TYPES>- Documentation paths to download (required)- Examples:
endpointsecurity,swift/array,fskit,sandboxing, etc. - Can be top-level documentation types or specific sub-paths
- Examples:
-
-o, --outdir <DIR>- Output directory (default: current directory.) -
-d, --max-depth <NUM>- Maximum crawl depth (default: 0 = unlimited)- Use
1for single page only - Use
2for moderate depth - Use
0for unlimited depth (recommended)
- Use
Download Endpoint Security docs to current directory:
sosumi-docs-downloader endpointsecurityDownload multiple docs with depth limit:
sosumi-docs-downloader -d 2 endpointsecurity fskitDownload specific documentation page:
sosumi-docs-downloader swift/arrayDownload to custom directory:
sosumi-docs-downloader -o ./documentation endpointsecurityFull example with all options:
sosumi-docs-downloader -o ./docs -d 3 endpointsecurity fskit sandboxingThe downloader creates a directory structure like:
output-dir/
├── endpointsecurity/
│ ├── index.md
│ ├── client.md
│ ├── es_new_client(_:_:).md
│ └── ...
└── fskit/
├── index.md
└── ...
All markdown links are converted from absolute URLs to relative paths, making the documentation browsable offline.
# Enter development environment
nix develop
# Run tests
cargo test
# Build and run
cargo run -- endpointsecurity
# Format code
cargo fmt
# Lint code
cargo clippy# Build the package
nix build
# Run directly
nix run . -- endpointsecurity
# Enter development shell
nix develop
# Check the flake
nix flake check- Language: Rust with async/await
- HTTP Client: reqwest with connection pooling
- Concurrency: tokio with futures for parallel downloads
- Link Parsing: Custom regex-free parser handling nested parentheses
- Build System: Nix flakes for reproducible builds
- Fork the repository
- Create a feature branch
- Make your changes
- Test with
nix build && nix run . -- endpointsecurity - Submit a pull request
- sosumi.ai - The documentation source
- agents-workflow - Parent project