Skip to content

AI21Labs/dev-envs

Repository files navigation

Development Environment and Experience

A collection of helper scripts to bootstrap your Mac box for development. Let's start...


If you find any issue or you feel something is missing, we encourage you to contribute to the project. For more information, see contributing.


Disclaimer

  1. We do not modify user settings automatically — to complete the setup, please complete the installation as noted at the first line of each language below
  2. Always start by bootstrapping your machine. For more information, see Getting Started

Getting Started

  1. Clone the repository, or

    git clone [email protected]:ai21labs/dev-envs.git
  2. Download it as a zip ball, unzip to a directory and change into it (if you are a new on the crew, you probably want this)

    unzip -q -o ai21-dev-envs-*.zip
    cd ai21-dev-envs-*/

Bootstrap Your Mac

  1. Kandji should have completed bootstrapping your Mac installation with brew as described here
    • Verify by running brew doctor
    • If you find some packages are missing, feel free to contribute to infra-mac-bootstrap
  2. Our helper scripts require Bash version 5.1.8 (or higher). By default MacOS comes with Bash version 3.2.x. Refer to this section to set Bash version 5.x.x as default

Generate SSH keys

  1. Execute ./helpers/ssh-key-gen.sh
  2. Store the generated SSH keys in your password manager

GitHub

  1. Execute ./helpers/config-github.sh

  2. Authorize an SSH key for use with SAML single sign-on

  3. Use Git to clone and push code changes using Git protocol; e.g.

    git clone [email protected]:ai21/dev-envs.git

If you wish to enhance your GitHub experience, see GitHub Experience.

Git has support for signing your work to ensure commits come from a trusted source. To sign your work, please follow Signed Commits guide.

Language and Stack Specifics

We have more specific notes for each language

Conventional Commits

We strive to be Commitizen-friendly, you are encouraged to use git cz commit as an helper for using conventional commits

Customizations

Shell

MacOS (Catalina and greater) uses ZSH as the default and it's a great default. If you're not a shell person, just use it.

Please avoid using fish, as most of our scripts are written for Bash.

Bash

To verify the brewed Bash is working for you, the following commands should return the same output

realpath $(brew --prefix bash)/bin/bash
realpath $(which bash)

If you wish to set Bash as the default shell, follow this guide.

Integrated Development Environments (IDEs)

We recommend using Visual Studio Code (VSCode), which should be installed for you if bootstrapped your mac.

If you wish to enhance your VSCode experience, see VSCode Experience.

Helpers

This is what the helpers do:

Some helpers have parameters for more streamlined work; use the --help. e.g.

$ ./helpers/vscode-exts.sh --help
vscode-exts.sh OPTIONS

OPTIONS:
  [-r|--region <region>]     default: us-east-1
  [-a|--auto]                use default values
./helpers/vscode-exts.sh

Contribute

  1. Run validation by leveraging pre-commit
    1. Install pre-commit install --install-hooks -t pre-commit -t commit-msg
    2. To run on-demand pre-commit run -a
      • pre-commit run shellcheck -a --verbose --hook-stage manual for recommendation
  2. Submit a pull-request