Giter Site home page Giter Site logo

pkosiec / terminer Goto Github PK

View Code? Open in Web Editor NEW
28.0 1.0 1.0 1.65 MB

Upgrade your terminal experience with a single command.

License: MIT License

Shell 18.39% Go 80.18% Dockerfile 0.52% Makefile 0.91%
terminal installation command-line command-line-tool cli zsh fish shell shell-prompt prompt

terminer's Introduction

Terminer

Terminer

Build Status Go Report Card codecov GitHub release

Upgrade your terminal experience with a single command.

โš ๏ธ WARNING: This project is in a very early stage. Use it at your own risk.

Terminer is an cross-platform installer for terminal presets. Install Fish or ZSH shell packed with useful plugins and sleek prompts. Use one of starter recipes or make yours.

Screenshot

Table of contents

Motivation

Command line interface (CLI) is a great way to access various operating system functions. It allows you to automate time-consuming tasks with a single command. Also, not all features are available with graphical user interface (GUI).

The command line interface is available through a program called terminal emulator, which launches shell. Shell is a program which processes user input and returns output.

Usually, default shell setup is bare-bone. Luckily, there is a way to upgrade it: install different shell along with useful plugins. They can introduce features such as autocompletion or syntax highlighting. You can also install prompts, which can display useful pieces of information, like current git branch. All these additions heavily improve user experience and save your time.

There is one downside of the shell experience customization. It's a time-consuming task. Installing different shell is easy, but to configure it well, you can easily spend hours for searching useful plugins, prompts, themes and fonts.

Not anymore. Use Terminer. Bootstrap your complete shell configuration in a moment.

Installation

To install this tool into /usr/local/bin directory, run the following command:

curl -sfL https://raw.githubusercontent.com/pkosiec/terminer/master/install.sh | sh -s -- -b /usr/local/bin

Note: Make sure that the directory in your $PATH. If not, run:

export PATH=$PATH:/usr/local/bin

Include the line above in you ~/.bashrc file or other configuration file for your current shell.

Usage

Terminer operates on recipes, which consist of shell commands. The most essential commands are install and rollback.

Quick start

To install a recipe from official repository, run:

terminer install [recipe name]

To rollback a recipe from official repository, run:

terminer rollback [recipe name]

Available recipes

To see all maintained recipes, navigate to the recipes directory.

What is a Recipe

Recipe is a YAML or JSON file with shell commands put in a proper order. Recipe consists of stages, which contain steps. Every step is a different shell command.

This is an example recipe, which just prints messages for all steps in all stages - not only during install, but also for rollback operation:

os: darwin
metadata:
  name: Recipe
  description: Recipe Description

stages:
  - metadata:
      name: Stage 1
      description: Stage 1 description
      url: https://stage1.example.com
    steps:
      - metadata:
          name: Step 1
          url: https://step1.stage1.example.com
        execute:
          run:
            - echo "Step 1 of Stage 1"
        rollback:
          run:
            - echo "Rollback of Step 1 of Stage 1"
      - metadata:
          name: Step 2
          url: https://step2.stage1.example.com
        execute:
          run:
            - echo "Step 2 of Stage 1"
        rollback:
          run:
            - echo "Rollback of Step 2 of Stage 1"
  - metadata:
      name: Stage 2
      description: Stage 2 description
      url: https://stage2.example.com
    steps:
      - metadata:
          name: Step 1
          url: https://step1.stage2.example.com
        execute:
          run:
            - echo "Step 1 of Stage 1"
          shell: sh
        rollback:
          run:
            - echo "Rollback of Step 1 of Stage 2"

Available commands

The following section describes all available commands in Terminer CLI.

install

Install command installs a recipe from the official recipe repository. You can use additional flags to install a recipe from a local or remote file.

Usage

terminer install [recipe name]

Flags

-f, --filepath string   Recipe file path
-h, --help              help for install
-u, --url string        Recipe URL

Examples

terminer install zsh-starter
terminer install -f ./recipe.yaml
terminer install --file /Users/sample-user/recipe.yml
terminer install -u https://example.com/recipe.yaml
terminer install --url http://foo.bar/recipe.yml

rollback

Rollback command uninstalls a recipe from the official recipe repository. You can use additional flags to rollback a recipe from a local or remote file.

Usage

terminer rollback [recipe name]

Flags

-f, --filepath string   Recipe file path
-h, --help              help for install
-u, --url string        Recipe URL

Examples

terminer rollback zsh-starter
terminer rollback -f ./recipe.yaml
terminer rollback --file /Users/sample-user/recipe.yml
terminer rollback -u https://example.com/recipe.yaml
terminer rollback --url http://foo.bar/recipe.yml

version

Prints the application version

Usage

terminer version

terminer's People

Contributors

ericbaranowski avatar pkosiec 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

Watchers

 avatar

Forkers

ericbaranowski

terminer's Issues

Allow templating in recipes

Recipes for different platforms usually have similar parts. It would be great to allow Go templating in the yaml files. At the moment including other files is all what is needed.

Download recipes without specifying full path

Add an ability to provide as an argument recipe in an easy form, like fish-shell, without need to specify an exact recipe path for current OS.

  • Construct path, when there is only the recipe name provided (for example: fish-shell should point to pkosiec/terminer@master/recipes/fish-shell and run recipe for current OS
  • Reorganize recipes (one directory with recipe name, for example: fish-shell)
  • Load recipe according to OS (based on filename in recipe directory)

Instalation on fresh mac cannot be finished

I got fresh mac installation and I had to change following thing, so as to install terminer:

  • Add sudo to download command:
    curl -sfL https://raw.githubusercontent.com/pkosiec/terminer/master/install.sh | sh -s -- -b /usr/local/bin ->
    curl -sfL https://raw.githubusercontent.com/pkosiec/terminer/master/install.sh | sudo sh -s -- -b /usr/local/bin.

After installing zsh, by using command terminer install zsh-starter, I got messages env: python2: No such file or directory on console. So I had to set:

  • link python after entering zsh. I commited: sudo ln -sf /usr/bin/python2.7 /usr/local/bin/python2.

Add step types

  • Define generic step types
  • Add ability to select, which steps should be executed, and which not

Example

Imagine that user wants to install Fish shell with all plugins, but (s)he doesn't want to set is as default shell. He could be able to exclude somehow the last step, which has type like "SET_DEFAULT" defined.

- name: "Set as default shell"
  type: OPTIONAL
  steps:
  - cmd: "chsh -s $(which fish)"
    rollback: "chsh -s $(which bash)"

There could be for example a toggle --ignore-optional to ignore optional steps.

Add Readme badges

Add the following badges:

  • Codecov
  • Goreport
  • Travis CI
  • Github Release
  • GolangCI (if there is any) - nope, there is no badge.

Migrate to Github Actions

As Travis open source free plan has been removed recently, this repository should be migrated to GitHub Actions.

Improve CLI message display

  • Find pretty CLI library
  • Refactor printer to show friendly messages
  • Show description and read more URL for stages and steps
  • Print pretty errors
  • Use colors and font styles
  • Show output in real time
  • Use spinner

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.