Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .gitmodules

This file was deleted.

2 changes: 2 additions & 0 deletions .mise.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[tools]
node = "24.12.0"
pnpm = "10.30.3"
neovim = "latest"
starship = "latest"
1 change: 0 additions & 1 deletion .vim/bundle/Vundle.vim
Submodule Vundle.vim deleted from b25538
1 change: 0 additions & 1 deletion .vim/bundle/edge
Submodule edge deleted from 1e1944
1 change: 0 additions & 1 deletion .vim/bundle/vim-windflower
Submodule vim-windflower deleted from 673f86
124 changes: 58 additions & 66 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,121 +1,113 @@
# devbox

## Setup and Configure
## Prerequisites

> :warning: this is heavily tailored towards bash, so may not work out of the (dev)box
> for zsh (zush) and friends
Install [mise](https://mise.jdx.dev/) for managing tool versions:

```bash
git clone --recursive https://github.com/viqueen/devbox.git
brew install mise
```

## Setup

```bash
git clone https://github.com/viqueen/devbox.git
cd devbox

# install tools (node, pnpm, neovim, starship)
mise install

# install dependencies
pnpm install

# required
# configure shell (exports, PATH, aliases, mise config symlink)
./setup.sh config_box

# optional, to setup the prompt line
# optional: workspace-aware prompt (starship)
./setup.sh config_prompt

# optional, to setup vim
# optional: neovim with lazy.nvim
./setup.sh config_vim
git config --global core.editor vim
```

> :warning: to update the submodules
## What's Included

```bash
git submodule update --init --recursive
```
### Tools (via mise)

> :warning: install dependencies
Defined in `.mise.toml` and symlinked to `~/.mise.toml` by `config_box`:

```bash
mise install
pnpm install
```
| Tool | Purpose |
| -------- | --------------- |
| node | Node.js runtime |
| pnpm | Package manager |
| neovim | Editor |
| starship | Shell prompt |

## Optional - macOs dev setup
### Prompt

Install [mise](https://mise.jdx.dev/) for managing tool versions (node, java, python, etc.):
A workspace-aware [starship](https://starship.rs/) prompt that color-codes the hostname segment
based on which workspace you're in:

```bash
brew install mise
mise install
```
| Workspace | Color |
| ------------------------------ | ------ |
| `workspaces/viqueen/*` | orange |
| `workspaces/{primary_org}/*` | purple |
| `workspaces/{secondary_org}/*` | blue |
| `~/` | green |
| elsewhere | red |

## Scripts and Binaries
Configure orgs via env vars: `VIQUEEN_DEVBOX_PRIMARY_ORG`, `VIQUEEN_DEVBOX_SECONDARY_ORG`.

### tricks up this sleeve : from anywhere
### Editor

- navigate to where devbox is installed
Neovim with [lazy.nvim](https://github.com/folke/lazy.nvim) plugin manager. Config lives in `cli/nvim/`
and is scoped via `NVIM_APPNAME=devbox` (stored at `~/.config/devbox/nvim/`).

```bash
. dev
```
Plugins: edge colorscheme, lualine, nvim-tree, telescope, treesitter, mason + lspconfig.

- open existing scripts for edit
### Scripts and Binaries

#### Quick navigation

```bash
dev edit
gitar edit
. dev # navigate to devbox
dev edit # open dev script for edit
dev edit myscript # create a new script
```

- create a new script in devbox
#### Available commands

```bash
dev edit mynewscript
dev -h # housekeeping and generic scripts
mvnup -h # maven version upgrade
jsonf # json pretty format
image -h # docker things
gitar -h # git things
```

> :information_source: all these scripts source `selfedit.sh`
> which allows you to quickly step into edit mode (uses vim under the hood)
>
> `selfedit.sh` also sources `selfdoc.sh` which allows you to add documentation hints
> to your commands
All scripts source `selfedit.sh` (edit mode via nvim) and `selfdoc.sh` (auto-generated help from `@COMMAND` annotations):

```bash
#! /usr/bin/env
#! /usr/bin/env bash
source selfedit.sh

# @COMMAND one does this and that
one() {
echo "one"
}

# @COMMAND two does these and those
two() {
echo "two"
}

eval $@

if [[ -z $1 ]]; then
$0 -h
fi
```

> :x: but please note that not all scripts in devbox follow this pattern

### housekeeping and generic scripts

```bash
dev -h # mainframe
mvnup -h # maven version upgrade
jsonf # json pretty format
image -h # docker things
gitar -h # git things
saymyname # finds the longest java class name in a directory , I was bored once so I wrote this
```

### Atlassian scripts

- extracted to [atlassian-devbox](https://github.com/viqueen/atlassian-devbox)
- install using homebrew
Extracted to [atlassian-devbox](https://github.com/viqueen/atlassian-devbox):

```bash
brew tap viqueen/atlassian-devbox
brew install atlassian-devbox
```

- or install using npm

```bash
npm install -g atlassian-devbox
```
10 changes: 3 additions & 7 deletions cli/.devboxrc
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
#! /usr/bin/env bash

function cd_workspace() {
cd "$@" && source ~/.promptline.sh
}

alias ll='ls -la'
alias please=sudo
alias wl='wc -l'
alias move=mv
alias maven=mvn
alias awsl=awslocal
alias cats='pygmentize -g'
alias cd='cd_workspace'
alias vim='NVIM_APPNAME=devbox nvim'
alias nvim='NVIM_APPNAME=devbox nvim'

# overridden when running ./setup.sh config_prompt , see .shell_prompt.sh
export PS1='\u@\h\w'
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
export BASH_SILENCE_DEPRECATION_WARNING=1

# homebrew
export HOMEBREW_EDITOR="vim"
export HOMEBREW_EDITOR="nvim"

# maven
export MAVEN_OPTS="-Xms1680m -Xmx2048m -XX:MaxMetaspaceSize=384m"
Expand Down
Loading
Loading