{"id":29295035,"url":"https://github.com/mrvi0/cli-json-formatter","last_synced_at":"2026-05-03T17:31:59.614Z","repository":{"id":302484043,"uuid":"1012600698","full_name":"mrvi0/cli-json-formatter","owner":"mrvi0","description":"Lightweight CLI tool for JSON validation and formatting. Fast bash script with jq dependency","archived":false,"fork":false,"pushed_at":"2025-07-02T15:53:47.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-02T16:45:27.978Z","etag":null,"topics":["bash","cli","cli-utility","command-line-tool","formatter","json","json-prettifier","linux","shell-script","utility","validator"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/mrvi0.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-02T15:23:35.000Z","updated_at":"2025-07-02T15:57:13.000Z","dependencies_parsed_at":"2025-07-02T16:45:29.708Z","dependency_job_id":"9ffd7ffb-4d81-446d-92d1-ac7755a56776","html_url":"https://github.com/mrvi0/cli-json-formatter","commit_stats":null,"previous_names":["mrvi0/cli-json-formatter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrvi0/cli-json-formatter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrvi0%2Fcli-json-formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrvi0%2Fcli-json-formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrvi0%2Fcli-json-formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrvi0%2Fcli-json-formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrvi0","download_url":"https://codeload.github.com/mrvi0/cli-json-formatter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrvi0%2Fcli-json-formatter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32578578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["bash","cli","cli-utility","command-line-tool","formatter","json","json-prettifier","linux","shell-script","utility","validator"],"created_at":"2025-07-06T14:00:45.532Z","updated_at":"2026-05-03T17:31:59.608Z","avatar_url":"https://github.com/mrvi0.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON Formatter \u0026 Validator CLI\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Shell: Bash](https://img.shields.io/badge/Shell-Bash-4EAA25.svg)](https://www.gnu.org/software/bash/)\n[![Dependency: jq](https://img.shields.io/badge/Dependency-jq%201.6+-blue.svg)](https://stedolan.github.io/jq/)\n[![Platform: Linux](https://img.shields.io/badge/Platform-Linux%20%7C%20Unix-lightgrey.svg)](https://www.linux.org/)\n[![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-green.svg)](https://github.com/mrvi0/cli-json-fomatter)\n\n🚀 Lightweight and fast CLI tool for JSON validation and formatting.\n\n## ✨ Features\n\n- ✅ **JSON Validation** - check JSON syntax correctness\n- 🎨 **Pretty Print** - beautiful formatting with customizable indentation\n- 📁 **File Operations** - read from files and save results\n- 🔧 **Flexible Options** - customize indentation, show additional information\n- 🎯 **Error Handling** - clear error messages\n- 📊 **JSON Information** - statistics and metadata\n- ⚡ **Fast Startup** - single bash script, no npm dependencies\n\n## 🛠️ Installation\n\n[![Installation](https://img.shields.io/badge/Installation-30%20seconds-brightgreen.svg)](https://github.com/mrvi0/cli-json-fomatter)\n[![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20Unix-blue.svg)](https://www.linux.org/)\n[![Dependencies](https://img.shields.io/badge/Dependencies-Auto%20install-orange.svg)](https://stedolan.github.io/jq/)\n\n### Quick Installation (Recommended)\n\n```bash\n# Clone the repository\ngit clone https://github.com/mrvi0/cli-json-fomatter.git\ncd json-formatter-cli\n\n# Install to system\nsudo ./install.sh\n```\n\n### Manual Installation\n\n```bash\n# Install jq (if not installed)\nsudo apt install jq  # Ubuntu/Debian\nsudo yum install jq  # CentOS/RHEL\nsudo pacman -S jq    # Arch Linux\n\n# Make script executable\nchmod +x jsonfmt\n\n# Copy to system directory\nsudo cp jsonfmt /usr/local/bin/\n```\n\n## 🚀 Usage\n\n[![Usage](https://img.shields.io/badge/Usage-Simple%20CLI-brightgreen.svg)](https://github.com/mrvi0/cli-json-fomatter)\n[![Features](https://img.shields.io/badge/Features-Validation%20%7C%20Formatting-blue.svg)](https://github.com/mrvi0/cli-json-fomatter)\n[![Output](https://img.shields.io/badge/Output-Colored%20%7C%20Pretty-orange.svg)](https://github.com/mrvi0/cli-json-fomatter)\n\n### Basic Usage\n\n```bash\n# Validate and format JSON string\njsonfmt '{\"name\": \"John\", \"age\": 30}'\n\n# Work with file\njsonfmt -f examples/sample.json\n\n# Read from stdin\necho '{\"data\": \"value\"}' | jsonfmt\n```\n\n### Command Line Options\n\n```bash\n# Save result to file\njsonfmt -f input.json -o output.json\n\n# Customize indentation (default: 2 spaces)\njsonfmt -f input.json -i 4\n\n# Show additional information\njsonfmt -f input.json --info\n\n# Full help\njsonfmt --help\n```\n\n### Usage Examples\n\n#### 1. Validate JSON File\n```bash\njsonfmt -f examples/sample.json\n```\n\n**Output:**\n```\n✅ JSON is valid (file: examples/sample.json)\n\n📋 Formatted JSON:\n{\n  \"name\": \"JSON Formatter CLI\",\n  \"version\": \"1.0.0\",\n  \"description\": \"A command-line tool for JSON validation and formatting\",\n  ...\n}\n```\n\n#### 2. Format with Information\n```bash\njsonfmt -f examples/sample.json --info\n```\n\n**Output:**\n```\n✅ JSON is valid (file: examples/sample.json)\n\n📋 Formatted JSON:\n{...}\n\n📊 JSON Information:\n   Root element type: Object\n   Size: 456 characters\n   Number of properties: 6\n```\n\n#### 3. Save to File\n```bash\njsonfmt -f examples/sample.json -o formatted.json\n```\n\n**Output:**\n```\n✅ JSON is valid (file: examples/sample.json)\n📝 Formatted JSON saved to: formatted.json\n```\n\n#### 4. Error Handling\n```bash\njsonfmt -f invalid.json\n```\n\n**Output:**\n```\n❌ Invalid JSON (file: invalid.json):\n   parse error: Unexpected token } at line 1, column 15\n```\n\n## 🧪 Testing\n\n[![Tests](https://img.shields.io/badge/Tests-Automated%20Suite-brightgreen.svg)](https://github.com/mrvi0/cli-json-fomatter)\n[![Coverage](https://img.shields.io/badge/Coverage-All%20Features-blue.svg)](https://github.com/mrvi0/cli-json-fomatter)\n[![Status](https://img.shields.io/badge/Status-Passing-orange.svg)](https://github.com/mrvi0/cli-json-fomatter)\n\nRun tests to verify functionality:\n\n```bash\nchmod +x test.sh\n./test.sh\n```\n\nTests verify:\n- Valid JSON validation\n- Invalid JSON handling\n- JSON string formatting\n- File saving\n- Indentation settings\n- Help output\n\n## 📁 Project Structure\n\n```\njson-formatter-cli/\n├── jsonfmt              # Main bash script\n├── install.sh           # Installation script\n├── uninstall.sh         # Uninstall script\n├── test.sh              # Tests\n├── examples/\n│   └── sample.json      # Sample JSON file\n├── README.md           # Documentation\n├── LICENSE             # MIT license\n└── .gitignore          # Ignored files\n```\n\n## 🔧 Technical Details\n\n### Dependencies\n- **jq** - JSON processor for validation and formatting\n- **bash 4.0+** - command line interpreter\n\n### Main Functions\n- `validate_json()` - JSON syntax validation\n- `format_json()` - indentation formatting\n- `read_file()` - safe file reading\n- `write_file()` - safe file writing\n- `get_json_info()` - JSON metadata extraction\n\n### Error Handling\n- JSON syntax validation via jq\n- File existence and permission checks\n- Read/write error handling\n- Clear error messages with colored output\n\n## 🎯 Bash Version Advantages\n\n[![Fast Startup](https://img.shields.io/badge/Fast%20Startup-No%20npm%20install-brightgreen.svg)](https://github.com/mrvi0/cli-json-fomatter)\n[![Minimal Dependencies](https://img.shields.io/badge/Dependencies-jq%20only-orange.svg)](https://stedolan.github.io/jq/)\n[![Lightweight](https://img.shields.io/badge/Lightweight-~5KB-blue.svg)](https://github.com/mrvi0/cli-json-fomatter)\n[![Linux Native](https://img.shields.io/badge/Linux-Native%20Support-red.svg)](https://www.linux.org/)\n\n- ⚡ **Fast Startup** - no npm install required\n- 🎯 **Minimal Dependencies** - only jq\n- 🔧 **Simple Installation** - single installation script\n- 📦 **Lightweight** - single file ~5KB\n- 🐧 **Native Linux Support** - works out of the box\n- 🎨 **Colored Output** - beautiful result display\n\n## 🎯 Project Usage\n\nThis CLI tool is perfect for:\n- Validating JSON configuration files\n- Formatting API responses\n- Data validation in CI/CD pipelines\n- JSON processing in automation scripts\n- Quick JSON checking in command line\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License. See the `LICENSE` file for details.\n\n## 👨‍💻 Author\n\n**Vi** - [GitHub](https://github.com/mrvi0)\n\n### 📞 Support\n\n- **Telegram:** [t.me/b4dcat](https://t.me/b4dcat)\n- **Email:** support@b4dcat.ru\n\n---\n\n⭐ If you like this project, give it a star on GitHub! ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrvi0%2Fcli-json-formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrvi0%2Fcli-json-formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrvi0%2Fcli-json-formatter/lists"}