From 221b199a1d41f864b8c392656113e6e1122d59c5 Mon Sep 17 00:00:00 2001 From: /raj Date: Sun, 22 Oct 2023 15:58:06 +0530 Subject: [PATCH] Update readme.md --- readme.md | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/readme.md b/readme.md index 11125b9..941a262 100644 --- a/readme.md +++ b/readme.md @@ -2,3 +2,79 @@ Project Environment Executor, Define your project workspace as code and config. +## Usecase +Creating a tmux session from a config file, this includes setting up working directories, setting up dev servers, and opening editors. + +### Get Started + +![Screen Recording 2023-10-22 at 2 11 11 PM](https://github.com/xrehpicx/pee/assets/22765674/b355da63-1e2d-4833-8300-1bd879e2245f) + +#### Installation +```bash +go install github.com/xrehpicx/pee@latest +``` + +#### Initialize a project +```bash +pee init myproject +``` +Select a directory from the file picker by ``, the directory that the init is run in will be the default starting directory for the file picker, you can go up and down directories by `` and `` + +#### Configure project +Config is similar to [tmuxinator](https://github.com/tmuxinator/tmuxinator) +```yml +name: ppec-ui +editor: nvim +root: /Users/raj.sharma/Documents/GitHub/ppec-ui +windows: + - window_name: editor + layout: 8070,202x58,0,0[202x46,0,0,89,202x11,0,47,92] + panes: + - shell_command: + - nvim "+SessionManager load_current_dir_session" + - shell_command: + - echo 'npm run dev' + - window_name: hosts + layout: even-horizontal + shell_command_before: + - cd somewhere && activate env + panes: + - shell_command: + - ssh stg-host1 + - shell_command: + - ssh stg-host2 + - window_name: git + panes: + - shell_command: + - lazygit +lastopened: 2023-10-22T14:03:54.071678+05:30 +attach: true +``` +editor here is used as the default editor for editing the config file. +`note: attach here does not tmux attach the new session, instead uses tmux switch-client for faster switching.` + +#### Run a project +For this example we have a project called ppec with the above config +```bash +pee ppec +``` +and this should open up ppec tmux session + +#### Edit or Run from list +![Screen Recording 2023-10-22 at 2 12 41 PM](https://github.com/xrehpicx/pee/assets/22765674/f8bb6c1d-1a68-4194-8c4c-62ff4856cd2c) + +You can also run +```bash +pee ls +``` +and select the project from table and click `` to open/create the session or `` to edit the config of the project + +### Roadmap +1. Supporting iTerm2 + As of now this supports only tmux windows and panes, would want to add support for iterm and other terminals if they have api's to do so. +2. Ability to save an opened session into a config or update a config +3. Ability to save custom layouts as named layouts that can be used across multiple projects + +--- +All contributions are welcome +