{"id":46698881,"url":"https://github.com/thaikolja/filesize-cli","last_synced_at":"2026-05-30T19:00:33.270Z","repository":{"id":324314732,"uuid":"1096799686","full_name":"thaikolja/filesize-cli","owner":"thaikolja","description":"filesize CLI is a fast, reliable command-line tool for calculating file and directory sizes with intelligent unit formatting and recursive traversal support.","archived":false,"fork":false,"pushed_at":"2026-05-30T17:11:47.000Z","size":216,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-30T17:17:32.024Z","etag":null,"topics":["bash","cli","shell"],"latest_commit_sha":null,"homepage":"https://www.kolja-nolte.com","language":"Python","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/thaikolja.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","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},"funding":{"github":["thaikolja"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://www.kolja-nolte.com"]}},"created_at":"2025-11-15T01:06:40.000Z","updated_at":"2026-05-30T17:06:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/thaikolja/filesize-cli","commit_stats":null,"previous_names":["thaikolja/filesize-cli"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/thaikolja/filesize-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaikolja%2Ffilesize-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaikolja%2Ffilesize-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaikolja%2Ffilesize-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaikolja%2Ffilesize-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thaikolja","download_url":"https://codeload.github.com/thaikolja/filesize-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thaikolja%2Ffilesize-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33705207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":["bash","cli","shell"],"created_at":"2026-03-09T06:04:17.331Z","updated_at":"2026-05-30T19:00:33.264Z","avatar_url":"https://github.com/thaikolja.png","language":"Python","funding_links":["https://github.com/sponsors/thaikolja","https://www.kolja-nolte.com"],"categories":[],"sub_categories":[],"readme":"# filesize-cli\n\n[![PyPI - Version](https://img.shields.io/pypi/v/filesize-cli)](https://pypi.org/project/filesize-cli/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/filesize-cli)](https://pypi.org/project/filesize-cli/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/filesize-cli)](https://pypi.org/project/filesize-cli/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit)\n\nA zero-dependency command-line tool for calculating file and directory sizes with intelligent unit formatting and recursive traversal support.\n\n## Features\n\n- **Intelligent Unit Detection**: Automatically selects the most appropriate unit (B, KB, MB, GB, TB) based on file size\n- **Recursive Directory Sizing**: Calculate total size of directories including all subdirectories with `-r`\n- **Clean Raw Output**: Get raw byte sizes without formatting using `-c` flag\n- **Force Specific Units**: Display sizes in specific units with `-u`\n- **Zero External Dependencies**: Uses only Python standard library (`argparse`, `pathlib`, `typing`, `sys`)\n- **Robust Error Handling**: Gracefully handles permission errors, missing files, and edge cases\n- **Cross-Platform**: Works on Windows, macOS, and Linux\n- **Well-Tested**: Comprehensive test suite with \u003e90% coverage\n\n## Requirements\n\n- Python 3.9 or higher\n\n## Installation\n\n```bash\n# From PyPI\npip install filesize-cli\n\n# Using pipx (isolated environment)\npipx install filesize-cli\n\n# From source\ngit clone https://github.com/thaikolja/filesize-cli.git\ncd filesize-cli\npip install .\n```\n\n## Usage\n\n```bash\n# Show size of a file (auto unit detection)\nfilesize document.pdf\n\n# Show size of a directory\nfilesize ~/Documents\n\n# Recursive directory sizing\nfilesize -r ~/Projects\n\n# Force specific unit\nfilesize -u mb image.jpg\n\n# Raw bytes output\nfilesize -c data.bin\n\n# Multiple paths\nfilesize file1.txt file2.txt directory/\n```\n\n## Command Reference\n\n### Arguments\n\n| Argument | Description |\n|----------|-------------|\n| `PATH [PATH ...]` | One or more files or directories to analyze (required) |\n\n### Options\n\n| Option | Description |\n|--------|-------------|\n| `-u, --unit {b,kb,mb,gb,tb}` | Force display in specific unit |\n| `-c, --clean` | Display raw sizes in bytes only |\n| `-r, --recursive` | Recurse into subdirectories |\n| `-v, --version` | Show version and exit |\n| `-h, --help` | Show help message and exit |\n\n### Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| `0` | Success |\n| `1` | General error |\n| `130` | Operation cancelled (Ctrl+C) |\n\n## Examples\n\n### Auto Unit Detection\n\n```bash\n$ filesize photo.jpg\nphoto.jpg: 2.45 MB (1 file)\n```\n\n### Force Specific Unit\n\n```bash\n$ filesize -u kb document.pdf\ndocument.pdf: 1,247.00 KB (1 file)\n```\n\n### Raw Byte Output\n\n```bash\n$ filesize -c config.json\n1543\n```\n\n### Directory Sizing\n\n```bash\n# Non-recursive (top-level only)\n$ filesize ~/Documents\n/Users/kolja/Documents: 45.20 MB (12 files)\n\n# Recursive (including subdirectories)\n$ filesize -r ~/Documents\n/Users/kolja/Documents: 1.23 GB (1,456 files)\n```\n\n### Programmatic Usage\n\n```python\nfrom filesize_cli.cli import FilesizeCLI\n\ncli = FilesizeCLI()\nsize_info = cli.get_size('/path/to/file.txt')\nprint(size_info)  # /path/to/file.txt: 1.23 MB (1 file)\n```\n\n## Development\n\n### Setup\n\n```bash\ngit clone https://github.com/thaikolja/filesize-cli.git\ncd filesize-cli\npython -m venv venv\nsource venv/bin/activate\npip install -e \".[dev]\"\npre-commit install\n```\n\n### Commands\n\n| Action | Command |\n|--------|---------|\n| format | `black src tests \u0026\u0026 isort src tests` |\n| lint | `black --check src tests \u0026\u0026 isort --check-only src tests \u0026\u0026 flake8 src tests \u0026\u0026 mypy src` |\n| test | `pytest` |\n| coverage | `pytest --cov=filesize_cli --cov-report=html` |\n| build | `python -m build` |\n\n## Contributing\n\nContributions are welcome. Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a detailed history of changes.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Author\n\n**Kolja Nolte** - [GitHub](https://github.com/thaikolja) | [Website](https://www.kolja-nolte.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthaikolja%2Ffilesize-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthaikolja%2Ffilesize-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthaikolja%2Ffilesize-cli/lists"}