A command launcher designed for git users!

Overview

Bosswift - A command launcher for git users

Bosswift work along with git worktree to give you power everyday.

System Requirement: macOS 11.0+

A troublesome thing

bosswift_cover

As a developer,have you ever had this experience?

You are working on some feature development, your colleague Slack you and ask you why an on-live feature is behaving weirdly, he want you to help check the problem and reproduce it.

You say ok, then you open Terminal, type bunch of commands:

# Store your temporary works
git stash -u
# Switch to problematic branch
git checkout release/v1
# Pull the latest changes
git pull
# Install 3rd dependencies, setup runtime
npm install...
# Run the project and try to address issue
npm run...

This usually will take you couple minutes, and after the issue is resolved, you go back to work on your original task, by type these commands in Terminal:

# Switch back to work branch
git checkout feature/in-development
# Restore your temporary works
git stash apply
# Install 3rd dependencies, setup runtime
npm install...
# Run the project and continue to work
npm run...

This can happen multiple times in a day, not just to address a production issue, sometimes you also need to check different branch's runtime behavior, so you need to switch > build and run > switch > build and run... over and over.

This doesn't sound productive, what can we do about it?

Well, imagine that if we could checkout multiple branch in same machine from a repo, every branch got it's own worktree, by this way can we solve the problem?

Yes we did! Git team apparently notice this problem too, start from git v2.5, multiple worktrees support is added, you can create multiple worktree copies from one repo, each worktree got it's own branch, just like this:

bosswift-git-worktree-explain

With git worktree,we don't checkout branch anymore, instead we cd around worktrees,and also no need to stash/unstash anymore:

bosswift-new-fashion

The most important is, you don't need to re-install 3rd dependencies constantly, because every worktree is stable if you don't touch them!

Also if we do it right, git worktree can help us make sure there is always a branch that can run anytime, you don't need to worry about your in-development works impact other stable worktrees, sometime this is important.

New solution always come with problems

git worktree command got some pain points when using it:

  • Too many keystrokes, when you create a new worktree, you need to specify it's path, it's branch name, I often make mistake on these arguments
  • When you cd around worktrees, you often get lost
  • Too many disk usage, because now every worktree got it's own copy of 3rd dependencies(like node_modules)

Bosswift

To solve these pain points come with use git worktree in command line way,Bosswift is born. Bosswift is a GUI app that integrated with git worktree deeply, it will help you manage worktrees without presure.

bosswift-introduction

Installation + Setup

You can download the latest release from here

bosswift-install

Some setups is required when you open Bosswift,the only important step is to specify where you put your working repos, so that Bosswift can monitor & sync the worktree status with your repos:

bosswift-on-boarding

Usage

After you done configuration, press Option + Space (Default) to open quick launch bar.

bosswift-quick-launch-bar

Step 1, search & pick a worktree,hit enter/tab to select it:

bosswift-quick-launch-search-branch

Step 2. Search & pick a command, hit enter to execute:

bosswift-quick-pick-command

Create new Worktree

When you need a new worktree, do this command:

bosswift-create-worktree

All you need is to input a branch name:

bosswift-create-worktree-branch-name

It will take care these cases for you

  • A local branch with same name exist:Switch new worktree to that branch.
  • A same name branch exists in remote:Fetch that remote branch to local,create new worktree and switch to that branch.
  • Totally new branch:Create new worktree with specified branch name.

You could modify that command, add some steps like "Copy node_modules from original worktree" to the end, to avoid re-install node modules in new worktree.

Delete Worktree

Whe you no longer work on a worktree, you can save the disk usage by doing this command to delete the worktree:

bosswift-delete-worktree

You could modify that command, add some steps like "Delete Xcode Derived Data folder" to the end, to release disk space.

Create custom commands

What kind of Boss you are if you can't create your own command?

I encourage you to write commands that suits your project and workflow, I don't have that energy to provide you a fancy command editor, but I will give you my help as much as I can, there are some variables you can use when creating new command:

bosswift-command-glossary

For example, if I select feature branch of Doll Repo under path /Users/huikai/dev, here is all variable's value:

Name Means Value
$BOSSWIFT_WORK_FOLDER Bosswift's working folder /Users/huikai/dev
$BOSSWIFT_PROJECT_NAME Repo's folder name Doll
$BOSSWIFT_BRANCH_NAME Selected branch's name feature
$BOSSWIFT_WORKTREE_PATH The folder path of current worktree /Users/huikai/dev/Bosswift_Work/Doll/feature
$BOSSWIFT_DEFAULT_WORKTREE_PATH The folder path of repo's main worktree /Users/huikai/dev/Doll
$BOSSWIFT_XCODE_DERIVED_PATH Xcode Derived folder path for worktree (For Apple developers) /Users/huikai/Library/Developer/Xcode/DerivedData/Doll-cikiwqgnfwrbgzgebttnrazqigks
$BOSSWIFT_XCODE_WORKSPACE_FILE xcworkspace file name inside worktree (For Apple developers) Doll.xcworkspace
$BOSSWIFT_XCODE_PROJECT_FILE xcodeproj file name inside worktree (For Apple developers) Doll.xcodeproj

Dashboard

You can check running tasks in Dashboard:

bosswift-dashboard

As an Universal command launcher

Some command can be run from anywhere, and you always forgot how to type them, for example sometimes Xcode failed to recognize iPhone connected by usb cable, to fix that I need to restart usb service, but I never remember the command, I always need to copy it from google or Notes app.

Now with Bosswift,you could put these commands into Universal Command

bosswift-universal-commands

Type "/" in quick launch box, then you can pick an Universal Command to run:

bosswift-select-universal-command

As a temporary command launcher

If there's not command match the keyword in quick launch box, you can hit enter and execute the keyword as command directly:

bosswift-temporary-commands

Command line or GUI?

To be honest, as a developer, I never get used to Terminal.

I'm very careful when doing tasks in command line, I check my input over and over again to make sure I didn't write to wrong file, delete the wrong folder, I'm rather slow on Terminal because these stresses...

I love GUI, really, proper designed GUI tools is really master pice, easy to use and stress-free. But when it comes to automation, command line just.... kill GUI :). GUI just not design for automation tasks, you just can't setup the workflow easily with GUI.

Luckly, we don't have to choice between them, we can have an application that include both Command line and GUI.

This app can't run without command line, the screen command is the core behind it(For dispatching tasks), and in order to manage running tasks, commands like ps, grep, pkill is necessary too, put all these commands with an easy to use GUI, we got Bosswift :P.

Source code

https://github.com/xiaogdgenuine/bosswift

Disclaimer: When it comes to personal project, my code style is rather rough.

I prefer do the damn thing first then see how it goes, if it works I will clear the code and re-architecture, if it's not working I will keep rough style till it works.

This Repo is currently full of ugly global variables, un-reasonable module separation and un-reliable assumptions about running environment.

You might also like...
ips2crash is a macOS command line too to convert a .ips file to a legacy .crash log file.

Synopsis ips2crash is a macOS command line too to convert a .ips file to a legacy .crash log file. Motivation It should be possible to read .ips file

CookCLI is provided as a command-line tool to make Cook recipe management easier

CookCLI is provided as a command-line tool to make Cook recipe management easier, and enable automation and scripting workflows for the CookLa

Adjust the volume from the command line on macOS.

volume Adjust the volume from the command line on macOS. Installation Using Mint: mint install meowmeowmeowcat/[email protected] Usage USAGE: volume numb

A Mac command-line tool that automatically downloads macOS Installers / Firmwares.
A Mac command-line tool that automatically downloads macOS Installers / Firmwares.

MIST - macOS Installer Super Tool A Mac command-line tool that automatically downloads macOS Installers / Firmwares: Features List all available macOS

macOS command line tool to return the available disk space on APFS volumes

diskspace Returns available disk space With the various APFS features the value for free disk space returned from tools such as du or df will not be a

Command-line utility that checks comments for localizations in iOS interface files (.xib, .storyboard)

Localizations Comments Checker It's really easy to overlook and don't add comment for localization in interface file (.storyboard or .xib). This comma

A command-line tool to generate a JSON-list of all used SPM-dependencies of an Xcode-project.

SwiftPackageList A command-line tool to generate a JSON-list of all used SPM-dependencies of an Xcode-project. This includes all the Package.resolved

View Metal GPU information from the command-line.

View Metal GPU information from the command-line.

Command-line commands for Chaqmoq applications

Chaqmoq CLI Installation Swift Download and install Swift Swift Package mkdir MyApp cd MyApp swift package init --type executable // Creates an execut

Releases(0.0.4)
Owner
null
CommandLineKit - A pure Swift library for creating command-line interfaces

CommandLineKit A pure Swift library for creating command-line interfaces. Note: This project is no longer maintained. It's preserved here for historic

Ben Gollmer 1.1k Dec 1, 2022
Swiftline is a set of tools to help you create command line applications

Swiftline is a set of tools to help you create command line applications. Swiftline is inspired by highline Swiftline contains the following: Colorize

Omar Abdelhafith 1.2k Dec 29, 2022
A Mac command-line tool that generates kick-ass Jamf Pro reports.

KMART - Kick-Ass Mac Admin Reporting Tool A command-line utility generating kick-ass Jamf Pro reports: Features Reporting on the following Jamf Pro ob

Nindi Gill 86 Dec 15, 2022
ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

ipatool is a command line tool that allows you to search for iOS apps on the App Store and download a copy of the app package, known as an ipa file.

Majd Alfhaily 3k Dec 30, 2022
iOS command-line tool that allows searching and downloading ipa files from the iOS App Store

ipatool for iOS This is a port of Majd Alfhaily's ipatool adapted to run on iOS Build / Installation To build this, make sure you have AppSync install

dan 21 Sep 13, 2022
A nifty command-line tool to customize macOS icons

iconset A nifty command line tool to manage macOS icons iconset is a new command line tool for macOS that allows you to change icons for macOS apps (e

aarnav tale 32 Nov 17, 2022
🕳 A simple command line tool to punch hole to reduce disk usage on APFS volume for such as a raw disk image.

HolePunch NAME holepunch -- A simple command line tool to punch hole to reduce disk usage on APFS volume for such as a raw disk image. SYNOPSIS holepu

Yoshimasa Niwa 15 Nov 24, 2022
The best command-line tool to install and switch between multiple versions of Xcode.

The best command-line tool to install and switch between multiple versions of Xcode.

Robots and Pencils 2.3k Jan 9, 2023
Command Line Tool for interacting with MachO binaries on OSX/iOS

inject inject is a tool which interfaces with MachO binaries in order to insert load commands. Below is its help. ➜ ./inject -h OVERVIEW: inject v1.0.

<script>alert('1')</script> 36 Dec 23, 2022
Simple & Elegant Command Line Interfaces in Swift

An elegant pure Swift library for building command line applications. Features Tons of class, but no classes. 100% organic pure value types. Auto gene

hypertalk 52 Nov 9, 2022