rachidcalazans / chid

Simple assistant for day-to-day life. Developers and common users
25 stars 12 forks source link

Chid

Chid is an assistant to help your day-to-day life. It can be used in some installations, news, configurations, workstations and more.

Installation

Via Gem

$ gem install chid

Initialize the chid config file

$ chid init

Creates a .chid.config file on root directory if none ~/.chid.config file exists.

To access that file will be created in ~/.chid.config

Upgrading

To update the chid is easy.

$ gem update chid

Usage

Chid is an gem app based on Commands. You are available to use all features running on terminal:

To see all commands and how to use on Terminal, run:

$ chid -h

Note: All Commands are available for osx and linux. The chid will automatically knows how run the specific comand for each plataform.

All features are listed bellow:

Install chid configuration

Chid configuration

Feature Commands

Git Commit

Create a commits in based on gitFlow pattern.

An easy way to create commits following simple steps:

First: Choose your commit type in this options (add,Remove, Update, Refactor, Fix)

Second: Type your commit title, a brief description of your changes

Third: Add your description lines, describing exactly what you did

Thats it! Your commit will be created and pushed like this sample:

feature/#123 Add specific file needed to app

- specific file have now this line
- this is the description line two

Signed-off-by: "YourName" "yourEmail@mail.com"

Install apps

Note: All install tasks, chid will always ask if you really want to install it. Also will install the dependencies if necessary.

Run

Currency

News

Search on StackOverflow

A simple search in StackOverflow

stackchid

Search GitHub repositories

A simple search for repository name

Workstations

Workstations are a way to make it easy for you to open a set of applications by simple commands.

The set of configurations are saved on .chid.config file.

Note: All commands bellow is possible run with prefix: $ chid workstation [command]

workstationchid

Note: For linux users the $chid workstation create is not working. You need create manually (editing the .chid.config file). Will be explained how on How configure and customize your workstations topic

Tmux

If you use Tmux as I do for development, this is a nice Command Feature!

This feature is based on some templates you will create on ~/.chid.config file to open easily all your Dev Env

This Feature have 2 commands, list and open

An example of Template you will add on ~/.chid.config:

---
:chid:
  :workstations: {}
  :tmux_templates:
    :NAME_YOUR_PROJECT:
    - tmux new -s $$template_name$$ -n app -d;
    - tmux send-keys -t $$template_name$$ 'cd DIRECTORY_PROJECT_PATH'
      C-m;
    - tmux send-keys -t $$template_name$$ 'vim' C-m C-m;
    - tmux new-window -n tests -t $$template_name$$;
    - tmux send-keys -t $$template_name$$ 'cd DIRECTORY_PROJECT_PATH'
      C-m;
    - tmux new-window -n server -t $$template_name$$;
    - tmux send-keys -t $$template_name$$ 'cd DIRECTORY_PROJECT_PATH'
      C-m;
    - tmux attach -t $$template_name$$;

The example above each line is a tmux command. You can do what you need. In this case we have only two variables to replace:

The commands above means those steps:
1- Create a new Tmux session with app name for the first tab or Find an existent one and Open it
2- Open the folder project on the tmux tab app
3- Open a new tab called vim and open the vim on the folder project
4- Open a new tab called server and go to the folder project

base workstation

How configure and customize your workstations

The chid configuration file is installed on ~/.chid.config. You can open: $ chid config

Chid config is a YAML file.

You can create the workstations just adding on :workstations: key.

The initial chid config file will be like:

---
:chid:
  :workstations: {}
  :tmux_templates: {}

Base configuration

To add a new workstation you can edit like:

---
:chid:
  :workstations:
    :base: # Workstation Name
    - iTerm #Application Name
    - Safari
    - Slack
  :tmux_templates: {}

configchid

After edit you can open the base workstation running:

Advance configuration

Is possible you can customize some options with each Application when will open it

---
:chid:
  :workstations:
    :base: # Workstation Name
    - iTerm ~/Workspaces/rake-workspace/chid/ & rspec  # Will open 
    # in a specific folder and will run the rspec (run all tests)
    - Safari https://github.com/rachidcalazans/chid # Will open the Safari 
    # in a specific URL
  :tmux_templates: {}