{"id":24810804,"url":"https://github.com/yusukehosonuma/swift-emmet","last_synced_at":"2026-05-15T01:02:56.874Z","repository":{"id":54025007,"uuid":"336927911","full_name":"YusukeHosonuma/swift-emmet","owner":"YusukeHosonuma","description":"Generate struct and class as simple syntax.","archived":false,"fork":false,"pushed_at":"2021-03-10T07:55:57.000Z","size":664,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-30T12:18:01.900Z","etag":null,"topics":["haskell-cli","swift"],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/YusukeHosonuma.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-02-08T01:19:24.000Z","updated_at":"2022-04-15T05:33:49.000Z","dependencies_parsed_at":"2022-08-13T06:10:19.351Z","dependency_job_id":null,"html_url":"https://github.com/YusukeHosonuma/swift-emmet","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YusukeHosonuma%2Fswift-emmet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YusukeHosonuma%2Fswift-emmet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YusukeHosonuma%2Fswift-emmet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YusukeHosonuma%2Fswift-emmet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YusukeHosonuma","download_url":"https://codeload.github.com/YusukeHosonuma/swift-emmet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245468397,"owners_count":20620386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["haskell-cli","swift"],"created_at":"2025-01-30T12:18:04.896Z","updated_at":"2026-05-15T01:02:56.773Z","avatar_url":"https://github.com/YusukeHosonuma.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# swift-emmet\n\nA CLI tool that generate struct or class by simple-syntax.\n\n```bash\n$ swift-emmet \"Pserson: E, C = name: S, age: I, weight: D\"\n```\n\nThis will generate follows.\n\n```swift\nstruct Pserson: Equatable, Codable {\n    var name: String\n    var age: Int\n    var weight: Double\n}\n```\n\n## TODO\n\n- [ ] Decent REPL :)\n- [ ] Support Apple Silicon\n- [ ] Distribute binary for Linux\n\n## Aliases\n\nBasic types and protocols are supported aliases (case is ignored).\n\nThe following commands are generate same outputs.\n\n```bash\n$ swift-emmet 'Person: E, C = name:S, age:I, weight:D'\n$ swift-emmet 'Person: Equatable, Codable = name:String, age:Int, weight:Double'\n```\n\n```swift\nstruct Person: Equatable, Codable {\n    var name: String\n    var age: Int\n    var weight: Double\n}\n```\n\n| Alias | Type |\n|:--|:--|\n| S | String |\n| B | Bool   |\n| I | Int    |\n| L | Long   |\n| F | Float  |\n| D | Double |\n| U | URL    |\n\n| Alias | Protocols |\n|:--|:--|\n| E | Equatable |\n| C | Codable   |\n\n## Example\n\n```bash\n# Generate struct\n$ swift-emmet 's.Person = l.name:String, v.age:Int, v.weight:Double'\n\n# Generate class (with initializer)\n$ swift-emmet 'c.Person = l.name:String, v.age:Int, v.weight:Double'\n\n# Ommit `let` or `var` (`var` will be used)\n$ swift-emmet 's.Person = name:String, age:Int, weight:Double'\n\n# Inherit protocol or class\n$ swift-emmet 's.Person: Equatable, Codable = l.name:String'\n\n# Any white-space (or not) are allows\n$ swift-emmet 's . Person = l . name : String'\n$ swift-emmet 's.Person=l.name:String'\n```\n\n## REPL\n\nIf you run `swift-emmet` without options, REPL will be started.\n\n```bash\n$ swift-emmet\n--------------------------------------------------------------------\nWelcome swift-emmet 🎉\n...\n--------------------------------------------------------------------\n\nswift-emmet\u003e S.Person = l.name:String # Please input expr\n\nstruct Person {\n    let name: String\n}\n\nswift-emmet\u003e exit # Bye\n```\n\n## Available Commands\n\n```bash\n$ swift-emmet --help\n\nUsage: swift-emmet [EXPR] [--version] [--usage]\n  Generate struct or class from short syntax\n\nAvailable options:\n  EXPR                     Evaluate expression and print\n  --version                Show version\n  --usage                  Show detail usage\n  -h,--help                Show this help text\n```\n\n## Installation\n\n### Homebrew\n\n```bash\n$ brew tap YusukeHosonuma/swift-emmet\n$ brew install swift-emmet\n```\n\n### Manual\n\n```bash\n$ stack install\n$ ~/.local/bin/swift-emmet # or add `~/.local/bin` to PATH environment\n```\n\n## Development\n\nRequirements:\n\n- [Stack](https://docs.haskellstack.org/en/stable/README/) 2.5.1\n- [GHC](https://www.haskell.org/ghc/) 8.10.3\n\n```bash\n$ stack build\n$ stack test\n```\n\n## Issues and PR\n\nYou have any ideas or found bugs? Any issue or PR is welcome.\u003cbr\u003e\nThanks!\n\n## Author\n\n[Yusuke Hosonuma](https://github.com/YusukeHosonuma)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukehosonuma%2Fswift-emmet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyusukehosonuma%2Fswift-emmet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyusukehosonuma%2Fswift-emmet/lists"}