{"id":24012,"date":"2019-01-22T17:05:51","date_gmt":"2019-01-22T22:05:51","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=24012"},"modified":"2019-01-24T15:42:10","modified_gmt":"2019-01-24T20:42:10","slug":"kick-ass-cli-tools-in-swift","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2019\/01\/22\/kick-ass-cli-tools-in-swift\/","title":{"rendered":"Kick-ass CLI Tools In Swift"},"content":{"rendered":"<p><a href=\"https:\/\/duan.ca\/2019\/01\/20\/kick-ass-cli-tools-in-swift\/\">Daniel Duan<\/a>:<\/p>\n<blockquote cite=\"https:\/\/duan.ca\/2019\/01\/20\/kick-ass-cli-tools-in-swift\/\"><p>Programmers whine about ergonomics partially because we are previlidged and spoiled. But mostly because our attention is a limited resources. Mixing API conventions distracts us from solving the problem at hand. Bad ergonomics, therefore, drives away a good potion of users who cares about quality of their tools.<\/p><p>[&#8230;]<\/p><p>File system APIs being in <code>Foundation<\/code> as opposed to the standard library is\nprobably a temporary condition. Nevertheless, it has at least the following\nimplications[&#8230;]<\/p><p>[&#8230;]<\/p><p>The next killer CLI tool is still more likely to be written in Go or Rust, than in Swift. Hopefully, somewhere in these speculations is a true cause of this phenomena. Maybe someone reading this will be inspired to accelerate change that will eventually revert the condition.<\/p><\/blockquote>\n<p>Still, Swift+Foundation works pretty well for writing simple CLI tools to aid in my Mac development and maintenance. And <a href=\"https:\/\/github.com\/mxcl\/swift-sh\">swift-sh<\/a> (via <a href=\"https:\/\/nshipster.com\/swift-sh\/\">Mattt Thompson<\/a>) looks like it will help.<\/p>\n\n<p>Previously: <a href=\"https:\/\/mjtsai.com\/blog\/2018\/12\/27\/dynamiccallable-unix-tools-as-swift-functions\/\">@dynamicCallable: Unix Tools as Swift Functions<\/a>.<\/p>\n\n<p id=\"kick-ass-cli-tools-in-swift-update-2019-01-24\">Update (2019-01-24): <a href=\"https:\/\/twitter.com\/fpillet\/status\/1088456142080987143\">Florent Pillet<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/fpillet\/status\/1088456142080987143\">\n<p>So Vapor has another hidden gem: a pretty cool framework to build CLI apps, so I can reuse Vapor add-ons from the ecosystem to write my own local tools.<\/p>\n<p>No terribly well documented, but worth a look.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Daniel Duan: Programmers whine about ergonomics partially because we are previlidged and spoiled. But mostly because our attention is a limited resources. Mixing API conventions distracts us from solving the problem at hand. Bad ergonomics, therefore, drives away a good potion of users who cares about quality of their tools.[&#8230;]File system APIs being in Foundation [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2019-01-22T22:05:54Z","apple_news_api_id":"69e12653-777c-42de-9563-038f41a3fda4","apple_news_api_modified_at":"2019-01-24T20:42:15Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AaeEmU3d8Qt6VYwOPQaP9pA","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[69,448,30,1609,71,901,318,163],"class_list":["post-24012","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-linux","tag-mac","tag-macos-10-14","tag-programming","tag-swift-programming-language","tag-terminal","tag-unix"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=24012"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24012\/revisions"}],"predecessor-version":[{"id":24056,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/24012\/revisions\/24056"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=24012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=24012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=24012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}