Git Product home page Git Product logo

suitcase's Introduction

Suitcase

A flexible command line tool for instantly deploying user interfaces for simple commands and scripts.

GitHub release (latest SemVer) Platform: macOS 10.15 Twitter Follow Twitter Follow

Suitcase is a command line tool that can be "programmed" to display a SwiftUI interface that can trigger commands and scripts.

🧳 Suitcase Direct Download

It's similar to Shortcuts, but for macOS and driven by the command line.

Suitcase Demo Reel

First Class Mac Citizen

Because of its SwiftUI underpinnings Suitcase is a first class Mac citizen. With out of the box support for, Dark Mode, Menubars and Drag and Drop.

Powerful

Its power and flexibility come form the tried and trusted UNIX command line. Anything you can do in Terminal you can do in Suitcase, but with a UI and export the command as a .command file, to check in with a project or share with the world.

Information

  • @SuitcaseCLI — Regular posts about updates and examples
  • The Bazaar — Examples and documentation
  • Impedimenta — Blog posts, links and related projects
  • @ImpedimentaCode — Infrequent posts about other projects and tools
  • @rjstelling — Frequent, irrelevant mostly technology and politics, open DMs

Command-Line Utility

Usage

OVERVIEW: A flexible command line tool for instantly deploying user interfaces
for simple commands and scripts.

USAGE: Suitcase <subcommand>

OPTIONS:
  --version               Show the version.
  -h, --help              Show help information.

SUBCOMMANDS:
  basic                   Launch a basic Suitcase process, that has a main menu
			  and an icon in the Dock when running.
  utility                 Launch a utility Suitcase process, without a Dock
			  icon or main menu.

Suitcase basic

A basic Suitcase process has a main menu and an icon in the Dock when running.

See the full documentation.

Suitcase utility

A utility Suitcase process does not have a Dock icon or main menu. It consists of just a main window.

See the full documentation.

Examples

These examples are very basic but should give you a good idea of how you can use Suitcase. More details examples can be found at the Bazaar. If you have any questions please create an issue. If you create a command and you'd like to share it, open a PR at the Bazaar.

Hello World

Hello World

A simple example consisting of one button that when clicked calls the say command. Watch the video of this example in action, there is a detailed say example at the Suitcase Bazaar.

📝 Code
$ Suitcase --name="Demo App" --window-title="Hello World" \
  --window-width="200" --window-height="200" \
  --control-type="label" --control-title="Give a face to every voice…" \
  --control-type="button" \
  --control-title="🗣 Say hello" \
  --control-action="/usr/bin/say Hello World"

War Games

War Games

A more advanced example using buttons and passing parameters to the say command. A detailed explanation of War Games can be found at the Suitcase Bazaar.

📝 Code
$ Suitcase --name="War Games" \
 --control-title="Shall we play a game?" \
	--control-type="text-field" \
	--control-identifier="say.textfield" \
  --control-title="Daniel" \
	--control-type="button" \
	--control-group-identifier="g.btns" \
	--control-action="/usr/bin/say" \
	--control-action-parameter="-v,Daniel,say.textfield" \
  --control-title="Samantha" \
	--control-type="button" \
	--control-group-identifier="g.btns" \
	--control-action="/usr/bin/say" \
	--control-action-parameter="-v,Samantha,say.textfield" \
  --control-title="Veena" \
	--control-type="button" \
	--control-group-identifier="g.btns" \
	--control-action="/usr/bin/say" \
	--control-action-parameter="-v,Veena,say.textfield"

Menus

Menus

This example shows how to create menus and sub-menus. Actions can be attached to any menu item the same way as buttons. Watch the video of this example in action.

Menu items can also be assigned a keyboard shortcut. See the full documentation for more details.

📝 Code
$ Suitcase --name="Demo App" --window-title="Menus" \
  --control-title="UUID" \
	--control-type="label" --control-identifier="com.label.uuid" \
  --menu-title="Action>Generate>UUID" \
	--menu-action="/usr/bin/uuidgen" \
	--menu-action-destination="com.label.uuid" \
  --menu-title="Action>Copy UUID" \
  --menu-shortcut="k" \
  --menu-action="/usr/bin/printenv com.label.uuid | /usr/bin/pbcopy"

Hidden Files & Folders

Hidden Files & Folders

This is a more involved example that uses defaults to read the macOS user defaults system and use sed to set a state label. Watch the video of this example in action.

📝 Code
$ Suitcase --name="Hidden Finder Settings" \
  --control-title="Hidden Files & Folders:" \
	--control-group-identifier="com.finder.hidden" \
	--control-type="label" \
  --control-title="unknown" \
	--control-group-identifier="com.finder.hidden" \
	--control-type="label" \
	--control-identifier="com.label.hidden.state" \
  --control-title="Refresh" \
	--control-group-identifier="com.finder.hidden" \
	--control-type="button" \
	--control-action="/usr/bin/defaults read com.apple.finder AppleShowAllFiles | /usr/bin/sed s/1/Visible/g;s/0/Hidden/g" \
	--control-action-destination="com.label.hidden.state" \
  --control-title="Enable" \
	--control-type="button" \
	--control-group-identifier="com.finder.hidden.buttons" \
	--control-action="/usr/bin/defaults write com.apple.finder AppleShowAllFiles -bool TRUE & /usr/bin/killall Finder" \
  --control-title="Disable" \
	--control-type="button" \
	--control-group-identifier="com.finder.hidden.buttons" \
	--control-action="/usr/bin/defaults write com.apple.finder AppleShowAllFiles -bool FALSE & /usr/bin/killall Finder"

This is how the command would be run in Terminal.

$ defaults read com.apple.finder AppleShowAllFiles | sed 's/1/Visible/g;s/0/Hidden/g'

The button uses & to run two commands, one to write to the user defaults and the second to relaunch the Finder:

$ defaults write com.apple.finder AppleShowAllFiles -bool TRUE

Kill the Finder and relaunch:

$ killall Finder

Suitcase

Export as a .command

Any Suitcase command can be exported as a self running .command file. You can double click this file to launch the Suitcase or share the file (it's just plain text).

Export Command

Bug Reports & Feature Requests

Please create an issue.

Contact

Releases and News (@SuitcaseCLI) Richard Stelling (@rjstelling)

Thanks to

suitcase's People

Contributors

erick-theobroma avatar jonchurch avatar kant avatar rjstelling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

suitcase's Issues

pkg security issue

“Suitcase.pkg” can’t be opened because Apple cannot check it for malicious software.
This software needs to be updated. Contact the developer for more information.

image

Create a "backronym" for Suitcase

Funny story... it was very late on the night I decided to release a set of hacks and weird Swift scripts that eventually became Suitcase.

I needed a name, I came up with the acronym Suitcase. I created the repos created a binary and went to bed.

When I awoke, I had totally forgotten what Suitcase stood for.

All I remember is the S, U and I come from SwiftUI, and the C might be from command-line?!

Please post your suggestions for a suitable "backronym" below.

Examples Crash with dyld error

Hey there! Really enjoying this project ❤️

I am experiencing crashes when running on Mac OS X 10.15.3, however. I know this is currently an alpha, so no worries. But wanted to share the crash log in case it was any help.

Running the Hello World example, after it speaks "hello world" it crashes, error is:

dyld: lazy symbol binding failed: Symbol not found: _$sSo12NSFileHandleC10FoundationE9readToEndAC4DataVSgyKF
  Referenced from: /usr/local/bin/Suitcase
  Expected in: /usr/lib/swift/libswiftFoundation.dylib

dyld: Symbol not found: _$sSo12NSFileHandleC10FoundationE9readToEndAC4DataVSgyKF
  Referenced from: /usr/local/bin/Suitcase
  Expected in: /usr/lib/swift/libswiftFoundation.dylib

Command to produce error:

Suitcase --name="Demo App" --window-title="Hello World" \
  --window-width="200" --window-height="200" \
  --control-type="label" --control-title="Give a face to every voice…" \
  --control-type="button" \
  --control-title="🗣 Say hello" \
  --control-action="/usr/bin/say Hello World"

And here is a gist of the crash log.

I don't have a clue if this helps, as I don't work with swift, but I do have it installed and the output of swift --version is:

Apple Swift version 5.2 (swiftlang-1103.0.32.1 clang-1103.0.32.29)
Target: x86_64-apple-darwin19.3.0

Library not loaded: Combine.framework

After installing Suitcase and trying to run one of the demo apps I get this output:

dyld: Library not loaded: /System/Library/Frameworks/Combine.framework/Versions/A/Combine
  Referenced from: /usr/local/bin/Suitcase
  Reason: image not found
[1]    11407 abort      Suitcase

Do I need Xcode to use this tool?

macOS Mojave 10.14.6 18G4032
Xcode command line tools installed.

Pre-made Common Window Styles (and possible Zenity/Yad cross-compatibility)

Alright, first off I'm writing this because Suitcase looks totally awesome and immediately has me excited with its possibilities. Now, I know this may be a bit different or out of the scope of what you're trying to achieve with this project, but this awesome concept immediately reminded me of Zenity/Yad for Linux. Are you aware of these projects? I wouldn't be surprised if they were an inspiration for this.
Zenity: https://help.gnome.org/users/zenity/3.32/
Yad: https://www.systutorials.com/docs/linux/man/1-yad/

At first glance it looks like Suitcase's focus is to allow very free form and advanced window creation functionality, which is amazing! But I'm thinking it could be very cool to have some more simplified, pre-made window style options as well as pre-made components like Zenity and Yad have. Such as, quick ways of making GUI Alerts, Dialogs, multi-column lists, date pickers, etc. I know that a bit of this can be done with AppleScript via osascript from the command line, but having a SwiftUI native option into the future would be very cool (who knows how long AppleScript will really be supported, and the functionality of Suitcase already kicks it's ass in terms of creating advanced custom windows on the the fly).

I'm also thinking that there could be some very cool value to actually copying Zenity/Yads exact command structure (in addition to the existing advanced options). While this may sound like a boring shortcut, it could be incredibly cool to be able to write cross platform bash scripts which intelligently call either Suitcase or Zenity/Yad and then can use all the same exact arguments to make the exact same alerts/dialogs/advanced windows for macOS or Linux.

Is any of this sort of thing something you've thought about or are interested in?

Source code availability/licencing

I'm not sure if it's intentional, but there's no source code contained in this repo as far as I can tell.

The README says that PRs are welcome, which would imply that the author expects that the code is available, but it's not and there's no mention of it being purposefully closed source.

It would be great to add the code, with a licence, or clarify why it is not being made available, as that's very non-standard for GitHub distribution.

Suitcase Icon

An improved licence free icon for use in the app, on social media and in documentation.

Please post your ideas below.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.