Skip to content

bashtidy ​

The container's bash shell is set up with bashtidy, a lightweight bash configuration: a git-aware prompt, short git aliases, colors, and a small tool for persistent environment variables. It is loaded in every shell; there is nothing to enable.

Prompt ​

Inside a git repository the prompt shows the path and branch; outside, only the path:

[~/projects/app :: master] ➜         # clean
[~/projects/app :: dev*] ➜           # dev branch with changes
[~/projects/app :: feature-auth+] ➜  # untracked files
[~/projects/app] ➜                   # not a git repository

The branch name is colored by type:

BranchColor
main / mastergreen
devyellow
feature-*blue
anything elseorange

Status markers after the branch name (shown in yellow):

MarkerMeaning
*Modified, added or deleted files
+Untracked files
!Merge conflict

Git aliases ​

AliasCommand
ggit
gigit init
gclgit clone
gstgit status
gssgit status -s
glgit log --oneline --graph --decorate --all
glogit log --oneline -20
gdgit diff
gdsgit diff --staged
gbgit branch
gbagit branch -a
gbdgit branch -d
gbDgit branch -D
gcogit checkout
gcobgit checkout -b
gswgit switch
gswcgit switch -c
gagit add
gaagit add -A
gapgit add -p
gcgit commit
gcmgit commit -m
gcagit commit --amend
gcanegit commit --amend --no-edit
gshgit stash
gshlgit stash list
gshpgit stash pop
gshdgit stash drop
gfgit fetch
gfagit fetch --all
gplgit pull
gplrgit pull --rebase
gpsgit push
gpsugit push -u origin HEAD
gpsfgit push --force-with-lease
gmgit merge
grbgit rebase
grbigit rebase -i
grbcgit rebase --continue
grbagit rebase --abort
grhgit reset HEAD
grhhgit reset --hard HEAD
gcleangit clean -fd
gtgit tag
gtlgit tag -l
gwipStage everything and commit as "WIP"
gunwipUndo the last commit

envhub: persistent environment variables ​

envhub saves environment variables so that every new shell loads them. Changes also apply to the current shell right away.

CommandPurpose
envhub set KEY VALUESave a variable and export it now
envhub set KEYSame, but prompt for the value (hidden, not saved in history)
envhub unset KEYRemove a variable and unset it now
envhub listShow saved variables
envhub editEdit the file with $EDITOR, then reload
bash
envhub set PROXY "http://127.0.0.1:7890"
envhub set OPENAI_API_KEY          # prompts; nothing is echoed or recorded
envhub list
  • Variables are stored in ~/.config/envhub, readable only by you (mode 600).
  • A value given on the command line ends up in shell history. For secrets, use envhub set KEY without a value.
  • Shells that are already open keep their old values until you open a new shell or run source ~/.bashrc.
  • Like everything outside /workspace, the saved variables are lost when the container is removed. See Data & Persistence.

Other conveniences ​

  • ls, ll, la, l with colors
  • grep, fgrep, egrep, diff with colors
  • .., ..., .... to go up one, two or three directories; - to go back to the previous directory
  • Shell history with timestamps and without duplicates