2.5 KiB
Projects
A tool for managing projects from the commandline.
Future plan
Config file containing all known projects and a way to retrieve their current files from somewhere (i.e. git, nfs, etc). Sync project status on selecting project. Run init-workspace script when loading project. Maybe yml config file for the project which defines tmux windows to open, scripts to run in them by default, etc.
Example for a full stack web application workpace.yml file.
windows:
- type: Command
command: "edit ."
title: editor
- type: Shell
title: shell
- type: Command
command: "docker-compose up"
title: database
- type: Command
command: "sass --watch scss:css"
title: sass
- type: Command
command: "npm run dev"
title: dev server
This would open a tmux session with 5 windows (tabs) layed out and labeled as follows:
| 0: editor | 1: shell | 2: database | 3: sass | 4: dev server |
When the sesion is closed the program should ask to commit and push changes like the following:
+--------------------------+ | * Commit | | Switch Branch & Commit | | Dont do anything | +--------------------------+
The star indicates the currently selected option.
Commit
runs git commit followed by git push if it succeeds.
Switch Branch & Commit
asks for a branch name and either switches or creates and switches to it. Then it does the same as Commit
.
Dont do anything
exits.
When a project is opened it first asks to git pull like this:
+-- Git Pull --+ | * Yes | | No | +--------------+
When yes is selected it will run git pull and then offer you a fzf prompt to switch branch before running the init stage. The default option would be the current branch.
Example projects.json:
[
{
"name": "KNotes",
"source": "git://git@git.kallestruik.nl:2022/kalle/KNotes"
},
{
"name": "Projecs",
"source": "git://git@git.kallestruik.nl:2022/kalle/Projects"
}
]
Typing projects open
would open a fzf session to select the project you want to open. This would open the Git Pull
prompt if it already exists on the filesystem. If it does not it will set up a new directory for the project and git clone into that.
It will then search for a workspace.yml
in the project root. If it finds this it will set up the tmux session according to it. Otherwise it will open a tmux session with only one window. It will alo print a warning into this tmux session to inform
the user that there is no workspace.yml
file found.