Shark  by kaandedeoglu

Swift CLI for type-safe app resources and localization

Created 11 years ago
382 stars

Top 74.3% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Shark is a Swift command-line tool that provides type-safe access to project resources like images, colors, fonts, storyboards, and localizations. It targets Swift developers seeking to enhance code safety and streamline development workflows, offering a complete localization management solution that goes beyond Xcode's native capabilities.

How It Works

Shark directly parses .xcodeproj files to generate plain Swift code, eliminating configuration files and runtime dependencies. Its core innovation lies in its comprehensive approach: shark generate creates type-safe enums for various assets, while shark lint enforces localization completeness and format-specifier correctness. The shark translate subcommand automates filling localization gaps using local models or the Claude API, with machine validation and human review integration. This unified model ensures consistency across generation, linting, and translation.

Quick Start & Requirements

Installation is available via Homebrew (brew install kaandedeoglu/formulae/shark), Mint (mint install kaandedeoglu/formulae/shark), or manual compilation. Setup involves adding a Run Script build phase to Xcode targets, typically before compilation. For advanced users, dependency analysis can optimize build times by running Shark only when necessary. No specific hardware or OS prerequisites beyond standard Swift development environments are mentioned.

Highlighted Details

  • Broad Resource Support: Generates enums for images, colors, fonts, storyboards, data assets, and localizations across UIKit, AppKit, and SwiftUI.
  • Robust Localization Workflow: lint detects missing keys and format mismatches; translate uses AI (local or API) to fill gaps, validating translations and routing them for human review.
  • Namespace and Granularity: Supports namespacing based on asset catalog folder structure and localization key separators (e.g., L.login.error.message), with options for multi-target projects (--target, --exclude).
  • Zero Runtime Dependency: Generates pure Swift code integrated directly into the build process.

Maintenance & Community

No specific details regarding maintainers, community channels (like Discord/Slack), or project sponsorships were found in the provided README content.

Licensing & Compatibility

Shark is released under the MIT License, permitting broad use, modification, and distribution, including in commercial and closed-source applications.

Limitations & Caveats

The default "easy" setup can introduce noticeable delays to the build process. Localization linting does not yet check plural keys. The AI-powered translation feature requires local model setup or API keys and incurs costs when using the API. Older Shark versions may encounter parsing issues with Swift Package dependencies that emit manifest warnings.

Health Check
Last Commit

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
1 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Travis Fischer Travis Fischer(Founder of Agentic), and
2 more.

lingo.dev by lingodotdev

0.1%
5k
CLI tool for web & mobile localization via LLMs
Created 2 years ago
Updated 4 days ago
Feedback? Help us improve.