Select the types of activity you want to include in your feed.
docs: enhance README and usage documentation for various tools, including 1Password, AWS, Docker, Git, GitHub, Go, Kubernetes, Python, Terraform, and VS Code; remove outdated files and improve terminal setup instructions
···4455My collection of my dotfiles used across multiple systems and managed by [chezmoi](https://www.github.com/twpayne/chezmoi).
6677+## Core Prerequisite
88+99+To get started, you primarily need a shell environment with `curl` or `wget` to download and execute the `chezmoi` installation script.
1010+711## Quick Start
1212+1313+The following command will download and install `chezmoi` (if not already present), initialize it with this dotfiles repository, and apply the configuration. This process will also install and configure other necessary tools such as Homebrew, Zsh, oh-my-zsh, oh-my-posh, and the 1Password CLI.
814915```sh
1016 sh -c "$(curl -fsSL get.chezmoi.io)" -- init --apply mauvehed
1117```
12181313-Personal secrets are stored in [1Password](https://1password.com) and you'll
1414-need the [1Password CLI](https://developer.1password.com/docs/cli/) installed.
1919+### 1Password Integration
15201616-After installation or major changes you may need to relogin to 1Password with:
2121+Personal secrets are stored in [1Password](https://1password.com). The `chezmoi` setup will install the [1Password CLI](https://developer.1password.com/docs/cli/).
17221818-```sh
1919- eval $(op signin)
2020-```
2323+1. **After the initial `chezmoi apply` completes**, you must sign in to the 1Password CLI:
2424+ ```sh
2525+ eval $(op signin)
2626+ ```
2727+2. **Re-apply `chezmoi` (if needed)**: If the initial `chezmoi apply` could not fully provision all configurations due to 1Password not being authenticated, run the apply command again after signing in:
2828+ ```sh
2929+ chezmoi apply
3030+ ```
3131+3232+## Tools Managed by These Dotfiles
21332222-## Tools Used
3434+These dotfiles, through `chezmoi`, will install and manage the following tools and configurations on your system:
23352424-| Name | Description | Required |
2525-| ---- | ----------- | -------- |
2626-| Terminal | [iTerm2](https://iterm2.com) | No |
2727-| Package manager | [homebrew](https://brew.sh/) | Yes |
2828-| Shell | [oh-my-zsh](https://github.com/ohmyzsh/ohmyzsh/wiki/Installing-ZSH) | Yes |
2929-| oh-my-posh | [oh-my-posh](https://ohmyposh.dev) | Yes |
3030-| Dotfiles manager | [chezmoi](https://chezmoi.io/) | Yes |
3131-| Password Manager | [1password](https://www.1password.com/) | Yes |
3636+| Name | Description | Managed |
3737+| ------------------- | ------------------------------------------------- | -------- |
3838+| Terminal | [iTerm2](https://iterm2.com) (macOS) | Optional |
3939+| Package manager | [Homebrew](https://brew.sh/) | Yes |
4040+| Shell | [Zsh](https://www.zsh.org/) | Yes |
4141+| Shell Framework | [oh-my-zsh](https://ohmyzsh.org/) | Yes |
4242+| Shell Prompt Customizer | [oh-my-posh](https://ohmyposh.dev) | Yes |
4343+| Dotfiles manager | [chezmoi](https://chezmoi.io/) | Yes |
4444+| Password Manager CLI| [1Password CLI](https://www.1password.com/) | Yes |
32453346## Command Reference
3447
+73
docs/1password-usage.md
···11+# 1Password Usage
22+33+This document outlines how the [1Password CLI](https://developer.1password.com/docs/cli/) is integrated with `chezmoi` for managing secrets and sensitive configuration data in this dotfiles setup.
44+55+## Overview
66+77+1Password is the primary secrets manager for this dotfiles configuration. `chezmoi` is configured to use the 1Password CLI (`op`) to fetch secrets, which are then injected into configuration files via templates.
88+99+## Prerequisites
1010+1111+1. **1Password Account**: You need an active 1Password account.
1212+2. **1Password CLI Installed**: The `chezmoi` quick start process (see main `README.md`) handles the installation of the `op` CLI tool.
1313+3. **Initial Sign-in**: As detailed in the main `README.md`, after the initial `chezmoi apply`, you must sign in to the 1Password CLI:
1414+ ```sh
1515+ eval $(op signin)
1616+ ```
1717+ You may need to run `chezmoi apply` again after this initial sign-in if some secrets were not provisioned.
1818+1919+## Storing and Referencing Secrets with Chezmoi
2020+2121+`chezmoi` utilizes its template functions to interact with the `op` CLI. Secrets are stored in your 1Password vaults, and `chezmoi` templates reference them, typically using the `onepassword` template function or by directly calling `op`.
2222+2323+### General Approach
2424+2525+1. **Store Secret in 1Password**: Add your secret (e.g., API key, token, password) to your 1Password vault.
2626+ * Use clear, consistent item names.
2727+ * For multi-field items, note the field names you want to retrieve.
2828+2. **Reference in Chezmoi Template**: In your `chezmoi` template file (e.g., `private_dot_config/some_app/config.toml.tmpl`), use a `chezmoi` template function to fetch the secret.
2929+3030+### Example: Storing an API Key
3131+3232+* **In 1Password**:
3333+ * Create a "Login" or "API Credential" item named, for example, `My App API Key`.
3434+ * Store the API key in the `password` field or a custom field.
3535+* **In `chezmoi` template**:
3636+ ```toml
3737+ # Example: .config/my_app/credentials.tmpl
3838+ # api_key = "{{ (onepasswordRead "op://Personal/My App API Key/password").stdout }}"
3939+ ```
4040+ *(Note: The exact `onepasswordRead` syntax or alternative `op` calls might vary based on your specific `chezmoi` helper functions or direct CLI usage in templates.)*
4141+4242+### Storing GPG Git Signing Key ID
4343+4444+To securely store and retrieve your GPG key ID for Git commit signing:
4545+4646+1. **In 1Password**:
4747+ * Create a "Secure Note" or "Login" item, perhaps named `Git Configuration` or `My GPG Key`.
4848+ * Add a custom field (e.g., named `git_signingkey_id`) and paste your GPG key ID into its value.
4949+2. **In `chezmoi` template (e.g., `dot_gitconfig.tmpl`):**
5050+ ```gitconfig
5151+ # Example for .gitconfig.tmpl
5252+ [user]
5353+ name = {{ .name | quote }}
5454+ email = {{ .email | quote }}
5555+ # signingkey = "{{ (onepasswordRead "op://Personal/Git Configuration/git_signingkey_id").stdout }}"
5656+ ```
5757+ *(Adjust the item name and path as per your 1Password setup.)*
5858+5959+## Common `chezmoi` Template Functions for 1Password
6060+6161+*(This section can be expanded with specific examples of `onepassword` functions or custom `op` CLI wrappers you use in your templates.)*
6262+6363+* `onepassword "item_name"`
6464+* `onepasswordDetails "item_name"`
6565+* `onepasswordRead "op_item_path"` (e.g., `op://Vault/ItemName/fieldname`)
6666+6767+Refer to your `chezmoi` configuration and the official `chezmoi` documentation for the exact functions and syntax available and preferred in your setup.
6868+6969+## Troubleshooting
7070+7171+* **Authentication Issues**: Ensure `eval $(op signin)` has been run and your session is active.
7272+* **Item Paths**: Double-check the 1Password item names, vault names, and field names used in your templates. The `op item get "Item Name" --fields label="Field Name"` command can be useful for verifying.
7373+* **Chezmoi Apply**: Remember to run `chezmoi apply` to propagate changes after updating templates or 1Password items.
-112
docs/DEPLOY.md
···11-# dotfiles
22-33->This document is out of date/old and was a manual install process. Please follow the directions in [Chezmoi README](../README.md) instead of using this document.
44->
55->I am keeping this for historical reference in case I need any steps from here.
66-77-## Linux
88-99-Follow [Chezmoi README](../README.md)
1010-1111-## MacOS
1212-1313-Mostly follows [this guide](https://blog.larsbehrenberg.com/the-definitive-iterm2-and-oh-my-zsh-setup-on-macos)
1414-1515-### Homebrew
1616-1717-```sh
1818-/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
1919-```
2020-2121-### iTerm2 or Warp.dev
2222-2323-`https://app.warp.dev/download`
2424-2525-`brew cask install iterm2` or [download](https://iterm2.com/downloads.html)
2626-2727-### oh-my-zsh
2828-2929-```sh
3030-brew install zsh && sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
3131-```
3232-3333-#### ohmyzsh theme
3434-3535-```sh
3636-git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
3737-```
3838-3939-##### Install fonts/fix things
4040-4141-```sh
4242-p10k configure
4343-```
4444-4545-### YouTube Music Desktop App
4646-4747-```sh
4848-brew install --cask ytmdesktop-youtube-music
4949-```
5050-5151-### Setup TMUX
5252-5353-Install TMUX PLugin Manager
5454-5555-```sh
5656-git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
5757-```
5858-5959-#### Fetch updated tpm module (fixes error)
6060-6161-``
6262-6363-#### Install plugins from tmux.conf
6464-6565-```sh
6666-run ^b-I inside tmux session
6767-```
6868-6969-### Enable fingerprint auth for sudo on macOS
7070-7171-```bash
7272-#!/bin/bash
7373-#
7474-# credit to machupicchubeta/dotfiles/bin/enable_to_sudo_authenticate_with_touch_id.sh
7575-set -eu
7676-set -o pipefail
7777-7878-sudo chmod +w /etc/pam.d/sudo
7979-if ! grep -Eq '^auth\s.*\spam_tid\.so$' /etc/pam.d/sudo; then
8080- ( set -e; set -o pipefail
8181- # Add "pam_tid.so" to a first authentication
8282- pam_sudo=$(awk 'fixed||!/^auth /{print} !fixed&&/^auth/{print "auth sufficient pam_tid.so";print;fixed=1}' /etc/pam.d/sudo)
8383- sudo tee /etc/pam.d/sudo <<<"$pam_sudo"
8484- )
8585-fi
8686-```
8787-8888-## pyenv (& friends)
8989-9090-Adopted from <https://realpython.com/intro-to-pyenv/>
9191-9292-### macOS
9393-9494-```sh
9595-brew install openssl readline sqlite3 xz zlib exa asdf fzf zoxide
9696-```
9797-9898-```sh
9999-npm install -g opencommit
100100-```
101101-102102-```sh
103103-curl https://pyenv.run | bash
104104-```
105105-106106-```sh
107107-source ~/.zshrc
108108-```
109109-110110-```sh
111111-python install <go find the latest from python.org>
112112-```
+23-54
docs/README.md
···11-# dotfiles & config management
11+# Dotfiles Documentation
2233-mauveFILES for personal and work systems running macOS or Linux
33+Welcome to the documentation for this `dotfiles` collection. This section provides detailed information on various tools, configurations, and processes used.
4455-## quick start
55+## Table of Contents
6677-```sh
88-sh -c "$(curl -fsSL get.chezmoi.io)" -- init --apply mauvehed
99-```
77+Below is a list of available documents. Please refer to them for specific usage instructions and notes.
1081111-## quick commands
99+* **[1Password Usage](./1password-usage.md)**: How 1Password CLI is used with `chezmoi` for secret management.
1010+* **[AWS Usage](./aws-usage.md)**: Notes and common commands for interacting with AWS.
1111+* **[Chezmoi Usage](./chezmoi-usage.md)**: In-depth details about `chezmoi` setup, template functions, and advanced usage.
1212+* **[CLI Usage](./cli-usage.md)**: Information about various command-line interface tools and utilities.
1313+* **[Corporate Apps Usage](./corporate-apps-usage.md)**: Notes on configuring and using corporate-specific applications.
1414+* **[DEPLOY](./DEPLOY.md)**: Historical manual deployment instructions. **Note: This document is outdated. For current deployment, follow the `chezmoi` instructions in the main [project README](../README.md).**
1515+* **[Docker Usage](./docker-usage.md)**: Tips and configurations related to Docker.
1616+* **[Git Usage](./git-usage.md)**: Detailed Git workflows, aliases, and configurations.
1717+* **[GitHub Usage](./github-usage.md)**: Notes on GitHub-specific configurations or workflows.
1818+* **[Go Usage](./go-usage.md)**: Go programming language setup and environment.
1919+* **[Kubernetes Usage](./kubernetes-usage.md)**: Kubernetes (k8s) setup, aliases, and common commands.
2020+* **[Python Usage](./python-usage.md)**: Python environment setup and project notes.
2121+* **[System Usage](./system-usage.md)**: General system-level configurations and macOS/Linux specific notes.
2222+* **[Terminal Usage](./terminal-usage.md)**: Details about terminal setup (iTerm2, Zsh, Oh My Posh), keybindings, and plugins.
2323+* **[Terraform Usage](./terraform-usage.md)**: Terraform setup, common commands, and state management notes.
2424+* **[TODO](./TODO.md)**: A list of pending tasks and improvements for the dotfiles or documentation.
2525+* **[User Apps Usage](./user-apps-usage.md)**: Configuration notes for various user applications.
2626+* **[VSCode Usage](./vscode-usage.md)**: Visual Studio Code setup, extensions, and settings synchronization.
12271313-To add new files to chezmoi control:
1414-1515-```sh
1616-chezmoi add <file>
1717-```
1818-1919-To edit a file under chezmoi control:
2020-2121-```sh
2222-chezmoi edit <file>
2323-```
2424-2525-To preview changes before applying:
2626-2727-```sh
2828-chezmoi diff
2929-```
3030-3131-To apply changes from `.local/share/chezmoi/` to ~/ use:
3232-3333-```sh
3434-chezmoi apply
3535-```
3636-3737-To both `git pull` and `chezmoi apply` use `update`
3838-3939-```sh
4040-chezmoi update
4141-```
4242-4343-To force a refresh the downloaded archives (from .`chezmoiexternal.toml`), use the --refresh-externals flag to chezmoi apply:
4444-4545-```sh
4646-chezmoi --refresh-externals apply
4747-```
4848-4949-Or `--refresh-externals` can be shortened to -R:
5050-5151-```sh
5252-chezmoi -R apply
5353-```
5454-5555-## resources
5656-5757-* [Install](https://www.chezmoi.io/install/)
5858-* [Quick Start](https://www.chezmoi.io/quick-start/#using-chezmoi-across-multiple-machines)
5959-* [Setup](https://www.chezmoi.io/user-guide/setup/)
2828+Please explore the linked documents for more information on each topic.
+101-5
docs/aws-usage.md
···11# AWS Usage
2233-- [AWS Usage](#aws-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
33+This document provides an overview of using Amazon Web Services (AWS) tools, primarily the AWS Command Line Interface (CLI), within this dotfiles setup.
44+55+## Overview
66+77+The AWS CLI is a unified tool to manage your AWS services. This guide covers basic configuration and common commands.
88+99+## Prerequisites
1010+1111+* **AWS Account**: An active AWS account.
1212+* **AWS CLI Installed**: The AWS CLI is typically installed via Homebrew as part of the `chezmoi` setup if specified in your configurations.
1313+ ```sh
1414+ brew install awscli
1515+ ```
1616+* **Configured Credentials**: AWS CLI needs credentials to interact with your AWS account. These are typically stored in `~/.aws/credentials` and `~/.aws/config`.
1717+ * **Security Note**: It is highly recommended to manage AWS credentials securely, for example, by storing them in 1Password and having `chezmoi` templates populate the AWS configuration files, or by using a tool like `aws-vault`.
1818+1919+## Configuration
2020+2121+AWS CLI configuration can be managed via `aws configure` or by directly editing the files:
2222+2323+* `~/.aws/config`: Stores default region, output format, and named profiles.
2424+* `~/.aws/credentials`: Stores AWS access keys for different profiles.
2525+2626+### Example `~/.aws/config`:
2727+```ini
2828+[default]
2929+region = us-east-1
3030+output = json
53166-## TODO: Create documentation
3232+[profile my-other-profile]
3333+region = us-west-2
3434+output = text
3535+```
73688-- Package aws-vault
99-- Package awscli
3737+### Example `~/.aws/credentials` (managed via 1Password/`chezmoi` or `aws-vault`):
3838+```ini
3939+[default]
4040+aws_access_key_id = YOUR_ACCESS_KEY_ID_DEFAULT
4141+aws_secret_access_key = YOUR_SECRET_ACCESS_KEY_DEFAULT
4242+4343+[profile my-other-profile]
4444+aws_access_key_id = YOUR_ACCESS_KEY_ID_OTHER
4545+aws_secret_access_key = YOUR_SECRET_ACCESS_KEY_OTHER
4646+```
4747+4848+Refer to `docs/1password-usage.md` for guidance on storing these credentials in 1Password and using `chezmoi` templates.
4949+5050+## `aws-vault` (Recommended for Enhanced Security)
5151+5252+[aws-vault](https://github.com/99designs/aws-vault) is a tool to securely store and access AWS credentials in your operating system's keystore. It helps in avoiding storing AWS credentials in plaintext files.
5353+5454+### Installation (if not managed by `chezmoi`):
5555+```sh
5656+brew install aws-vault
5757+```
5858+5959+### Basic Usage:
6060+6161+1. **Add credentials to `aws-vault`**:
6262+ ```sh
6363+ aws-vault add my-profile
6464+ ```
6565+ (This will prompt for your access key ID and secret access key)
6666+6767+2. **Execute commands using a profile**:
6868+ ```sh
6969+ aws-vault exec my-profile -- aws s3 ls
7070+ ```
7171+7272+## Common AWS CLI Commands
7373+7474+Replace `my-profile` with your desired AWS profile if not using `default`.
7575+7676+* **List S3 Buckets**:
7777+ ```sh
7878+ aws s3 ls --profile my-profile
7979+ # Using aws-vault:
8080+ # aws-vault exec my-profile -- aws s3 ls
8181+ ```
8282+8383+* **List EC2 Instances**:
8484+ ```sh
8585+ aws ec2 describe-instances --profile my-profile
8686+ # Using aws-vault:
8787+ # aws-vault exec my-profile -- aws ec2 describe-instances
8888+ ```
8989+9090+* **Get Caller Identity (useful for verifying current credentials)**:
9191+ ```sh
9292+ aws sts get-caller-identity --profile my-profile
9393+ # Using aws-vault:
9494+ # aws-vault exec my-profile -- aws sts get-caller-identity
9595+ ```
9696+9797+## Resources
9898+9999+* **Official AWS CLI Documentation**:
100100+ * [AWS CLI User Guide](https://docs.aws.amazon.com/cli/latest/userguide/)
101101+ * [AWS CLI Command Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/index.html)
102102+* **`aws-vault` GitHub Repository**: [https://github.com/99designs/aws-vault](https://github.com/99designs/aws-vault)
103103+* **1Password Documentation**: Refer to `docs/1password-usage.md` for managing secrets.
104104+105105+This document is a starting point. Please refer to the official documentation for comprehensive information.
-67
docs/bitwarden-usage.md
···11-# Bitwarden Usage
22-33-- [Bitwarden Usage](#bitwarden-usage)
44- - [Overview](#overview)
55- - [Configuration](#configuration)
66- - [Prerequisites](#prerequisites)
77- - [Test](#test)
88-99-## Overview
1010-1111-This project uses [Bitwarden CLI](https://bitwarden.com/help/cli/) as a default password manager to store its non-sensitive configuration data. It is installed the first time the dotfiles run.
1212-1313-## Configuration
1414-1515-### Prerequisites
1616-1717-- [Create your Bitwarden account](https://bitwarden.com/help/create-bitwarden-account/)
1818-- [Login to the Bitwarden web vault](https://vault.bitwarden.com/#/login)
1919-- [Create a new Identity item](https://bitwarden.com/help/custom-fields/) with the `Name` filed set to `dotfiles`
2020-- Fill in the following fields
2121- - `First name`
2222- - `Last name`
2323- - `Username` - this can be your shortcode
2424- - `Email`
2525- - `git_signingkey` - this is a custom field to store your gpg Git commit signing key ID
2626-2727-### Test
2828-2929-Log in using the Bitwarden CLI and fetch the `dotfiles` Identity item
3030-3131-```shell
3232-bw login
3333-bw unlock # if your session has expired
3434-export BW_SESSION="[session]"
3535-bw get item dotfiles | jq
3636-```
3737-Tou should be presented with a similar output
3838-3939-```json
4040-[
4141- {
4242- "object": "item",
4343- "id": "00000000-0000-0000-0000-000000000000",
4444- "name": "dotfiles",
4545- ...
4646- "fields": [
4747- {
4848- "name": "git_signingkey",
4949- "value": "1234567890ABCDEF1234567890ABCDEF12345678"
5050- }
5151- ],
5252- "identity": {
5353- "firstName": "[your first name]",
5454- "lastName": "[your last name]",
5555- "email": "[your email]",
5656- "username": "[your username]"
5757- },
5858- ...
5959- }
6060-]
6161-```
6262-6363-To fetch any changes made using the online service, run the following command:
6464-6565-```shell
6666-bw sync
6767-```
+168-71
docs/chezmoi-usage.md
···11-# Chezmoi Usage
11+# Chezmoi Usage: In-Depth Guide
2233-- [Chezmoi Usage](#chezmoi-usage)
44- - [Overview](#overview)
55- - [Installation](#installation)
66- - [Flow diagram](#flow-diagram)
77- - [Usage](#usage)
88- - [Flow diagram](#flow-diagram-1)
99- - [Useful commands](#useful-commands)
1010- - [Apply changes from the local repository](#apply-changes-from-the-local-repository)
1111- - [Show cached configuration data](#show-cached-configuration-data)
1212- - [Test a template code snippet](#test-a-template-code-snippet)
33+This document provides a comprehensive guide to using `chezmoi` for managing your dotfiles, expanding on the information in the main `README.md`.
134145## Overview
1561616-This dotfiles repository is configured and managed by the `chezmoi` project. [chezmoi](https://www.chezmoi.io/), pronounced _/ʃeɪ mwa/ (shay-moi)_ is currently the [most complete and most hackable](https://www.chezmoi.io/comparison-table/) dotfiles manager out there.
77+[Chezmoi](https://www.chezmoi.io/) (pronounced _/ʃeɪ mwa/ - shay moi) is a powerful, flexible, and secure dotfiles manager. It helps you manage your configuration files (dotfiles) across multiple machines with ease.
1781818-## Installation
99+Key features leveraged in this setup include:
1010+* **Templating**: Using Go templates (with Sprig functions and custom data) to make dotfiles dynamic.
1111+* **Secret Management**: Integration with 1Password CLI to securely handle sensitive data.
1212+* **OS-Specific Configuration**: Applying different configurations based on the operating system.
1313+* **Script Execution**: Running scripts at various points in `chezmoi`'s lifecycle (`run_once_`, `run_onchange_`, etc.).
1414+* **External File Management**: Managing files and archives from external sources.
1515+1616+## Core Concepts
19172020-The following instruction clones [dotfiles](https://github.com/make-ops-tools/dotfiles) repository into the `~/.local/share/chezmoi/` directory and next applies changes accordingly, to your home directory `~/`. During the setup it prompts you to provide configuration options like Git committer name and email address, etc.
1818+* **Source Directory**: Where `chezmoi` stores your dotfiles and configurations (typically `~/.local/share/chezmoi`). This directory is a Git repository.
1919+* **Target Directory**: Your home directory (`~`) where `chezmoi` applies the configurations.
2020+* **Configuration File**: `~/.config/chezmoi/chezmoi.toml` (or `.yaml`/`.json`) stores `chezmoi`'s own configuration, including data accessible in templates.
21212222-```shell
2323-bash -c "$(curl -fsLS get.chezmoi.io)" -- init --apply "make-ops-tools"
2222+## Installation and Initialization
2323+2424+As covered in the main `README.md`, initialization typically involves:
2525+2626+```sh
2727+sh -c "$(curl -fsSL get.chezmoi.io)" -- init --apply mauvehed
2428```
2929+This command:
3030+1. Downloads and installs `chezmoi` if not present.
3131+2. Clones your dotfiles repository (github.com/mauvehed/dotfiles) into `~/.local/share/chezmoi`.
3232+3. Prompts for any initial configuration data defined in `.chezmoi.toml.tmpl`.
3333+4. Applies the dotfiles to your home directory.
25342626-### Flow diagram
3535+### Initial Setup Flow (Conceptual)
27362837```mermaid
2938sequenceDiagram
3039 autonumber
3131- participant home directory
3232- participant working copy
3333- participant local repo
3434- participant remote repo
3535- Note over home directory: archive current files
3636- remote repo->>local repo: chezmoi init --apply <repo>
3737- Note left of local repo: prompt for configuration
3838- local repo->>home directory: chezmoi init --apply <repo>
4040+ participant User
4141+ participant Shell
4242+ participant Chezmoi
4343+ participant Git
4444+ participant GitHub (mauvehed/dotfiles)
4545+ participant "1Password CLI (op)"
4646+4747+ User->>Shell: Runs install/init command
4848+ Shell->>Chezmoi: Installs/Updates chezmoi binary
4949+ Chezmoi->>GitHub (mauvehed/dotfiles): Clones/Pulls repository into source dir
5050+ Chezmoi->>User: Prompts for template data (if .chezmoi.toml.tmpl exists)
5151+ Note over Chezmoi: Reads .chezmoi.toml, .chezmoidata.*, etc.
5252+ Chezmoi->>"1Password CLI (op)": (Potentially) Fetches data via template functions
5353+ Chezmoi->>Shell: Executes run_once_ scripts, creates symlinks, applies templates to target dir (Home)
3954```
5555+*(This diagram is a simplification of the actual process)*
5656+5757+## Common `chezmoi` Commands
40584141-## Usage
5959+* **`chezmoi add <path_to_file_in_home>`**: Adds a file from your home directory to `chezmoi`'s source directory.
6060+ * Example: `chezmoi add ~/.gitconfig`
6161+ * Use the `-T` or `--template` flag to add it as a template: `chezmoi add ~/.gitconfig --template`
6262+ * Use the `-e` or `--encrypt` flag to add it as an encrypted file (less common now with 1Password integration for secrets).
6363+6464+* **`chezmoi edit <path_to_file_in_home>`**: Opens a file managed by `chezmoi` in your `$EDITOR` by operating on the source file.
6565+ * Example: `chezmoi edit ~/.gitconfig`
6666+6767+* **`chezmoi apply [-v --dry-run]`**: Applies changes from the source directory to the target directory.
6868+ * `-v` / `--verbose`: Shows what changes are being made.
6969+ * `--dry-run`: Shows what would be changed without actually making changes.
7070+ * `--init`: Re-runs initialization steps (useful if `.chezmoi.toml.tmpl` changes).
7171+ * `-R` / `--refresh-externals`: Forces a refresh of externally managed files.
7272+7373+* **`chezmoi update`**: Pulls changes from your Git remote, then applies changes.
7474+ * Equivalent to `chezmoi git pull && chezmoi apply` (simplified).
7575+7676+* **`chezmoi diff`**: Shows the differences between the target state in your home directory and the state defined by your source directory and templates.
7777+7878+* **`chezmoi forget <path_to_file_in_home>`**: Removes a file from `chezmoi` management (it will no longer be updated by `chezmoi apply`). The file in your home directory is not deleted by this command.
7979+8080+* **`chezmoi remove <path_to_file_in_home>`**: Removes a file from `chezmoi` management AND deletes it from the source directory. The file in your home directory is not deleted by this command.
8181+8282+* **`chezmoi chattr <attributes> <target>`**: Changes attributes of a target in the source directory (e.g., `private`, `readonly`, `template`, `executable`, `empty`).
8383+ * Example: `chezmoi chattr template ~/.gitconfig` (makes it a template)
8484+ * Example: `chezmoi chattr private ~/.ssh/config` (marks it as private)
8585+8686+* **`chezmoi doctor`**: Checks for common problems with your setup.
8787+8888+* **`chezmoi cd`**: Opens a new shell in the source directory (`~/.local/share/chezmoi`).
8989+9090+* **`chezmoi data`**: Prints the data available to templates (merges data from various sources). Useful for debugging templates.
9191+ * Example: `chezmoi data | jq` (if `jq` is installed)
9292+9393+* **`chezmoi execute-template <template_string_or_file>`**: Executes a Go template. Useful for testing template snippets.
9494+ * Example (1Password): `chezmoi execute-template '{{ (onepasswordRead "op://Personal/API_KEY_MYAPP/password").stdout | trim }}'`
9595+ * Example (OS specific): `chezmoi execute-template '{{ if eq .chezmoi.os "darwin" }}macOS Specific Value{{ else }}Other OS Value{{ end }}'`
9696+9797+* **`chezmoi git <git_args...>`**: Runs Git commands in the source directory.
9898+ * Example: `chezmoi git status`, `chezmoi git push`
9999+100100+## Templating
101101+102102+`chezmoi` uses Go's [text/template](https://pkg.go.dev/text/template) package. This allows for dynamic configuration files.
103103+104104+* **Syntax**: Templates are enclosed in `{{ }}`.
105105+* **Sprig Functions**: Over 100 helpful [Sprig functions](http://masterminds.github.io/sprig/) are available (e.g., string manipulation, math, data structures).
106106+* **`chezmoi` Specific Data**: `chezmoi` provides variables like `.chezmoi.os`, `.chezmoi.hostname`, etc. See `chezmoi data`.
107107+* **Custom Data**: Data from `.chezmoi.toml` or data files (e.g., `.chezmoidata.yaml`) is available.
108108+* **1Password Integration**: Use functions like `onepassword`, `onepasswordRead`, `onepasswordDocument` to fetch secrets from 1Password. See `docs/1password-usage.md` for details.
109109+ ```toml
110110+ # Example in a .gitconfig.tmpl
111111+ [user]
112112+ email = {{ .email | quote }}
113113+ signingkey = {{ (onepasswordRead "op://Personal/Git Keys/signingkey_id").stdout | trim | quote }}
114114+ ```
421154343-If you decide to extend the configuration of your dotfiles and include an additional file to be managed, here is an example on how to do that
116116+## Scripts
441174545-```shell
4646-chezmoi add ~/.bashrc
4747-chezmoi edit ~/.bashrc
4848-chezmoi diff
4949-chezmoi apply -v
5050-chezmoi cd
5151-git add .
5252-git commit -S -m "Add .bashrc"
5353-git push
5454-exit
118118+`chezmoi` can execute scripts at different points:
119119+120120+* **`run_once_*.sh`** (or other extensions): Executed only once per machine. Useful for initial setup tasks (e.g., installing Homebrew).
121121+* **`run_onchange_*.sh`**: Executed if their content (or the content of files they depend on via comments) changes. Useful for tasks that need to re-run if a related config file changes.
122122+* **`run_before_*.sh`**: Run before `chezmoi apply` applies changes for that script's directory.
123123+* **`run_after_*.sh`**: Run after `chezmoi apply` applies changes for that script's directory.
124124+125125+Scripts must be executable. `chezmoi` adds template functions to the script's environment as environment variables.
126126+127127+## Managing External Files (`.chezmoiexternal.toml`)
128128+129129+`chezmoi` can manage files and archives from external sources (URLs) using a `.chezmoiexternal.toml` file in the source directory.
130130+131131+* **Use Cases**: Downloading a specific version of a tool, fetching a `Brewfile` from a gist, managing `oh-my-zsh` installation/updates.
132132+* **Format**: TOML file defining targets and sources.
133133+* **Refresh**: Use `chezmoi apply -R` or `chezmoi apply --refresh-externals` to force download/update.
134134+135135+Example `.chezmoiexternal.toml` entry:
136136+```toml
137137+# ["{{ .chezmoi.sourceDir }}/path/to/oh-my-zsh.sh"]
138138+# type = "file"
139139+# url = "https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh"
140140+# refreshPeriod = "168h" # Refresh once a week
55141```
561425757-### Flow diagram
143143+## Managing Dotfile Attributes
581445959-```mermaid
6060-sequenceDiagram
6161- participant home directory
6262- participant working copy
6363- participant local repo
6464- participant your remote repo
6565- home directory->>local repo: chezmoi init
6666- home directory->>working copy: chezmoi add <file>
6767- working copy->>working copy: chezmoi edit <file>
6868- working copy-->>home directory: chezmoi diff
6969- working copy->>home directory: chezmoi apply
7070- home directory-->>working copy: chezmoi cd
7171- working copy->>local repo: git add
7272- working copy->>local repo: git commit
7373- local repo->>local repo: git remote add origin<br/>git branch
7474- local repo->>your remote repo: git push
7575- working copy-->>home directory: exit
7676-```
145145+`chezmoi` allows setting attributes for files and directories in the source directory, influencing how they are treated:
146146+147147+* **`private_` prefix**: The target file will have permissions `0600` (or `0700` for directories).
148148+* **`readonly_` prefix**: The target file will be read-only.
149149+* **`executable_` prefix**: The target file will be executable.
150150+* **`empty_` prefix**: The target file will be created empty if it does not exist.
151151+* **`.tmpl` suffix**: The file is treated as a Go template.
152152+* **`.encrypted` suffix**: The file is encrypted using GPG (less common with 1Password integration).
153153+154154+These can also be managed with `chezmoi chattr`.
771557878-## Useful commands
156156+## Troubleshooting
791578080-### Apply changes from the local repository
158158+* **`chezmoi doctor`**: Run this first to check for common issues.
159159+* **`chezmoi -v apply --dry-run`**: Verbose dry run to see what `chezmoi` *thinks* it should do.
160160+* **`chezmoi data`**: Inspect the data available to your templates.
161161+* **Check Permissions**: Ensure scripts are executable, and `chezmoi` has rights to write to target locations.
162162+* **Template Errors**: `chezmoi execute-template` is invaluable for debugging specific template snippets.
811638282-```shell
8383-chezmoi cd
8484-pwd # should be ~/.local/share/chezmoi
8585-chezmoi apply --init
8686-```
164164+## Advanced Usage Flow (Adding a new templated file with a secret)
871658888-### Show cached configuration data
166166+```mermaid
167167+sequenceDiagram
168168+ participant User
169169+ participant "1Password"
170170+ participant Shell (Terminal)
171171+ participant "Chezmoi Source Dir (~/.local/share/chezmoi)"
172172+ participant "Home Directory (~/)"
891739090-```shell
9191-chezmoi data | jq
9292-cat ~/.config/chezmoi/chezmoi.toml
174174+ User->>"1Password": Add new secret (e.g., API key for myapp)
175175+ User->>Shell (Terminal): `touch ~/.config/myapp/config.toml` (create target file initially)
176176+ User->>Shell (Terminal): `chezmoi add ~/.config/myapp/config.toml -T` (add as template)
177177+ User->>Shell (Terminal): `chezmoi edit ~/.config/myapp/config.toml`
178178+ Note over Shell (Terminal): Editor opens `.../dot_config/myapp/config.toml.tmpl`
179179+ User->>Shell (Terminal): Edit template to include `{{ onepasswordRead "op://..." }}`
180180+ User->>Shell (Terminal): `chezmoi diff` (review changes)
181181+ User->>Shell (Terminal): `chezmoi apply -v`
182182+ Chezmoi Source Dir (~/.local/share/chezmoi)-->>Home Directory (~/): Applies templated file, fetching secret
183183+ User->>Shell (Terminal): `chezmoi cd`
184184+ User->>Shell (Terminal): `git add .`
185185+ User->>Shell (Terminal): `git commit -m "Add config for myapp with secret"`
186186+ User->>Shell (Terminal): `git push`
93187```
941889595-### Test a template code snippet
189189+## Resources
961909797-```shell
9898-chezmoi execute-template '{{ (bitwarden "item" "dotfiles").identity.firstName }} {{ (bitwarden "item" "dotfiles").identity.lastName }}'
9999-```
191191+* **Official `chezmoi` Website**: [https://www.chezmoi.io/](https://www.chezmoi.io/)
192192+* **`chezmoi` User Guide**: [https://www.chezmoi.io/user-guide/](https://www.chezmoi.io/user-guide/)
193193+* **`chezmoi` Reference**: [https://www.chezmoi.io/reference/](https://www.chezmoi.io/reference/)
194194+* **`docs/1password-usage.md`**: For details on 1Password integration.
195195+196196+This guide should provide a solid foundation for working with `chezmoi` in this dotfiles setup. Refer to the official `chezmoi` documentation for the most detailed and up-to-date information.
+99-10
docs/cli-usage.md
···11-# Command-line Interface Usage
11+# Enhanced Command-Line Interface (CLI) Usage
22+33+This document details configurations and tools aimed at creating a powerful, consistent, and user-friendly command-line interface (CLI) experience, primarily within a Zsh environment managed by `chezmoi`.
44+55+## Overview
66+77+A productive CLI environment goes beyond just the shell and prompt. It involves using enhanced versions of standard utilities, organizing shell configurations logically, and leveraging tools that streamline common tasks.
88+99+## Striving for Consistency (GNU Coreutils on macOS)
1010+1111+To achieve a more GNU/Linux-like CLI experience on macOS, GNU core utilities are often installed. These provide versions of common commands (`ls`, `cp`, `mv`, `date`, `cat`, etc.) with features and options consistent with their Linux counterparts.
1212+1313+* **Installation (macOS with Homebrew)**:
1414+ ```sh
1515+ brew install coreutils findutils gnu-tar gnu-sed gawk gnutls gnu-indent gnu-getopt grep
1616+ ```
1717+ (You might have a more specific list in your `Brewfile`.)
1818+* **Usage**: These GNU versions are typically prefixed with `g` (e.g., `gls`, `gcat`, `gdate`) to avoid conflicts with the native macOS utilities.
1919+* **PATH Configuration**: To use these GNU versions by their standard names (e.g., `ls` instead of `gls`), you would add their directory (e.g., `$(brew --prefix coreutils)/libexec/gnubin`) to the beginning of your `$PATH`.
2020+ * This is often handled in a dedicated `.path` file or directly in your `.zshrc` / `.zshenv`, managed by `chezmoi`.
2121+2222+## Shell Configuration Files
2323+2424+To keep the main shell configuration file (e.g., `~/.zshrc`) clean and organized, specific aspects of the shell setup are often broken out into separate files, sourced by the main config. These are managed by `chezmoi`.
2525+2626+* **`~/.path` (or similar)**: Manages the `$PATH` environment variable. It defines the order in which directories are searched for executables. Example content:
2727+ ```sh
2828+ # Example .path structure
2929+ export PATH="$HOME/.local/bin:$PATH"
3030+ export PATH="$(brew --prefix)/bin:$(brew --prefix)/sbin:$PATH" # Homebrew
3131+ # Add GNU coreutils if preferred
3232+ # export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
3333+ ```
3434+3535+* **`~/.exports` (or similar)**: Sets other essential environment variables (e.g., `EDITOR`, `LANG`, `PAGER`, custom variables for tools).
3636+ ```sh
3737+ # Example .exports
3838+ export EDITOR='vim'
3939+ export LANG='en_US.UTF-8'
4040+ export PAGER='less'
4141+ ```
4242+4343+* **`~/.functions` (or similar)**: Defines custom shell functions to automate common tasks or create complex commands.
4444+ ```sh
4545+ # Example function in .functions
4646+ # mkcd() {
4747+ # mkdir -p "$1" && cd "$1"
4848+ # }
4949+ ```
5050+5151+* **`~/.aliases` (or similar)**: Contains command aliases for frequently used commands or commands with common options.
5252+ ```sh
5353+ # Example .aliases
5454+ # alias ll='ls -alhF'
5555+ # alias update='sudo apt update && sudo apt upgrade -y' # Linux example
5656+ # alias brewup='brew update && brew upgrade && brew cleanup' # macOS example
5757+ ```
25833-- [Command-line Interface Usage](#command-line-interface-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
5959+These files are typically sourced from `~/.zshrc` in a specific order.
56066-## TODO: Create documentation
6161+## Essential CLI Enhancement Tools
76288-- Consistent GNU/Linux-like CLI experience
99-- Shell files
1010- - .path
1111- - .exports
1212- - .functions
1313- - .aliases
6363+These tools replace or augment standard CLI utilities for a better experience. They are usually installed via package managers (Homebrew, apt, etc.) and managed by `chezmoi`.
6464+6565+* **`exa`** or **`lsd`**: Modern replacements for `ls` with more colors, icons, and features.
6666+ * [exa](https://the.exa.website/), [lsd](https://github.com/Peltoche/lsd)
6767+* **`bat`**: A `cat` clone with syntax highlighting and Git integration.
6868+ * [bat](https://github.com/sharkdp/bat)
6969+* **`fd`**: A simple, fast, and user-friendly alternative to `find`.
7070+ * [fd](https://github.com/sharkdp/fd)
7171+* **`ripgrep` (`rg`)**: A line-oriented search tool that recursively searches the current directory for a regex pattern (very fast alternative to `grep`).
7272+ * [ripgrep](https://github.com/BurntSushi/ripgrep)
7373+* **`fzf`**: A command-line fuzzy finder for history, files, processes, etc. Often integrated with shell keybindings (`Ctrl+R`, `Ctrl+T`).
7474+ * [fzf](https://github.com/junegunn/fzf)
7575+* **`zoxide`**: A smarter `cd` command that learns your habits.
7676+ * [zoxide](https://github.com/ajeetdsouza/zoxide)
7777+* **`jq`**: A lightweight and flexible command-line JSON processor.
7878+ * [jq](https://stedolan.github.io/jq/)
7979+* **`yq`**: A command-line YAML, JSON, and XML processor (similar to `jq` but for more formats).
8080+ * [yq (Python version)](https://github.com/kislyuk/yq) or [yq (Go version)](https://github.com/mikefarah/yq)
8181+* **`tldr`**: Collaborative cheatsheets for console commands. Provides simplified man pages.
8282+ * [tldr-pages](https://tldr.sh/)
8383+* **`navi`** or **`cheat`**: Interactive command-line cheatsheet tools.
8484+ * [navi](https://github.com/denisidoro/navi), [cheat](https://github.com/cheat/cheat)
8585+* **`procs`**: A modern replacement for `ps` written in Rust.
8686+ * [procs](https://github.com/dalance/procs)
8787+* **`httpie`** or **`curlie`**: User-friendly CLI HTTP clients, alternatives to `curl`.
8888+ * [HTTPie](https://httpie.io/), [curlie](https://github.com/rs/curlie)
8989+9090+## General Tips
9191+9292+* **Keybindings**: Customize Zsh keybindings (often in `.zshrc` or a dedicated file) for frequently used actions or fzf integrations.
9393+* **Dotfiles Management**: Use `chezmoi edit <filename>` to easily edit any of these configuration files.
9494+9595+## Resources
9696+9797+* **GNU Coreutils**: [https://www.gnu.org/software/coreutils/](https://www.gnu.org/software/coreutils/)
9898+* Links to individual tools are provided in the list above.
9999+* **Awesome Shell**: [https://github.com/alebcay/awesome-shell](https://github.com/alebcay/awesome-shell) (A curated list of awesome command-line frameworks, toolkits, guides, and gizmos)
100100+* **Awesome CLI Apps**: [https://github.com/agarrharr/awesome-cli-apps](https://github.com/agarrharr/awesome-cli-apps)
101101+102102+This setup aims to make your command-line interactions more efficient and enjoyable. Explore the tools and customize them to fit your workflow.
···11# Docker Usage
2233-- [Docker Usage](#docker-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
33+This document provides a basic guide to using Docker, including common commands and concepts relevant to a development workflow.
44+55+## Overview
66+77+[Docker](https://www.docker.com/) is a platform for developing, shipping, and running applications in containers. Containers allow you to package an application with all of its dependencies into a standardized unit for software development.
88+99+## Installation
1010+1111+* **Docker Desktop**: For macOS and Windows, [Docker Desktop](https://www.docker.com/products/docker-desktop/) is the easiest way to install Docker. It includes the Docker Engine, Docker CLI client, Docker Compose, Kubernetes, and more.
1212+* **Linux**: On Linux, you can install the Docker Engine and CLI separately. Follow the official installation guides for your distribution (e.g., [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)).
1313+1414+Installation might be managed by `chezmoi` if Docker is part of your standard toolset defined in your dotfiles.
1515+1616+## Common Docker CLI Commands
1717+1818+Here are some of the most frequently used Docker commands:
1919+2020+* **Pull an image from a registry (e.g., Docker Hub)**:
2121+ ```sh
2222+ docker pull <image_name>:<tag>
2323+ # Example: docker pull ubuntu:latest
2424+ ```
2525+2626+* **Run a container from an image**:
2727+ ```sh
2828+ docker run [options] <image_name>:<tag> [command]
2929+ # Example (interactive shell in an Ubuntu container):
3030+ # docker run -it ubuntu:latest /bin/bash
3131+ # Example (run a web server, map port 8080 to container's port 80):
3232+ # docker run -d -p 8080:80 nginx:latest
3333+ ```
3434+ * `-d`: Detached mode (run in background)
3535+ * `-it`: Interactive TTY
3636+ * `-p <host_port>:<container_port>`: Port mapping
3737+ * `--name <container_name>`: Assign a name to the container
3838+ * `-v <host_path>:<container_path>`: Mount a volume
3939+4040+* **List running containers**:
4141+ ```sh
4242+ docker ps
4343+ ```
4444+4545+* **List all containers (running and stopped)**:
4646+ ```sh
4747+ docker ps -a
4848+ ```
4949+5050+* **View logs of a container**:
5151+ ```sh
5252+ docker logs <container_name_or_id>
5353+ # Follow logs: docker logs -f <container_name_or_id>
5454+ ```
5555+5656+* **Stop a running container**:
5757+ ```sh
5858+ docker stop <container_name_or_id>
5959+ ```
6060+6161+* **Remove a stopped container**:
6262+ ```sh
6363+ docker rm <container_name_or_id>
6464+ ```
6565+6666+* **List images**:
6767+ ```sh
6868+ docker images
6969+ ```
7070+7171+* **Remove an image**:
7272+ ```sh
7373+ docker rmi <image_name_or_id>
7474+ ```
7575+7676+* **Clean up unused resources (containers, networks, images)**:
7777+ ```sh
7878+ docker system prune
7979+ # To remove all unused images, not just dangling ones:
8080+ # docker system prune -a
8181+ ```
8282+8383+## Docker Compose
8484+8585+[Docker Compose](https://docs.docker.com/compose/) is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file (`docker-compose.yml`) to configure your application's services.
8686+8787+### Example `docker-compose.yml` snippet:
8888+```yaml
8989+version: '3.8'
9090+services:
9191+ web:
9292+ image: nginx:latest
9393+ ports:
9494+ - "8080:80"
9595+ app:
9696+ image: my-custom-app
9797+ build: .
9898+ ports:
9999+ - "3000:3000"
100100+```
510166-## TODO: Create documentation
102102+### Common Docker Compose Commands:
710388-- [Development Containers](https://containers.dev/)
104104+* **Start services defined in `docker-compose.yml`**:
105105+ ```sh
106106+ docker-compose up
107107+ # Start in detached mode: docker-compose up -d
108108+ ```
109109+110110+* **Stop services**:
111111+ ```sh
112112+ docker-compose down
113113+ ```
114114+115115+* **List services**:
116116+ ```sh
117117+ docker-compose ps
118118+ ```
119119+120120+## Development Containers (Dev Containers)
121121+122122+[Development Containers](https://containers.dev/) (Dev Containers) allow you to use a Docker container as a full-featured development environment. This is particularly useful with editors like VS Code.
123123+124124+A `devcontainer.json` file in your project tells VS Code (and other tools) how to access (or create) a development container with a well-defined tool and runtime stack.
125125+126126+### Key Benefits:
127127+* **Consistent Environment**: Ensures everyone on the team uses the same development environment.
128128+* **Tool Isolation**: Keeps tools and dependencies for different projects separate.
129129+* **Pre-configured Setups**: Quickly onboard new developers with ready-to-use environments.
130130+131131+Refer to the [official Dev Containers documentation](https://containers.dev/docs) and the [VS Code Remote - Containers documentation](https://code.visualstudio.com/docs/remote/containers) for setup and usage details.
132132+133133+## Resources
134134+135135+* **Official Docker Documentation**: [https://docs.docker.com/](https://docs.docker.com/)
136136+* **Docker Hub (Image Registry)**: [https://hub.docker.com/](https://hub.docker.com/)
137137+* **Docker Compose Documentation**: [https://docs.docker.com/compose/](https://docs.docker.com/compose/)
138138+* **Development Containers**: [https://containers.dev/](https://containers.dev/)
139139+* **VS Code Remote - Containers**: [https://code.visualstudio.com/docs/devcontainers/containers](https://code.visualstudio.com/docs/devcontainers/containers) (Note: VS Code documentation now prefers /devcontainers/ over /remote/)
140140+141141+This guide provides a starting point. Docker is a vast ecosystem, so refer to the official documentation for in-depth information.
+208-134
docs/git-usage.md
···11-# Git Usage
11+# Git Usage and Best Practices
2233-## Table of contents
33+This document outlines Git configuration, best practices for commit signing with GPG and 1Password, and useful Git commands relevant to this dotfiles setup.
4455-- [Git Usage](#git-usage)
66- - [Table of contents](#table-of-contents)
77- - [Configuration](#configuration)
88- - [Signing commits](#signing-commits)
99- - [Troubleshooting](#troubleshooting)
1010- - [Additional settings](#additional-settings)
1111- - [Useful commands](#useful-commands)
55+## Table of Contents
1261313-## Configuration
77+- [Git Usage and Best Practices](#git-usage-and-best-practices)
88+ - [Table of Contents](#table-of-contents)
99+ - [Core Git Configuration](#core-git-configuration)
1010+ - [Commit Signing with GPG and 1Password](#commit-signing-with-gpg-and-1password)
1111+ - [1. Generating or Importing Your GPG Key](#1-generating-or-importing-your-gpg-key)
1212+ - [2. Adding Your GPG Key ID to 1Password](#2-adding-your-gpg-key-id-to-1password)
1313+ - [3. Configuring Git to Use the GPG Key (via `chezmoi` and 1Password)](#3-configuring-git-to-use-the-gpg-key-via-chezmoi-and-1password)
1414+ - [4. Adding GPG Public Key to GitHub](#4-adding-gpg-public-key-to-github)
1515+ - [5. GPG Agent Configuration](#5-gpg-agent-configuration)
1616+ - [6. Troubleshooting GPG Signing](#6-troubleshooting-gpg-signing)
1717+ - [GitHub CLI Authentication (`gh auth login`)](#github-cli-authentication-gh-auth-login)
1818+ - [Common Git Workflows and Useful Commands](#common-git-workflows-and-useful-commands)
1919+ - [Basic Workflow](#basic-workflow)
2020+ - [Branching](#branching)
2121+ - [Stashing Changes](#stashing-changes)
2222+ - [Viewing History](#viewing-history)
2323+ - [Squashing Commits](#squashing-commits)
2424+ - [Tags](#tags)
2525+ - [Resources](#resources)
14261515-<!-- markdownlint-disable-next-line no-inline-html -->
1616-The commands below will configure your Git command-line client globally. Please, update your username (<span style="color:red">Your Name</span>) and email address (<span style="color:red">youremail@domain</span>) in the code snippet below prior to executing it.
2727+## Core Git Configuration
17281818-This configuration is to support trunk-based development and git linear history.
2929+Key Git settings are managed by `chezmoi` via the `dot_gitconfig.tmpl` template file, which generates `~/.gitconfig`.
3030+This configuration generally promotes trunk-based development and a linear Git history.
19312020-```shell
2121-git config user.name "Your Name" # Use your full name here
2222-git config user.email "youremail@domain" # Use your email address here
2323-git config branch.autosetupmerge false
2424-git config branch.autosetuprebase always
2525-git config commit.gpgsign true
2626-git config core.autocrlf input
2727-git config core.filemode true
2828-git config core.hidedotfiles false
2929-git config core.ignorecase false
3030-git config credential.helper cache
3131-git config pull.rebase true
3232-git config push.default current
3333-git config push.followTags true
3434-git config rebase.autoStash true
3535-git config remote.origin.prune true
3232+Common global settings include:
3333+3434+```ini
3535+# Example from dot_gitconfig.tmpl (values are templated)
3636+[user]
3737+ name = {{ .name | quote }}
3838+ email = {{ .email | quote }}
3939+ signingkey = {{ (onepasswordRead "op://Personal/Git GPG Key/key_id").stdout | trim | quote }} # Fetched from 1Password
4040+[commit]
4141+ gpgsign = true # Sign all commits by default
4242+[pull]
4343+ rebase = true # Prefer rebase over merge on pull
4444+[rebase]
4545+ autoStash = true # Automatically stash changes before rebase
4646+[push]
4747+ default = current # Push the current branch to a branch of the same name
4848+ followTags = true # Push tags that point to commits being pushed
4949+[branch]
5050+ autosetupmerge = false # Do not automatically set up merge configurations
5151+ autosetuprebase = always # Always rebase when pulling on new branches
5252+[core]
5353+ autocrlf = input # Handle line endings correctly
5454+ # ... other settings ...
5555+[remote "origin"]
5656+ prune = true # Remove remote-tracking branches that no longer exist on the remote
3657```
37583838-This is already set in the [`dot_gitconfig.tmpl`](https://github.com/make-ops-tools/dotfiles/blob/main/dot_gitconfig.tmpl) file, that is used as a template to create `~/.gitconfig`.
5959+* The specific template is located at: `{{ .chezmoi.sourceDir }}/dot_gitconfig.tmpl`.
6060+* Refer to the [Git Reference documentation](https://git-scm.com/docs) for details on these settings.
39614040-More information on the git settings can be found in the [Git Reference documentation](https://git-scm.com/docs).
6262+## Commit Signing with GPG and 1Password
41634242-## Signing commits
6464+Signing Git commits cryptographically verifies the committer's identity. This setup uses GPG for signing, with the GPG key ID managed via 1Password.
43654444-Signing Git commits is a good practice and ensures the correct web of trust has been established for the distributed version control management.
6666+### 1. Generating or Importing Your GPG Key
45674646-<!-- markdownlint-disable-next-line no-inline-html -->
4747-If you do not have it already generate a new pair of GPG keys. Please, change the passphrase (<span style="color:red">pleaseChooseYourKeyPassphrase</span>) below and save it in your password manager.
6868+If you don't have a GPG key, generate one:
48694949-```shell
5050-USER_NAME="Your Name"
5151-USER_EMAIL="your.name@email"
5252-file=$(echo $USER_EMAIL | sed "s/[^[:alpha:]]/-/g")
5353-5454-mkdir -p "$HOME/.gnupg"
5555-chmod 0700 "$HOME/.gnupg"
5656-cd "$HOME/.gnupg"
5757-cat > "$file.gpg-key.script" <<EOF
5858- %echo Generating a GPG key
5959- Key-Type: ECDSA
6060- Key-Curve: nistp256
6161- Subkey-Type: ECDH
6262- Subkey-Curve: nistp256
6363- Name-Real: $USER_NAME
6464- Name-Email: $USER_EMAIL
6565- Expire-Date: 0
6666- Passphrase: pleaseChooseYourKeyPassphrase
6767- %commit
6868- %echo done
6969-EOF
7070-gpg --batch --generate-key "$file.gpg-key.script"
7171-rm "$file.gpg-key.script"
7272-# or do it manually by running `gpg --full-gen-key`
7070+```sh
7171+gpg --full-gen-key
7372```
7373+Follow the prompts. An `ECDSA` key with `nistp256` curve is a good modern choice. Ensure you use a strong passphrase and store it securely (e.g., in 1Password).
74747575-Make note of the ID and save the keys.
7575+If you have an existing GPG key, ensure it's in your GPG keyring.
76767777-```shell
7878-gpg --list-secret-keys --keyid-format LONG $USER_EMAIL
7979-```
7777+### 2. Adding Your GPG Key ID to 1Password
80788181-You should see a similar output to this
7979+Once you have a GPG key, get its Key ID:
82808383-```shell
8484-sec nistp256/AAAAAAAAAAAAAAAA 2023-01-01 [SCA]
8181+```sh
8282+gpg --list-secret-keys --keyid-format LONG "Your Name" # Or your email
8383+```
8484+Output will look like:
8585+```
8686+sec nistp256/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX YYYY-MM-DD [SCA]
8587 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
8686-uid [ultimate] Your Name <your.name@email>
8787-ssb nistp256/BBBBBBBBBBBBBBBB 2023-01-01 [E]
8888+uid [ultimate] Your Name <your.email@example.com>
8989+ssb nistp256/YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY YYYY-MM-DD [E]
8890```
9191+The long Key ID is `XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX` (the 40-character string).
89929090-Export your keys.
9393+Store this Key ID in 1Password. For example, create a "Secure Note" or "Login" item named "Git GPG Key" and add a field/label (e.g., `key_id`) with your GPG Key ID as the value.
91949292-```shell
9393-ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9494-gpg --armor --export $ID > $file.gpg-key.pub
9595-gpg --armor --export-secret-keys $ID > $file.gpg-key
9696-```
9595+See `docs/1password-usage.md` for more on storing items in 1Password.
97969898-Import already existing private key.
9797+### 3. Configuring Git to Use the GPG Key (via `chezmoi` and 1Password)
9998100100-```shell
101101-gpg --import $file.gpg-key
9999+As shown in the "Core Git Configuration" section, `dot_gitconfig.tmpl` is set up to fetch the `user.signingkey` from 1Password:
100100+101101+```ini
102102+[user]
103103+ signingkey = {{ (onepasswordRead "op://Personal/Git GPG Key/key_id").stdout | trim | quote }}
102104```
105105+Ensure the 1Password item path (`op://Personal/Git GPG Key/key_id`) in your `dot_gitconfig.tmpl` matches where you stored the key ID in 1Password.
106106+`chezmoi apply` will populate your `~/.gitconfig` with this signing key.
103107104104-Remove keys from the GPG agent if no longer needed.
108108+### 4. Adding GPG Public Key to GitHub
105109106106-```shell
107107-gpg --delete-secret-keys $ID
108108-gpg --delete-keys $ID
109109-```
110110+To have GitHub show your commits as "Verified":
110111111111-Configure Git to use the new key.
112112+1. Export your GPG public key:
113113+ ```sh
114114+ gpg --armor --export XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Use your Key ID
115115+ ```
116116+2. Copy the entire output (starting with `-----BEGIN PGP PUBLIC KEY BLOCK-----`).
117117+3. Go to [GitHub GPG keys settings](https://github.com/settings/keys) and add the new GPG key.
112118113113-```shell
114114-git config user.signingkey $ID
119119+### 5. GPG Agent Configuration
120120+121121+To avoid entering your GPG passphrase for every commit, configure the `gpg-agent` to cache it. `chezmoi` manages `~/.gnupg/gpg-agent.conf`:
122122+115123```
124124+# Example content for gpg-agent.conf.tmpl
125125+# Managed by chezmoi
116126117117-Upload the public key to your GitHub profile into the [GPG keys](https://github.com/settings/keys) section. After doing so, please make sure your email address appears as verified against the commits pushed to the remote.
127127+pinentry-program {{ .pinentryProgram | quote }} # Path to pinentry, templated by chezmoi
128128+default-cache-ttl 10800 # Cache passphrase for 3 hours
129129+max-cache-ttl 10800 # Max cache time
130130+```
131131+`chezmoi` templates can determine the correct `pinentry-program` path based on your OS.
132132+After changes, you might need to restart the agent: `gpgconf --kill gpg-agent`.
133133+134134+### 6. Troubleshooting GPG Signing
135135+136136+* **Error: `gpg failed to sign the data` or `Inappropriate ioctl for device`**:
137137+ Ensure `export GPG_TTY=$(tty)` is in your shell configuration (e.g., `~/.exports` or `~/.zshrc`, managed by `chezmoi`). This allows GPG to prompt for a passphrase in the current terminal.
138138+ ```sh
139139+ # Ensure this line is in a chezmoi-managed shell startup file:
140140+ # export GPG_TTY=$(tty)
141141+ ```
142142+ Restart your shell or source the updated file.
143143+* **No Pinentry Program Found**: Ensure `pinentry` is installed (e.g., `brew install pinentry-mac` on macOS) and `gpg-agent.conf` points to the correct program.
144144+* **Secret Key Not Available**: Verify the key ID in `~/.gitconfig` matches a private key in your `gpg --list-secret-keys` output.
145145+146146+## GitHub CLI Authentication (`gh auth login`)
147147+148148+While Git uses SSH or HTTPS (often with a credential helper) for repository access, the GitHub CLI (`gh`) requires its own authentication.
118149119119-```shell
120120-cat $file.gpg-key.pub
150150+```sh
151151+gh auth login
121152```
153153+Follow the prompts. Authenticating with a web browser (HTTPS) is often simplest.
154154+Refer to `docs/github-usage.md` for more on using `gh`.
122155123123-### Troubleshooting
156156+## Common Git Workflows and Useful Commands
124157125125-If you receive the error message "error: gpg failed to sign the data", make sure you added `export GPG_TTY=$TTY` to your `~/.zshrc` or other file that is sourced by it, like `~/.exports` and restarted your terminal.
158158+### Basic Workflow
126159127127-```shell
128128-sed -i '/^export GPG_TTY/d' ~/.exports
129129-echo "export GPG_TTY=\$TTY" >> ~/.exports
160160+```sh
161161+git pull # Fetch and integrate changes from remote
162162+git add . # Stage all changes in the current directory
163163+# Or git add <file1> <file2> ... to stage specific files
164164+git commit -S -m "Your descriptive commit message" # Create a signed commit
165165+git push # Push changes to the remote repository
130166```
131167132132-## Additional settings
168168+### Branching
169169+170170+* Create a new branch and switch to it:
171171+ ```sh
172172+ git checkout -b new-feature-branch
173173+ ```
174174+* Switch to an existing branch:
175175+ ```sh
176176+ git checkout main
177177+ ```
178178+* Delete a local branch (after merging):
179179+ ```sh
180180+ git branch -d feature-branch # Safe delete (only if merged)
181181+ git branch -D feature-branch # Force delete
182182+ ```
183183+* Push a new local branch to remote and set up tracking:
184184+ ```sh
185185+ git push -u origin new-feature-branch
186186+ ```
187187+188188+### Stashing Changes
133189134134-Configure caching git commit signature passphrase for 3 hours
190190+Temporarily save uncommitted changes:
135191136136-```shell
137137-source ~/.zshrc
138138-mkdir -p ~/.gnupg
139139-sed -i '/^pinentry-program/d' ~/.gnupg/gpg-agent.conf 2>/dev/null ||:
140140-echo "pinentry-program $(whereis -q pinentry)" >> ~/.gnupg/gpg-agent.conf
141141-sed -i '/^default-cache-ttl/d' ~/.gnupg/gpg-agent.conf
142142-echo "default-cache-ttl 10800" >> ~/.gnupg/gpg-agent.conf
143143-sed -i '/^max-cache-ttl/d' ~/.gnupg/gpg-agent.conf
144144-echo "max-cache-ttl 10800" >> ~/.gnupg/gpg-agent.conf
145145-gpgconf --kill gpg-agent
192192+```sh
193193+git stash push -m "WIP: some changes for later"
194194+git stash list
195195+git stash apply stash@{0} # Apply a specific stash
196196+git stash pop # Apply the latest stash and remove it from the list
197197+git stash drop stash@{0} # Remove a specific stash
146198```
147199148148-Please, see the [`assets/03-install-developer-tools.macos.sh`](https://github.com/make-ops-tools/dotfiles/blob/main/assets/03-install-developer-tools.macos.sh) file, as this section is part of the automated configuration.
200200+### Viewing History
201201+202202+* Compact log view:
203203+ ```sh
204204+ git log --oneline --graph --decorate --all
205205+ ```
206206+ (Consider creating a Git alias like `git la` for this.)
207207+* View changes for a specific commit:
208208+ ```sh
209209+ git show <commit_hash>
210210+ ```
211211+* View changes for a specific file:
212212+ ```sh
213213+ git log -p -- <file_path>
214214+ ```
215215+216216+### Squashing Commits
217217+218218+Combine multiple commits into a single one, often done before merging a feature branch.
149219150150-Authenticate to GitHub and set up your authorisation token
220220+* Interactively rebase onto `main` (or your target branch), squashing commits from your current feature branch:
221221+ ```sh
222222+ # Assuming you are on your feature branch that branched off main
223223+ git rebase -i main
224224+ ```
225225+ In the interactive editor, change `pick` to `s` (squash) or `f` (fixup) for commits you want to merge into the preceding one. Edit commit messages as needed.
226226+* Force push (with lease) if you've rewritten history on a shared branch (use with caution):
227227+ ```sh
228228+ git push --force-with-lease
229229+ ```
151230152152-```shell
153153-$ gh auth login
154154-? What account do you want to log into? GitHub.com
155155-? What is your preferred protocol for Git operations? HTTPS
156156-? Authenticate Git with your GitHub credentials? No
157157-? How would you like to authenticate GitHub CLI? Paste an authentication token
158158-Tip: you can generate a Personal Access Token here https://github.com/settings/tokens
159159-The minimum required scopes are 'repo', 'read:org'.
160160-? Paste your authentication token: github_pat_**********************************************************************************
161161-- gh config set -h github.com git_protocol https
162162-✓ Configured git protocol
163163-✓ Logged in as your-github-handle
231231+Alternatively, the example from the previous version for squashing all commits on a branch into one based on `main`:
232232+```sh
233233+# git checkout your-feature-branch
234234+# git reset $(git merge-base main $(git branch --show-current))
235235+# git add .
236236+# git commit -S -m "New single commit message for the feature"
237237+# git push --force-with-lease origin your-feature-branch
164238```
165239166166-## Useful commands
240240+### Tags
167241168168-Add your changes, create a signed commit, update from and push to remote
242242+Create lightweight or annotated tags for releases:
169243170170-```shell
171171-git add .
172172-git commit -S -m "Create a signed commit"
173173-git pull
174174-git push
244244+```sh
245245+git tag v1.0.0 # Lightweight tag
246246+git tag -a v1.0.1 -m "Version 1.0.1 release" # Annotated tag (signed if gpgsign=true)
247247+git push origin v1.0.1 # Push a specific tag
248248+git push --tags # Push all tags
175249```
176250177177-Squash all commits on branch as one
251251+## Resources
252252+253253+* **Pro Git Book**: [https://git-scm.com/book/en/v2](https://git-scm.com/book/en/v2) (Excellent, comprehensive guide)
254254+* **Git Reference Documentation**: [https://git-scm.com/docs](https://git-scm.com/docs)
255255+* **GitHub GPG Signing Documentation**: [https://docs.github.com/en/authentication/managing-commit-signature-verification](https://docs.github.com/en/authentication/managing-commit-signature-verification)
256256+* **1Password Documentation**: See `docs/1password-usage.md`
257257+* **GitHub CLI Documentation**: See `docs/github-usage.md`
178258179179-```shell
180180-git checkout your-branch-name
181181-git reset $(git merge-base main $(git branch --show-current))
182182-git add .
183183-git commit -S -m "Create just one commit instead"
184184-git push --force-with-lease
185185-```
259259+This guide covers key Git practices for this dotfiles setup. Consistent use of signed commits and a clean history are encouraged.
+106-3
docs/github-usage.md
···11# GitHub Usage
2233-- [GitHub Usage](#github-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
33+This document provides guidance on interacting with GitHub, primarily focusing on the GitHub CLI tool (`gh`) and general best practices.
44+55+## Overview
66+77+GitHub is a platform for version control and collaboration using Git. The GitHub CLI (`gh`) brings GitHub to your terminal, allowing you to manage repositories, pull requests, issues, and more without leaving the command line.
88+99+## GitHub CLI (`gh`)
1010+1111+The GitHub CLI is the preferred way to interact with GitHub programmatically and from the terminal for many tasks.
1212+1313+### Installation
1414+1515+The GitHub CLI is typically installed via Homebrew if specified in your `chezmoi` configurations:
1616+```sh
1717+brew install gh
1818+```
1919+Refer to the [official installation guide](https://github.com/cli/cli#installation) for other methods.
2020+2121+### Authentication
2222+2323+After installation, you need to authenticate `gh` with your GitHub account:
2424+```sh
2525+gh auth login
2626+```
2727+Follow the prompts. Using `HTTPS` and authenticating with web browser is often the easiest method.
2828+2929+### Common `gh` Commands
3030+3131+* **Repository Commands (`gh repo ...`)**
3232+ * Clone a repository:
3333+ ```sh
3434+ gh repo clone <owner>/<repository_name>
3535+ # Example: gh repo clone cli/cli
3636+ ```
3737+ * Create a new repository:
3838+ ```sh
3939+ gh repo create <repository_name> [options]
4040+ # Example: gh repo create my-new-project --public --source=.
4141+ ```
4242+ * View a repository in the browser:
4343+ ```sh
4444+ gh repo view --web
4545+ ```
4646+4747+* **Pull Request Commands (`gh pr ...`)**
4848+ * List pull requests:
4949+ ```sh
5050+ gh pr list
5151+ ```
5252+ * View a specific pull request:
5353+ ```sh
5454+ gh pr view <pr_number_or_branch_name>
5555+ # View in browser: gh pr view <pr_number_or_branch_name> --web
5656+ ```
5757+ * Checkout a pull request locally:
5858+ ```sh
5959+ gh pr checkout <pr_number_or_branch_name>
6060+ ```
6161+ * Create a pull request:
6262+ ```sh
6363+ gh pr create [options]
6464+ # Example (prompts for title, body, base branch, etc.):
6565+ # gh pr create
6666+ # Example (with details):
6767+ # gh pr create --title "My Awesome Feature" --body "Details about the feature." --base main
6868+ ```
6969+ * Diff a pull request:
7070+ ```sh
7171+ gh pr diff <pr_number_or_branch_name>
7272+ ```
57366-## TODO: Create documentation
7474+* **Issue Commands (`gh issue ...`)**
7575+ * List issues:
7676+ ```sh
7777+ gh issue list
7878+ ```
7979+ * View an issue:
8080+ ```sh
8181+ gh issue view <issue_number>
8282+ # View in browser: gh issue view <issue_number> --web
8383+ ```
8484+ * Create an issue:
8585+ ```sh
8686+ gh issue create --title "My Issue Title" --body "Issue details."
8787+ ```
8888+8989+* **Alias Management (`gh alias ...`)**
9090+ * `gh` supports creating aliases for complex commands. Example:
9191+ ```sh
9292+ gh alias set myprs "pr list --author @me"
9393+ gh myprs # Runs the aliased command
9494+ ```
9595+9696+## Git Configuration for GitHub
9797+9898+Ensure your local Git configuration (see `docs/git-usage.md`) is set up correctly with your GitHub username and email, especially if you contribute to multiple repositories or use different identities.
9999+100100+SSH keys are recommended for `git push/pull` operations with GitHub for better security and convenience. Refer to GitHub's documentation on [generating a new SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent) and [adding it to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).
101101+102102+## Resources
103103+104104+* **GitHub CLI Official Documentation**: [https://cli.github.com/manual/](https://cli.github.com/manual/)
105105+* **GitHub CLI GitHub Repository**: [https://github.com/cli/cli](https://github.com/cli/cli)
106106+* **GitHub Help Documentation**: [https://docs.github.com/](https://docs.github.com/)
107107+* **GitHub SSH Key Setup**: [Connecting to GitHub with SSH](https://docs.github.com/en/authentication/connecting-to-github-with-ssh)
108108+109109+This document provides a basic overview. The GitHub CLI is very powerful; explore its manual for more commands and options.
+135-4
docs/go-usage.md
···11-# Go Usage
11+# Go (Golang) Usage
22+33+This document provides a guide to setting up and using the Go programming language, including managing versions and common commands.
44+55+## Overview
66+77+[Go](https://go.dev/) (often referred to as Golang) is an open-source programming language designed by Google. It is known for its simplicity, efficiency, strong support for concurrency, and robust standard library.
88+99+## Installation
1010+1111+There are several ways to install Go:
1212+1313+* **Official Installers**: Download from [go.dev/dl/](https://go.dev/dl/).
1414+* **Homebrew (macOS)**:
1515+ ```sh
1616+ brew install go
1717+ ```
1818+ This usually installs the latest stable version.
1919+* **Go Version Manager (`goenv`)** (Recommended for managing multiple Go versions):
2020+ [goenv](https://github.com/syndbg/goenv) lets you easily switch between multiple versions of Go. It's similar to `pyenv` for Python or `tfenv` for Terraform.
2121+2222+ **Installation of `goenv` (macOS with Homebrew):**
2323+ ```sh
2424+ brew install goenv
2525+ ```
2626+ For other systems or manual install, see the [goenv installation guide](https://github.com/syndbg/goenv#installation).
2727+2828+ **Using `goenv`:**
2929+ 1. Initialize `goenv` in your shell (add to `.zshrc` or `.bashrc`, managed by `chezmoi`):
3030+ ```sh
3131+ # Example for .zshrc
3232+ # if command -v goenv 1>/dev/null 2>&1; then
3333+ # eval "$(goenv init -)"
3434+ # fi
3535+ ```
3636+ 2. List available Go versions to install:
3737+ ```sh
3838+ goenv install -l
3939+ ```
4040+ 3. Install a specific Go version:
4141+ ```sh
4242+ goenv install <version>
4343+ # Example: goenv install 1.18.3
4444+ ```
4545+ 4. Set global or local (per-project) Go version:
4646+ ```sh
4747+ goenv global <version> # Sets the default Go version
4848+ goenv local <version> # Creates a .go-version file in the current directory
4949+ ```
5050+5151+If `chezmoi` manages your Go installation, it will handle the chosen installation method.
5252+5353+## Environment Variables
5454+5555+Go uses several environment variables to configure its behavior:
5656+5757+* **`GOROOT`**: The root of your Go installation (e.g., `/usr/local/go` or a path managed by `goenv`). Usually set automatically.
5858+* **`GOPATH`**: Defines the root of your workspace. Before Go Modules, it was crucial for organizing Go code and compiled binaries. With Go Modules, its role has diminished but it still defines a default location for `go install` outside a module (`$HOME/go` by default).
5959+* **`GOBIN`**: The directory where `go install` will place compiled binaries (if set). If not set, binaries are placed in `$GOPATH/bin` (or `$HOME/go/bin`).
6060+* **`GO111MODULE`**: Controls Go Modules behavior.
6161+ * `on`: Forces module-aware mode (default in Go 1.16+).
6262+ * `auto`: Enables module mode if a `go.mod` file is present in the current or any parent directory.
6363+ * `off`: Disables module mode, uses `GOPATH` mode.
6464+6565+These are typically set in your shell profile (`.zshrc`, `.bash_profile`), managed by `chezmoi`.
6666+6767+## Basic Go Commands
6868+6969+* **`go version`**: Displays the current Go version.
7070+ ```sh
7171+ go version
7272+ ```
7373+7474+* **`go run <filename.go>`**: Compiles and runs a Go program.
7575+ ```sh
7676+ go run main.go
7777+ ```
7878+7979+* **`go build [packages]`**: Compiles packages and their dependencies. Creates an executable in the current directory (for `main` packages).
8080+ ```sh
8181+ go build
8282+ go build ./cmd/myprogram
8383+ ```
8484+8585+* **`go install [packages]`**: Compiles and installs packages. Executables are placed in `$GOBIN` or `$GOPATH/bin`.
8686+ ```sh
8787+ go install github.com/user/project/cmd/mytool@latest
8888+ ```
8989+9090+* **`go test [packages]`**: Runs tests for the specified packages.
9191+ ```sh
9292+ go test ./...
9393+ go test -v ./mypackage
9494+ ```
9595+9696+* **`go get [packages]`**: (Legacy behavior with Go Modules) Adds dependencies to `go.mod` and installs them. For installing tools, prefer `go install tool@version`.
9797+9898+## Go Modules
9999+100100+Go Modules are used for dependency management.
101101+102102+* **`go mod init <module_path>`**: Initializes a new module in the current directory, creating a `go.mod` file.
103103+ ```sh
104104+ go mod init github.com/myuser/myproject
105105+ ```
106106+107107+* **`go mod tidy`**: Adds missing and removes unused modules from `go.mod` and `go.sum`.
108108+ ```sh
109109+ go mod tidy
110110+ ```
111111+112112+* **`go mod download`**: Downloads modules to the local cache.
113113+ ```sh
114114+ go mod download
115115+ ```
211633-- [Go Usage](#go-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
117117+* **`go list -m all`**: Lists all modules used in the current project.
511866-## TODO: Create documentation
119119+## Common Go Tools
120120+121121+* **`gofmt`**: Formats Go programs.
122122+ ```sh
123123+ gofmt -w main.go # Formats and writes back to file
124124+ ```
125125+* **`goimports`**: Updates your Go import lines, adding missing and removing unreferenced ones (superset of `gofmt`). Install with `go install golang.org/x/tools/cmd/goimports@latest`.
126126+* **`golint` / `staticcheck` / `golangci-lint`**: Linters for Go code. `golangci-lint` is a popular meta-linter.
127127+128128+## Resources
129129+130130+* **Official Go Website**: [https://go.dev/](https://go.dev/)
131131+* **Go Documentation**: [https://go.dev/doc/](https://go.dev/doc/)
132132+* **Effective Go (Best Practices)**: [https://go.dev/doc/effective_go](https://go.dev/doc/effective_go)
133133+* **Go Modules Reference**: [https://go.dev/ref/mod](https://go.dev/ref/mod)
134134+* **`goenv` GitHub Repository**: [https://github.com/syndbg/goenv](https://github.com/syndbg/goenv)
135135+* **Go Playground**: [https://go.dev/play/](https://go.dev/play/)
136136+137137+This document provides a starting point for working with Go. Refer to the official documentation for more in-depth information.
+90-4
docs/kubernetes-usage.md
···11-# Kubernetes Usage
11+# Kubernetes (k8s) Usage
22+33+This document provides a guide to interacting with Kubernetes clusters, focusing on `kubectl` (the Kubernetes command-line tool) and common helper utilities.
44+55+## Overview
66+77+[Kubernetes](https://kubernetes.io/) (commonly stylized as k8s) is an open-source system for automating deployment, scaling, and management of containerized applications.
88+99+## `kubectl`: The Kubernetes CLI
1010+1111+`kubectl` is the primary command-line tool for running commands against Kubernetes clusters. It allows you to deploy applications, inspect and manage cluster resources, and view logs.
1212+1313+### Installation
1414+1515+* **Homebrew (macOS)**:
1616+ ```sh
1717+ brew install kubectl
1818+ ```
1919+* **Official Guides**: For other operating systems or specific versions, refer to the [official Kubernetes documentation on installing `kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/).
2020+2121+Installation might be managed by `chezmoi` if `kubectl` is part of your standard toolset.
2222+2323+### Configuration (`kubeconfig`)
2424+2525+`kubectl` uses a configuration file, typically located at `~/.kube/config`, to store cluster access information (server endpoints, user credentials, namespaces, contexts).
2626+2727+* **Multiple Clusters**: The `kubeconfig` file can define multiple clusters and contexts.
2828+* **Context Switching**: Use `kubectl config use-context <context_name>` to switch between defined contexts.
2929+* **Environment Variable**: You can specify a different kubeconfig file by setting the `KUBECONFIG` environment variable:
3030+ ```sh
3131+ export KUBECONFIG=~/.kube/custom-config:~/.kube/another-config
3232+ ```
3333+* **Security**: Kubeconfig files can contain sensitive credentials.
3434+ * Avoid committing them directly to public repositories.
3535+ * Consider using tools that dynamically generate or fetch credentials (e.g., `aws eks update-kubeconfig` for Amazon EKS, `gcloud container clusters get-credentials` for GKE).
3636+ * If you must store parts of a kubeconfig managed by `chezmoi`, ensure sensitive fields are templated and sourced from a secrets manager like 1Password (see `docs/1password-usage.md`).
3737+3838+## Common `kubectl` Commands
23933-- [Kubernetes Usage](#kubernetes-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
4040+* **Cluster Information & Contexts**:
4141+ * `kubectl cluster-info`: Display endpoint information about the master and services.
4242+ * `kubectl config get-contexts`: List available contexts.
4343+ * `kubectl config current-context`: Display the current context.
4444+ * `kubectl config use-context <context_name>`: Switch to a different context.
54566-## TODO: Create documentation
4646+* **Viewing Resources**:
4747+ * `kubectl get nodes`: List all nodes in the cluster.
4848+ * `kubectl get pods [-n <namespace>] [-o wide]`: List pods in a namespace (add `-A` or `--all-namespaces` for all).
4949+ * `kubectl get services [-n <namespace>]`: List services.
5050+ * `kubectl get deployments [-n <namespace>]`: List deployments.
5151+ * `kubectl get namespaces`: List all namespaces.
5252+ * `kubectl describe pod <pod_name> [-n <namespace>]`: Show detailed information about a pod.
5353+ * `kubectl describe node <node_name>`: Show detailed information about a node.
5454+5555+* **Interacting with Pods**:
5656+ * `kubectl logs <pod_name> [-n <namespace>] [-c <container_name>]`: Print the logs for a container in a pod.
5757+ * `kubectl logs -f <pod_name>`: Follow log output.
5858+ * `kubectl exec -it <pod_name> [-n <namespace>] [-c <container_name>] -- <command>`: Execute a command in a container.
5959+ * Example (get a shell): `kubectl exec -it my-pod -- /bin/sh`
6060+ * `kubectl cp <file_path> <pod_name>:<path_in_pod>`: Copy files and directories to and from containers.
6161+6262+* **Managing Applications**:
6363+ * `kubectl apply -f <filename.yaml_or_directory>`: Apply a configuration to a resource by filename or stdin.
6464+ * `kubectl delete -f <filename.yaml>`: Delete resources defined in a file.
6565+ * `kubectl delete pod <pod_name> [-n <namespace>]`: Delete a pod.
6666+ * `kubectl scale deployment <deployment_name> --replicas=<count>`: Scale a deployment.
6767+6868+* **Port Forwarding**:
6969+ * `kubectl port-forward <pod_name_or_service/service_name> <local_port>:<remote_port>`: Forward one or more local ports to a pod or service.
7070+ * Example: `kubectl port-forward svc/my-service 8080:80`
7171+7272+## Helper Tools & Ecosystem
7373+7474+* **[k9s](https://k9scli.io/)**: A terminal-based UI to interact with your Kubernetes clusters. Highly recommended for easier navigation and management.
7575+ * Installation (Homebrew): `brew install k9s`
7676+* **[kubectx + kubens](https://github.com/ahmetb/kubectx)**: Tools to switch between Kubernetes contexts (`kubectx`) and namespaces (`kubens`) more easily.
7777+ * Installation (Homebrew): `brew install kubectx`
7878+* **[Helm](https://helm.sh/)**: The package manager for Kubernetes. Helps you manage Kubernetes applications through Helm Charts.
7979+ * Installation (Homebrew): `brew install helm`
8080+* **[Lens](https://k8slens.dev/)**: A popular open-source Kubernetes IDE for managing clusters.
8181+* **[Stern](https://github.com/stern/stern)**: Multi-pod and container log tailing for Kubernetes.
8282+8383+## Resources
8484+8585+* **Official Kubernetes Documentation**: [https://kubernetes.io/docs/](https://kubernetes.io/docs/)
8686+* **`kubectl` Cheat Sheet**: [https://kubernetes.io/docs/reference/kubectl/cheatsheet/](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)
8787+* **`kubectl` Command Reference**: [https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands)
8888+* **k9s**: [https://k9scli.io/](https://k9scli.io/)
8989+* **kubectx + kubens**: [https://github.com/ahmetb/kubectx](https://github.com/ahmetb/kubectx)
9090+* **Helm**: [https://helm.sh/docs/](https://helm.sh/docs/)
9191+9292+This document provides a starting point. Kubernetes is a complex system; refer to the official documentation and tool-specific guides for detailed information.
+129-3
docs/python-usage.md
···11# Python Usage
2233-- [Python Usage](#python-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
33+This document provides a guide to setting up and using Python for development, focusing on version management with `pyenv`, and modern project/dependency management with tools like Poetry and `venv`.
44+55+## Overview
66+77+[Python](https://www.python.org/) is a versatile, high-level programming language. Effective Python development involves managing Python versions and project dependencies robustly.
88+99+## Python Version Management with `pyenv`
1010+1111+It is highly recommended to use [pyenv](https://github.com/pyenv/pyenv) to manage multiple Python versions.
1212+1313+### Installation of `pyenv`
1414+1515+* **Homebrew (macOS)**:
1616+ ```sh
1717+ brew install pyenv
1818+ ```
1919+* **Other Systems/Manual Install**: Follow the [official `pyenv` installation guide](https://github.com/pyenv/pyenv#installation).
52066-## TODO: Create documentation
2121+### `pyenv` Initialization
2222+2323+Add `pyenv` init to your shell configuration file (e.g., `.zshrc`), managed by `chezmoi`:
2424+```sh
2525+# Example for .zshrc
2626+# if command -v pyenv 1>/dev/null 2>&1; then
2727+# eval "$(pyenv init -)"
2828+# eval "$(pyenv virtualenv-init -)" # If using pyenv-virtualenv (optional)
2929+# fi
3030+```
3131+3232+### Installing Python Versions with `pyenv`
3333+3434+1. **List available Python versions**: `pyenv install --list`
3535+2. **Install a Python version**: `pyenv install <version>` (e.g., `pyenv install 3.10.4`)
3636+3. **Set Python version**:
3737+ * **Globally**: `pyenv global <version>`
3838+ * **Locally (per-project)**: `pyenv local <version>` (creates `.python-version`)
3939+ * **Shell specific**: `pyenv shell <version>`
4040+4141+## Project & Dependency Management
4242+4343+Isolating project dependencies is crucial.
4444+4545+### Option 1: Poetry (Recommended for New Projects)
4646+4747+[Poetry](https://python-poetry.org/) is a modern tool for Python dependency management and packaging. It helps you declare, manage, and install dependencies of Python projects, ensuring you have the right stack everywhere.
4848+4949+**Key Benefits of Poetry:**
5050+* **Dependency Resolution**: Advanced resolver for compatible dependencies.
5151+* **Unified Tool**: Manages project metadata, dependencies, virtual environments, building, and publishing.
5252+* **`pyproject.toml`**: Uses the standard `pyproject.toml` file to manage project information.
5353+* **Lock File**: Creates a `poetry.lock` file for deterministic builds.
5454+* **Virtual Environment Management**: Automatically creates and manages virtual environments for your projects.
5555+5656+**Installation of Poetry:**
5757+5858+Refer to the [official Poetry installation guide](https://python-poetry.org/docs/#installation). A common method is using their custom installer or `pipx`:
5959+```sh
6060+# Using pipx (recommended for CLI tools)
6161+brew install pipx # If not already installed
6262+pipx ensurepath
6363+pipx install poetry
6464+6565+# Or using the official installer
6666+# curl -sSL https://install.python-poetry.org | python3 -
6767+```
6868+6969+**Common Poetry Commands:**
7070+7171+* **`poetry new <project_name>`**: Creates a new Python project with a standard structure.
7272+* **`poetry init`**: Interactively creates a `pyproject.toml` in an existing project.
7373+* **`poetry install`**: Installs dependencies defined in `pyproject.toml` (and `poetry.lock`). If a virtual environment doesn't exist, Poetry creates one.
7474+* **`poetry add <package_name>`**: Adds a new dependency to `pyproject.toml` and installs it.
7575+ * `poetry add requests`
7676+ * `poetry add pytest --group dev` (for development dependencies)
7777+* **`poetry remove <package_name>`**: Removes a dependency.
7878+* **`poetry show`**: Lists all installed packages.
7979+* **`poetry update`**: Updates dependencies to their latest allowed versions according to `pyproject.toml` and updates `poetry.lock`.
8080+* **`poetry run <command>`**: Runs a command within the project's virtual environment.
8181+ * `poetry run python my_script.py`
8282+ * `poetry run pytest`
8383+* **`poetry shell`**: Activates the project's virtual environment in your current shell.
8484+* **`poetry build`**: Builds your project into a source archive (sdist) and a wheel (bdist_wheel).
8585+* **`poetry publish`**: Publishes your package to a repository like PyPI.
8686+8787+Poetry can be configured to use Python versions installed by `pyenv`:
8888+```sh
8989+poetry env use $(pyenv which python) # Or specify a path/version
9090+```
9191+9292+### Option 2: `venv` and `pip` (Traditional)
9393+9494+Python 3.3+ includes the `venv` module for creating virtual environments.
9595+9696+1. **Create a virtual environment**: `python -m venv .venv`
9797+2. **Activate**:
9898+ * Unix/macOS: `source .venv/bin/activate`
9999+ * Windows: `.\.venv\Scripts\activate.bat` or `.\.venv\Scripts\Activate.ps1`
100100+3. **Deactivate**: `deactivate`
101101+102102+**Package Management with `pip` (within an active `venv`)**:
103103+104104+* Install: `pip install <package_name>`, `pip install -r requirements.txt`
105105+* List: `pip list`
106106+* Generate `requirements.txt`: `pip freeze > requirements.txt`
107107+108108+### `pyenv-virtualenv` (Plugin for `pyenv`)
109109+110110+The [pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) plugin integrates `venv` management with `pyenv` if you prefer this workflow over Poetry's built-in virtual environment handling.
111111+112112+## Common Python Development Tools
113113+114114+Install these within your project's virtual environment (via `poetry add --group dev tool_name` or `pip install tool_name`) or globally via `pipx`.
115115+116116+* **Linters**: `flake8`, `pylint`
117117+* **Formatters**: `black`, `autopep8`, `isort`
118118+* **Test Runners**: `pytest`, `unittest` (built-in)
119119+* **`pipx`**: For installing and running Python CLI applications in isolated environments (`brew install pipx`).
120120+ * Example: `pipx install black`
121121+122122+## Resources
123123+124124+* **Official Python Documentation**: [https://docs.python.org/3/](https://docs.python.org/3/)
125125+* **`pyenv` GitHub Repository**: [https://github.com/pyenv/pyenv](https://github.com/pyenv/pyenv)
126126+* **Poetry Documentation**: [https://python-poetry.org/docs/](https://python-poetry.org/docs/)
127127+* **Python `venv` Documentation**: [https://docs.python.org/3/library/venv.html](https://docs.python.org/3/library/venv.html)
128128+* **`pip` Documentation**: [https://pip.pypa.io/](https://pip.pypa.io/)
129129+* **Python Packaging User Guide**: [https://packaging.python.org/](https://packaging.python.org/)
130130+* **`pipx`**: [https://pipx.pypa.io/](https://pipx.pypa.io/)
131131+132132+This document covers essentials for a modern Python development setup. Choose the tools that best fit your project needs.
+78-8
docs/system-usage.md
···11-# System Usage
11+# System Usage & OS-Specific Notes
22+33+This document outlines system-level configurations, OS-specific notes, and common utilities relevant to this dotfiles setup across different operating systems.
44+55+## Overview
66+77+These dotfiles aim to provide a consistent experience across macOS, Linux (primarily Ubuntu), and Windows (via WSL). `chezmoi` plays a crucial role in managing OS-specific configurations by using templates and conditional logic based on the operating system.
2833-- [System Usage](#system-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
99+## General Principles
1010+1111+* **`chezmoi` for OS Detection**: `chezmoi` templates often use variables like `.chezmoi.os` (e.g., "darwin", "linux", "windows") to apply OS-specific settings or install different packages.
1212+* **Homebrew/Linuxbrew**: Homebrew (on macOS) and Linuxbrew (on Linux) are heavily utilized for package management. See `Brewfile` or `chezmoi` scripts for lists of managed packages.
1313+* **Common Utilities**: Many command-line utilities are installed for enhanced productivity. Some common examples that might be included (and configured by these dotfiles) are:
1414+ * `exa` or `lsd` (modern `ls` replacements)
1515+ * `bat` (a `cat` clone with syntax highlighting)
1616+ * `fd` (a simple, fast, and user-friendly alternative to `find`)
1717+ * `ripgrep` (`rg`) (a line-oriented search tool that recursively searches your current directory for a regex pattern)
1818+ * `fzf` (a command-line fuzzy finder)
1919+ * `zoxide` (a smarter `cd` command)
2020+ * `htop` or `btop` (interactive process viewers)
52166-## TODO: Create documentation
2222+## macOS Specifics
72388-- macOS
99-- Ubutnu
1010-- Windows (Ubuntu WSL)
1111-- GitHub Codespaces
2424+* **Package Manager**: [Homebrew](https://brew.sh/) is the primary package manager.
2525+* **Shell**: Zsh, configured via `oh-my-zsh` and `oh-my-posh` (see `docs/terminal-usage.md`).
2626+* **Finder Tweaks**: Your `chezmoi` setup might include scripts to apply common Finder settings (e.g., show hidden files, show path bar).
2727+ * Example commands (often found in `run_once_` scripts):
2828+ ```sh
2929+ # Show hidden files
3030+ # defaults write com.apple.finder AppleShowAllFiles -bool true
3131+ # Show path bar
3232+ # defaults write com.apple.finder ShowPathbar -bool true
3333+ # Restart Finder to apply changes
3434+ # killall Finder
3535+ ```
3636+* **Keyboard Shortcuts/Remapping**: Tools like Karabiner-Elements might be used for advanced keyboard customization (if included in your setup).
3737+* **Spotlight**: Useful for launching applications and finding files (`Cmd+Space`).
3838+* **System Updates**: `sudo softwareupdate -i -a`
3939+4040+## Linux (Ubuntu Focus)
4141+4242+* **Package Manager**: `apt` is the system package manager. [Linuxbrew](https://docs.brew.sh/Homebrew-on-Linux) might also be used for user-space packages.
4343+* **Shell**: Zsh, configured via `oh-my-zsh` and `oh-my-posh` (see `docs/terminal-usage.md`).
4444+* **System Updates**:
4545+ ```sh
4646+ sudo apt update && sudo apt upgrade -y
4747+ sudo apt autoremove -y # To remove unused packages
4848+ ```
4949+* **Firewall**: `ufw` (Uncomplicated Firewall) is commonly used.
5050+ ```sh
5151+ # sudo ufw status
5252+ # sudo ufw enable
5353+ # sudo ufw allow ssh
5454+ ```
5555+5656+## Windows (via WSL - Windows Subsystem for Linux)
5757+5858+* **WSL Version**: It's recommended to use WSL 2 for better performance and system call compatibility.
5959+* **Distribution**: Typically Ubuntu is used within WSL, so many Linux notes apply.
6060+* **Accessing Windows Files**: Windows drives are typically mounted under `/mnt/` (e.g., `/mnt/c`).
6161+* **Windows Terminal**: Recommended for a better WSL experience.
6262+* **Interoperability**: You can run Windows executables from WSL and Linux executables from Windows (PowerShell/CMD).
6363+* **Docker Desktop with WSL Backend**: Often used for Docker development on Windows.
6464+6565+## GitHub Codespaces
6666+6767+GitHub Codespaces typically run a Linux environment (often Ubuntu-based).
6868+* **Dotfiles Integration**: Your dotfiles can be automatically installed into Codespaces if configured in your GitHub settings.
6969+* **`devcontainer.json`**: Projects can define specific configurations for Codespaces using a `devcontainer.json` file, which can include features, extensions, and post-create commands.
7070+* The environment is largely Linux-based, so Linux configurations from your dotfiles will apply.
7171+7272+## Resources
7373+7474+* **macOS User Guide**: [https://support.apple.com/guide/mac-help/welcome/mac](https://support.apple.com/guide/mac-help/welcome/mac)
7575+* **Ubuntu Server Guide / Desktop Guide**: [https://ubuntu.com/server/docs](https://ubuntu.com/server/docs), [https://ubuntu.com/desktop/docs](https://ubuntu.com/desktop/docs)
7676+* **Windows Subsystem for Linux (WSL) Documentation**: [https://docs.microsoft.com/en-us/windows/wsl/](https://docs.microsoft.com/en-us/windows/wsl/)
7777+* **Chezmoi Documentation (OS specific logic)**: [https://www.chezmoi.io/user-guide/templating/#variables](https://www.chezmoi.io/user-guide/templating/#variables)
7878+* **Homebrew**: [https://brew.sh/](https://brew.sh/)
7979+* **Linuxbrew**: [https://docs.brew.sh/Homebrew-on-Linux](https://docs.brew.sh/Homebrew-on-Linux)
8080+8181+This document provides a high-level overview. Specific configurations and scripts are managed by `chezmoi` and can be found within the repository.
+97-15
docs/terminal-usage.md
···11-# Terminal Usage
11+# Terminal Setup and Usage
2233-- [Terminal Usage](#terminal-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
33+This document describes the terminal environment setup, including the shell, prompt, terminal emulators, and related tools used in this dotfiles configuration.
5466-## TODO: Create documentation
55+## Overview
7688-- iTerm
77+A customized and efficient terminal setup is crucial for productivity. This setup primarily revolves around Zsh, Oh My Zsh, Powerlevel10k/Oh My Posh for the prompt, and iTerm2 on macOS.
981010-Back up and restore iTerm configuration settings.
99+## Terminal Emulator
11101212-```shell
1313-defaults export com.googlecode.iterm2 assets/iterm2/com.googlecode.iterm2.plist
1414-plutil -convert xml1 -o assets/iterm2/com.googlecode.iterm2.xml assets/iterm2/com.googlecode.iterm2.plist
1515-cp assets/iterm2/com.googlecode.iterm2.xml assets/iterm2/settings.xml
1616-# Format `assets/iterm2/settings.xml` in vscode
1717-defaults import com.googlecode.iterm2 assets/iterm2/settings.xml
1818-```
1111+### iTerm2 (macOS)
19122020-- Oh-My-Zsh
2121-- Powerlevel10k
1313+[iTerm2](https://iterm2.com/) is a popular replacement for Apple's Terminal on macOS. It offers a wide range of features, including split panes, profiles, triggers, and extensive customization options.
1414+1515+**Configuration Management with `chezmoi`**:
1616+1717+iTerm2 settings are stored in a `.plist` file, typically `~/Library/Preferences/com.googlecode.iterm2.plist`.
1818+Your `chezmoi` setup might manage this file or a human-readable version (e.g., XML) of it.
1919+2020+The commands previously noted for backup/restore can be adapted for `chezmoi`:
2121+1. **Exporting current iTerm2 settings to XML (for `chezmoi` source directory)**:
2222+ ```sh
2323+ # Ensure the target directory in your chezmoi source exists, e.g., private_dot_config/iterm2/
2424+ TARGET_XML="$HOME/.local/share/chezmoi/private_dot_config/iterm2/com.googlecode.iterm2.plist.xml" # Adjust path as needed
2525+ TEMP_PLIST=$(mktemp)
2626+ defaults export com.googlecode.iterm2 "$TEMP_PLIST"
2727+ plutil -convert xml1 -o "$TARGET_XML" "$TEMP_PLIST"
2828+ rm "$TEMP_PLIST"
2929+ echo "iTerm2 config exported to $TARGET_XML. Run 'chezmoi add private_dot_config/iterm2/com.googlecode.iterm2.plist.xml' if new."
3030+ ```
3131+ Then, format `$TARGET_XML` if desired and `chezmoi add` / `chezmoi apply`.
3232+3333+2. **Importing settings from `chezmoi` (managed by `chezmoi apply`)**:
3434+ If `chezmoi` manages an XML version, it might use a `run_script_` or template to convert it back to binary plist and import using `defaults import com.googlecode.iterm2 /path/to/your/plist/from/chezmoi` or directly manage the binary plist if `chezmoi`'s templating/symlinking handles it.
3535+3636+* **Official Website**: [https://iterm2.com/](https://iterm2.com/)
3737+3838+### Other Terminal Emulators (Windows Terminal, Alacritty, etc.)
3939+For Linux and Windows (WSL), other terminal emulators like Windows Terminal, Alacritty, Kitty, etc., can be used. Configuration for these would be managed by `chezmoi` as well, typically by templating their respective configuration files.
4040+4141+## Shell: Zsh (Z Shell)
4242+4343+[Zsh](https://www.zsh.org/) is a powerful shell with numerous features, including improved tab completion, command history, and customization options.
4444+4545+## Zsh Framework: Oh My Zsh
4646+4747+[Oh My Zsh](https://ohmyz.sh/) is an open-source, community-driven framework for managing your Zsh configuration. It comes bundled with thousands of helpful functions, helpers, plugins, and themes.
4848+4949+* **Installation**: Typically managed by `chezmoi` as part of the initial setup.
5050+* **Plugins**: Enhance functionality (e.g., `git`, `zsh-autosuggestions`, `zsh-syntax-highlighting`). Your `.zshrc` (managed by `chezmoi`) will list enabled plugins.
5151+* **Themes**: Oh My Zsh offers many themes, but this setup often uses a more specialized prompt theme engine like Powerlevel10k or Oh My Posh.
5252+* **Official Website**: [https://ohmyz.sh/](https://ohmyz.sh/)
5353+* **GitHub**: [https://github.com/ohmyzsh/ohmyzsh](https://github.com/ohmyzsh/ohmyzsh)
5454+5555+## Shell Prompt
5656+5757+A highly customized and informative prompt is key for an efficient workflow.
5858+5959+### Powerlevel10k (p10k)
6060+6161+[Powerlevel10k](https://github.com/romkatv/powerlevel10k) is a theme for Zsh. It emphasizes speed, flexibility, and an out-of-the-box awesome experience. It's known for its configuration wizard that helps you tailor the prompt to your liking.
6262+6363+* **Installation**: Often installed as a theme for Oh My Zsh.
6464+* **Configuration**: Run `p10k configure` to go through the setup wizard. The resulting configuration (`~/.p10k.zsh`) is typically managed by `chezmoi`.
6565+* **Requires**: A Nerd Font or a font patched with Powerline symbols for icons to display correctly.
6666+* **GitHub**: [https://github.com/romkatv/powerlevel10k](https://github.com/romkatv/powerlevel10k)
6767+6868+### Oh My Posh
6969+7070+[Oh My Posh](https://ohmyposh.dev/) is a custom prompt engine for any shell that has the ability to adjust the prompt string with a function or variable. It allows for finely tuned, themeable prompts.
7171+7272+* **Installation**: Typically installed via Homebrew or other package managers.
7373+* **Configuration**: Defined by a JSON, TOML, or YAML theme file (e.g., `~/.config/omp.json` or similar, path defined in `.zshrc`). This theme file is managed by `chezmoi`.
7474+* **Requires**: A Nerd Font for icons.
7575+* **Official Website**: [https://ohmyposh.dev/](https://ohmyposh.dev/)
7676+7777+*(Note: Your setup might use Powerlevel10k directly or use Oh My Posh with a p10k-like theme or another custom theme. Clarify which is primary if necessary in your `.zshrc` or this doc.)*
7878+7979+## Terminal Multiplexer: `tmux` (If Used)
8080+8181+If [tmux](https://github.com/tmux/tmux/wiki) is part of your setup for managing multiple terminal sessions:
8282+* **Configuration**: `~/.tmux.conf` (managed by `chezmoi`).
8383+* **Plugin Manager**: [TPM (Tmux Plugin Manager)](https://github.com/tmux-plugins/tpm) might be used.
8484+* **Keybindings**: Custom keybindings would be defined in `.tmux.conf`.
8585+8686+## Key Fonts (Nerd Fonts)
8787+8888+For icons and special symbols in prompts (Powerlevel10k, Oh My Posh) and other terminal applications (e.g., `lsd`, `bat`), [Nerd Fonts](https://www.nerdfonts.com/) are commonly used. These are popular programming fonts patched with a high number of glyphs (icons).
8989+9090+* **Installation**: Download from Nerd Fonts website or install via Homebrew Cask (e.g., `brew tap homebrew/cask-fonts && brew install --cask font-hack-nerd-font`).
9191+* Ensure your terminal emulator (iTerm2, etc.) is configured to use a Nerd Font.
9292+9393+## Resources
9494+9595+* **iTerm2**: [https://iterm2.com/](https://iterm2.com/)
9696+* **Zsh**: [https://www.zsh.org/](https://www.zsh.org/)
9797+* **Oh My Zsh**: [https://ohmyz.sh/](https://ohmyz.sh/)
9898+* **Powerlevel10k**: [https://github.com/romkatv/powerlevel10k](https://github.com/romkatv/powerlevel10k)
9999+* **Oh My Posh**: [https://ohmyposh.dev/](https://ohmyposh.dev/)
100100+* **Nerd Fonts**: [https://www.nerdfonts.com/](https://www.nerdfonts.com/)
101101+* **tmux**: [https://github.com/tmux/tmux/wiki](https://github.com/tmux/tmux/wiki)
102102+103103+This document outlines the core components of the terminal setup. Specific configurations are managed by `chezmoi`.
+121-9
docs/terraform-usage.md
···11# Terraform Usage
2233-- [Terraform Usage](#terraform-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
33+This document provides a guide to using Terraform for managing infrastructure as code, including version management with `tfenv`.
44+55+## Overview
66+77+[Terraform](https://www.terraform.io/) is an open-source infrastructure as code (IaC) software tool that enables you to safely and predictably create, change, and improve infrastructure. It codifies APIs into declarative configuration files.
88+99+[tfenv](https://github.com/tfutils/tfenv) is a Terraform version manager, allowing you to easily switch between different versions of Terraform on a per-project basis.
1010+1111+## Installation
51266-## TODO: Create documentation
1313+### `tfenv` (Terraform Version Manager)
71488-- Package tfswitch
1515+It's recommended to install `tfenv` first to manage your Terraform versions.
9161010-```shell
1111-tfswitch -l
1212-tfswitch 1.0.0
1313-terraform --version
1414-which terraform
1717+**Installation (macOS with Homebrew):**
1818+```sh
1919+brew install tfenv
1520```
2121+For other installation methods (e.g., Git clone), refer to the [tfenv installation guide](https://github.com/tfutils/tfenv#installation).
2222+2323+**Post-installation:**
2424+Ensure `tfenv` is added to your shell's PATH. If installed via Homebrew, this is usually handled automatically. Otherwise, you might need to add `$(brew --prefix tfenv)/bin` (or the equivalent for your installation method) to your PATH.
2525+2626+### Terraform (via `tfenv`)
2727+2828+Once `tfenv` is installed, you can install specific Terraform versions:
2929+3030+1. **List available Terraform versions**:
3131+ ```sh
3232+ tfenv list-remote
3333+ ```
3434+3535+2. **Install a specific version**:
3636+ ```sh
3737+ tfenv install <version>
3838+ # Example: tfenv install 1.0.0
3939+ ```
4040+ To install the latest stable version:
4141+ ```sh
4242+ tfenv install latest
4343+ ```
4444+4545+3. **Select a Terraform version to use**:
4646+ * **Globally**:
4747+ ```sh
4848+ tfenv use <version>
4949+ # Example: tfenv use 1.0.0
5050+ ```
5151+ * **Per project (recommended)**: Create a `.terraform-version` file in your project's root directory containing the desired version number:
5252+ ```
5353+ # .terraform-version
5454+ 1.0.0
5555+ ```
5656+ `tfenv` will automatically pick up this version when you `cd` into the directory.
5757+5858+4. **Verify installation**:
5959+ ```sh
6060+ terraform --version
6161+ which terraform # Should point to a tfenv shim
6262+ ```
6363+6464+## Basic Terraform Workflow
6565+6666+Terraform commands are typically run within a directory containing your `.tf` configuration files.
6767+6868+1. **`terraform init`**: Initializes a working directory containing Terraform configuration files. This is the first command that should be run after writing a new Terraform configuration or cloning an existing one.
6969+ ```sh
7070+ terraform init
7171+ ```
7272+ This command also initializes backend configuration (for state storage) and downloads provider plugins.
7373+7474+2. **`terraform plan`**: Creates an execution plan. Terraform performs a refresh, unless explicitly disabled, and then determines what actions are necessary to achieve the desired state specified in the configuration files.
7575+ ```sh
7676+ terraform plan
7777+ # Save the plan to a file:
7878+ # terraform plan -out=tfplan
7979+ ```
8080+ This is a good way to check whether the proposed changes match your expectations before applying them.
8181+8282+3. **`terraform apply`**: Applies the changes required to reach the desired state of the configuration, or the pre-determined changes if a plan file is provided.
8383+ ```sh
8484+ terraform apply
8585+ # Apply a saved plan (prompts for confirmation):
8686+ # terraform apply tfplan
8787+ # Auto-approve (use with caution):
8888+ # terraform apply -auto-approve
8989+ # Or apply a saved plan without prompting:
9090+ # terraform apply -auto-approve tfplan
9191+ ```
9292+9393+4. **`terraform destroy`**: Destroys all remote objects managed by a particular Terraform configuration.
9494+ ```sh
9595+ terraform destroy
9696+ ```
9797+ Use with extreme caution, as this will remove your managed infrastructure.
9898+9999+## Common Terraform Commands
100100+101101+* **`terraform fmt`**: Rewrites Terraform configuration files to a canonical format and style.
102102+ ```sh
103103+ terraform fmt
104104+ # Check for formatting issues: terraform fmt -check
105105+ ```
106106+* **`terraform validate`**: Validates the syntax and arguments of configuration files.
107107+ ```sh
108108+ terraform validate
109109+ ```
110110+* **`terraform output`**: Reads an output variable from a Terraform state file.
111111+ ```sh
112112+ terraform output <output_variable_name>
113113+ ```
114114+* **`terraform state list`**: Lists resources within a Terraform state file.
115115+ ```sh
116116+ terraform state list
117117+ ```
118118+* **`terraform workspace list/select/new/delete`**: Manages Terraform workspaces for different environments (e.g., dev, staging, prod).
119119+120120+## Resources
121121+122122+* **Official Terraform Documentation**: [https://developer.hashicorp.com/terraform/docs](https://developer.hashicorp.com/terraform/docs)
123123+* **Terraform CLI Commands**: [https://developer.hashicorp.com/terraform/cli/commands](https://developer.hashicorp.com/terraform/cli/commands)
124124+* **`tfenv` GitHub Repository**: [https://github.com/tfutils/tfenv](https://github.com/tfutils/tfenv)
125125+* **Terraform Registry (Providers & Modules)**: [https://registry.terraform.io/](https://registry.terraform.io/)
126126+127127+This document provides fundamental guidance. Terraform is a comprehensive tool; always refer to the official documentation for detailed information and best practices.
+83-4
docs/user-apps-usage.md
···11-# User Apps Usage
11+# User Applications Usage
22+33+This document lists common user (GUI) applications that are part of this development and productivity setup. It also notes if and how their configurations might be managed by `chezmoi`.
44+55+## Overview
66+77+While `chezmoi` excels at managing command-line tool configurations (dotfiles), it can also help manage settings for some GUI applications, typically by symlinking or templating their preference files (e.g., `.plist` files on macOS, JSON/XML configs).
88+99+Many applications are installed via Homebrew Cask on macOS. Check your `Brewfile` (if used with `chezmoi`) or `chezmoi` installation scripts for a list of managed applications.
1010+1111+## Common Application Categories & Examples
1212+1313+Below are categories and examples of applications that might be part of your setup. Add your specific applications to these lists.
1414+1515+### Web Browsers
1616+1717+* **[Google Chrome](https://www.google.com/chrome/)**
1818+ * **Installation**: Homebrew Cask (`brew install --cask google-chrome`) or manual download.
1919+ * **Configuration**: User profile settings are complex to manage directly with dotfiles. Consider using Chrome's built-in sync feature.
2020+* **[Mozilla Firefox](https://www.mozilla.org/firefox/)**
2121+ * **Installation**: Homebrew Cask (`brew install --cask firefox`) or manual download.
2222+ * **Configuration**: Profile-based. Some `user.js` customizations can be managed.
2323+* **[Safari](https://www.apple.com/safari/) (macOS)**
2424+ * **Installation**: Comes with macOS.
2525+ * **Configuration**: Some `.plist` files in `~/Library/Preferences/` or `~/Library/Containers/com.apple.Safari/Data/Library/Preferences/` might be manageable, but can be complex.
2626+2727+### Productivity Tools
2828+2929+* **[Rectangle](https://rectangleapp.com/) (macOS Window Manager)**
3030+ * **Installation**: Homebrew Cask (`brew install --cask rectangle`) or manual download.
3131+ * **Configuration**: Preferences (`~/Library/Preferences/com.knollsoft.Rectangle.plist`) can often be managed by `chezmoi`.
3232+* **[Alfred](https://www.alfredapp.com/) (macOS Launcher & Productivity)**
3333+ * **Installation**: Homebrew Cask (`brew install --cask alfred`) or manual download.
3434+ * **Configuration**: Alfred preferences can be synced to a folder (e.g., Dropbox, iCloud Drive), and `chezmoi` could potentially manage a symlink to this sync folder or specific non-sensitive parts of its config if exported.
3535+* **[Obsidian](https://obsidian.md/) (Knowledge Base/Notes)**
3636+ * **Installation**: Homebrew Cask (`brew install --cask obsidian`) or manual download.
3737+ * **Configuration**: Vaults are user-managed. Some global configuration files might be linkable.
3838+* **Password Manager (GUI)**
3939+ * **1Password**: (Covered in `docs/1password-usage.md` for CLI, GUI is complementary)
4040+ * **Installation**: Download from [1Password website](https://1password.com/downloads/).
4141+4242+### Development Tools (GUI)
4343+4444+* **[Visual Studio Code](https://code.visualstudio.com/)**: (Covered in detail in `docs/vscode-usage.md`)
4545+* **[Docker Desktop](https://www.docker.com/products/docker-desktop/)**: (Covered in `docs/docker-usage.md`)
4646+* **Database GUI Clients** (e.g., TablePlus, DBeaver, pgAdmin)
4747+ * **Example: [TablePlus](https://tableplus.com/)**
4848+ * **Installation**: Homebrew Cask (`brew install --cask tableplus`) or manual download.
4949+ * **Configuration**: Connection details are typically managed within the app; general preferences might be in a `.plist` file.
5050+* **API Clients** (e.g., Postman, Insomnia)
5151+ * **Example: [Postman](https://www.postman.com/)**
5252+ * **Installation**: Homebrew Cask (`brew install --cask postman`) or manual download.
5353+ * **Configuration**: Typically uses cloud sync for collections and environments.
5454+5555+### Communication
5656+5757+* **[Slack](https://slack.com/)**
5858+ * **Installation**: Homebrew Cask (`brew install --cask slack`) or manual download.
5959+* **[Zoom](https://zoom.us/)**
6060+ * **Installation**: Homebrew Cask (`brew install --cask zoom`) or manual download.
6161+6262+### Other Utilities
6363+6464+* **[Spotify](https://www.spotify.com/)**
6565+ * **Installation**: Homebrew Cask (`brew install --cask spotify`) or manual download.
6666+* **[VLC Media Player](https://www.videolan.org/vlc/)**
6767+ * **Installation**: Homebrew Cask (`brew install --cask vlc`) or manual download.
6868+6969+## Managing Application Settings with `chezmoi`
7070+7171+If an application stores its settings in a known file path (e.g., a `.plist` file in `~/Library/Preferences/` on macOS, or a JSON/INI/XML file in `~/.config/AppName/` on Linux), `chezmoi` can manage it:
7272+7373+1. **Identify the configuration file**.
7474+2. **Copy it to your `chezmoi` source directory** (e.g., as `private_Library/Preferences/com.example.app.plist` for macOS, or `dot_config/AppName/settings.json`).
7575+3. **Add it to `chezmoi`**: `chezmoi add ~/Library/Preferences/com.example.app.plist` (using the original path).
7676+4. `chezmoi` will then create a symlink from the target path to your source directory version, or apply it as a template.
7777+7878+**Caution**: Some applications do not like their preference files being symlinked or modified externally while they are running. Test thoroughly.
27933-- [User Apps Usage](#user-apps-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
8080+## Resources
58166-## TODO: Create documentation
8282+* **Homebrew Casks**: [https://formulae.brew.sh/cask/](https://formulae.brew.sh/cask/) (Find package names for Homebrew Cask installations)
8383+* **`chezmoi` Documentation**: [https://www.chezmoi.io/](https://www.chezmoi.io/)
8484+8585+This document is a template. Please populate it with the specific applications you use and how you manage their installation and configuration.
+72-8
docs/vscode-usage.md
···11# Visual Studio Code Usage
2233-- [Visual Studio Code Usage](#visual-studio-code-usage)
44- - [TODO: Create documentation](#todo-create-documentation)
33+This document provides an overview of using Visual Studio Code (VS Code), including setup, key features, and customization relevant to this dotfiles environment.
5466-## TODO: Create documentation
55+## Overview
7688-- Configuration
99- - Extensions
1010- - Settings
1111- - Key bindings
1212-- GitHub Codespaces
77+[Visual Studio Code](https://code.visualstudio.com/) is a lightweight but powerful source code editor that runs on your desktop and is available for Windows, macOS, and Linux. It comes with built-in support for JavaScript, TypeScript, and Node.js and has a rich ecosystem of extensions for other languages and runtimes (such as C++, C#, Java, Python, PHP, Go) and tools (like Docker, Git, and various linters).
88+99+## Installation
1010+1111+* **Download**: Download VS Code from the [official website](https://code.visualstudio.com/download).
1212+* **Package Managers**:
1313+ * **macOS (Homebrew)**: `brew install --cask visual-studio-code`
1414+ * **Linux**: Refer to [VS Code Linux documentation](https://code.visualstudio.com/docs/setup/linux) for instructions for your distribution.
1515+1616+Installation might be managed by `chezmoi` if VS Code is part of your standard toolset defined in your dotfiles.
1717+1818+Launch VS Code and open a terminal within it (`View > Terminal` or ``Ctrl+` ``) to use the `code` command-line interface for opening files and folders.
1919+2020+## Key Features & Customization
2121+2222+### Command Palette
2323+Access all available commands based on your current context by pressing `Ctrl+Shift+P` (Windows/Linux) or `Cmd+Shift+P` (macOS).
2424+2525+### Extensions
2626+VS Code extensions let you add languages, debuggers, and tools to your installation to support your development workflow.
2727+* **Browse and Install**: Access the Extensions view by clicking on the Extensions icon in the Activity Bar on the side of VS Code or `Ctrl+Shift+X` / `Cmd+Shift+X`.
2828+* **Recommended Extensions**: VS Code often suggests extensions based on the files you open. You can also find popular extensions for your languages and frameworks in the Marketplace.
2929+* **Managing Extensions**: You can list your installed extensions from the command line:
3030+ ```sh
3131+ code --list-extensions
3232+ ```
3333+ To install an extension from the command line:
3434+ ```sh
3535+ code --install-extension <extension-id>
3636+ ```
3737+ Your `chezmoi` setup might manage a list of extensions to be installed automatically.
3838+3939+### Settings
4040+Customize VS Code to your liking through its settings.
4141+* **UI**: Open settings via `File > Preferences > Settings` (`Code > Preferences > Settings` on macOS) or `Ctrl+,` / `Cmd+,`.
4242+* **JSON**: For more advanced configuration and to manage settings as code, you can edit the `settings.json` file directly. Access it via the Command Palette (`Ctrl+Shift+P` / `Cmd+Shift+P`) by typing "Preferences: Open User Settings (JSON)".
4343+* **Workspace Settings**: You can also define settings specific to a project/workspace by creating a `.vscode/settings.json` file in your project root.
4444+* Your `chezmoi` setup likely manages your global `settings.json` file.
4545+4646+### Settings Sync
4747+VS Code has built-in Settings Sync, which allows you to share your VS Code configurations—such as settings, keybindings, and installed extensions—across your different machines using a GitHub or Microsoft account.
4848+* **Enable/Disable**: Turn on Settings Sync from the Manage gear icon at the bottom of the Activity Bar, then "Turn on Settings Sync...".
4949+5050+### Keybindings
5151+Customize keyboard shortcuts in VS Code.
5252+* **UI**: `File > Preferences > Keyboard Shortcuts` (`Code > Preferences > Keyboard Shortcuts` on macOS) or `Ctrl+K Ctrl+S` / `Cmd+K Cmd+S`.
5353+* **JSON**: For advanced customization, edit `keybindings.json`. Access it via the Command Palette with "Preferences: Open Keyboard Shortcuts (JSON)".
5454+* Your `chezmoi` setup might manage your `keybindings.json`.
5555+5656+### Integrated Terminal
5757+VS Code has an integrated terminal (`View > Terminal` or `` Ctrl+` ``) so you can run shell commands directly within the editor.
5858+5959+## GitHub Codespaces
6060+6161+[GitHub Codespaces](https://github.com/features/codespaces) provides cloud-powered development environments. You can use VS Code (desktop or web) to connect to a Codespace, giving you a fully configured development environment in the cloud, often based on a `devcontainer.json` configuration in your repository (see `docs/docker-usage.md` for more on Dev Containers).
6262+6363+### Benefits:
6464+* **Pre-configured environments**: Start coding immediately with environments tailored for your project.
6565+* **Access from anywhere**: Develop from any machine with a browser or VS Code.
6666+* **Consistent setup**: Ensures consistency across team members.
6767+6868+## Resources
6969+7070+* **Official VS Code Documentation**: [https://code.visualstudio.com/docs](https://code.visualstudio.com/docs)
7171+* **Introductory Videos**: [https://code.visualstudio.com/docs/getstarted/introvideos](https://code.visualstudio.com/docs/getstarted/introvideos)
7272+* **VS Code Extension Marketplace**: [https://marketplace.visualstudio.com/vscode](https://marketplace.visualstudio.com/vscode)
7373+* **Settings Sync Guide**: [https://code.visualstudio.com/docs/editor/settings-sync](https://code.visualstudio.com/docs/editor/settings-sync)
7474+* **GitHub Codespaces Documentation**: [https://docs.github.com/en/codespaces](https://docs.github.com/en/codespaces)
7575+7676+This document covers the basics. VS Code is highly extensible and configurable; explore the official documentation to tailor it to your workflow.