{"id":1171,"date":"2022-07-10T09:36:21","date_gmt":"2022-07-10T14:36:21","guid":{"rendered":"https:\/\/www.brunerd.com\/blog\/?p=1171"},"modified":"2022-07-10T09:50:38","modified_gmt":"2022-07-10T14:50:38","slug":"brunerd-tools-summer-2022-updates","status":"publish","type":"post","link":"https:\/\/www.brunerd.com\/blog\/2022\/07\/10\/brunerd-tools-summer-2022-updates\/","title":{"rendered":"brunerd tools summer 2022 updates"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hey there, it&#8217;s summer 2022 and I wanted to share some updates on my shell tools for Mac admins.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">No breaking changes or anything huge, but some nice incremental improvements all the same. When the <a rel=\"noreferrer noopener\" href=\"https:\/\/datatracker.ietf.org\/wg\/jsonpath\/about\/\" target=\"_blank\">JSONPath spec<\/a> is finalized I&#8217;ll give <code><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/brunerd\/jpt\" target=\"_blank\">jpt<\/a><\/code> a more considerable under the hood improvement. For now though, I&#8217;m pretty happy with tweaking their behaviors to act like you&#8217;d expect (print help and exit if no input detected), to get out of your way when you need to debug your scripts (xtrace is now disabled inside them) and to try to understand what you mean when you ask them a question (<a rel=\"noreferrer noopener\" href=\"https:\/\/developer.apple.com\/library\/archive\/documentation\/Cocoa\/Conceptual\/KeyValueCoding\/BasicPrinciples.html#\/\/apple_ref\/doc\/uid\/20002170-BAJEAIEE\" target=\"_blank\">key path<\/a> queries now accepted). Because the tools and technologies we make should serve <em>us<\/em>, not the other way around. I hope these tools can save you time, energy, sanity or all the above!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022&nbsp;<code><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/brunerd\/jpt\" target=\"_blank\">jpt<\/a><\/code> the &#8220;JSON Power Tool&#8221; has been <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/brunerd\/jpt\/releases\" target=\"_blank\">updated to v1.0.2<\/a> with all the nice additions mentioned. If you don&#8217;t know already <code>jpt<\/code> can parse, query, and modify JSON every which way. It can be used as both a standalone utility as well as a function to be embedded into <em>your<\/em> shell scripts, without any other dependencies. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022&nbsp;<code><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/brunerd\/ljt\" target=\"_blank\">ljt<\/a><\/code> the &#8220;little JSON tool&#8221; is <code>jpt<\/code>&#8216;s smaller sibling weighing in at only 2k. While it lacks the transformational powers of <code>jpt<\/code> it can easily pluck a value out of JSON up to 2GB big and output results up to 720MB.  It has been <a href=\"https:\/\/github.com\/brunerd\/ljt\/releases\">updated to v1.0.7<\/a> because dang it, even a small script can have just as many bugs as the big ones. Sometimes <em>more<\/em> if you&#8217;re not careful!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Both <code><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/brunerd\/jpt\" target=\"_blank\">jpt<\/a><\/code> and <code><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/brunerd\/ljt\" target=\"_blank\">ljt<\/a><\/code> now accept ye olde NextStep &#8220;keypath&#8221; expressions to help win over masochists who might still <a rel=\"noreferrer noopener\" href=\"https:\/\/richard-purves.com\/2021\/12\/10\/plutil-json-parsing-for-fun-and-profit\/\" target=\"_blank\">use <code>plutil<\/code><\/a> to work with JSON! \ud83d\ude01 (I kid, I kid!)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022&nbsp;<code><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/brunerd\/jse\" target=\"_blank\">jse<\/a><\/code>, the &#8220;<strong>JSON string encoder<\/strong>&#8221; does this one thing and does it well. It can be used in conjunction with jpt when taking in arbitrary data that needs encoding only. It&#8217;s a svelte 1.4k (in minified form) and runs considerably faster that <code>jpt<\/code>, so it&#8217;s ideal for multiple invocations, such as when preparing input data for a JSON Patch document. <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/brunerd\/jse\/releases\" target=\"_blank\">v1.0.2 is available here<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u2022 <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/brunerd\/shui\" target=\"_blank\"><code>shui<\/code><\/a> lets you interact with your users with AppleScript but in the comfort of familiar shell syntax! You don&#8217;t need to know a line of AppleScript, although it <em>does<\/em> have the option to output it if you want to learn. Save time, brain cells and hair with <code>shui<\/code>, while you keep on trucking in shell script. It has been <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/brunerd\/shui\/releases\/\" target=\"_blank\">updated to v20220704<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">P.S. All these tools still work in the macOS Ventura beta \ud83d\ude05<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey there, it&#8217;s summer 2022 and I wanted to share some updates on my shell tools for Mac admins. No breaking changes or anything huge, but some nice incremental improvements all the same. When the JSONPath spec is finalized I&#8217;ll give jpt a more considerable under the hood improvement. For now though, I&#8217;m pretty happy [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,37,51,41,53,12,36,39],"tags":[],"class_list":["post-1171","post","type-post","status-publish","format-standard","hentry","category-bash","category-jpt","category-json","category-jsonpath","category-ljt","category-scripting","category-shui","category-zsh"],"_links":{"self":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/1171","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/comments?post=1171"}],"version-history":[{"count":13,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/1171\/revisions"}],"predecessor-version":[{"id":1187,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/posts\/1171\/revisions\/1187"}],"wp:attachment":[{"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/media?parent=1171"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/categories?post=1171"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.brunerd.com\/blog\/wp-json\/wp\/v2\/tags?post=1171"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}