Skip to content

pirpedro/features

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Development Environment Features

A curated collection of high-quality dev container Features designed to enhance your development workflow. These features provide seamless integration of essential development tools into your containerized environments.

✨ Features Overview

This repository contains a collection of 4 specialized Features that work together to create a powerful development environment. Each feature is designed with best practices, proper error handling, and cross-platform compatibility.

🐚 antidote - Supercharged Zsh with Plugin Management

Transform your shell experience with Antidote, a fast and modern Zsh plugin manager that provides autosuggestions, syntax highlighting, and enhanced completions out of the box.

What it includes:

  • πŸš€ Antidote plugin manager - Fast, static bundle generation for optimal performance
  • πŸ’‘ Smart autosuggestions - Fish-like command suggestions as you type
  • 🎨 Syntax highlighting - Real-time command validation and colorization
  • πŸ“š Enhanced completions - Rich tab completions for better productivity
  • πŸ“‚ Directory jumping - Quick navigation with z command
  • βš™οΈ Optimized configuration - Sensible defaults for history and shell behavior
{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/pirpedro/features/antidote:1": {
      "setAsDefaultShell": true
    }
  }
}

Dependencies: Requires common-utils (with zsh) and git features.

πŸ“ chezmoi - Dotfiles Management Made Easy

Seamlessly manage your dotfiles across different environments with chezmoi, ensuring consistent development setups everywhere.

What it provides:

  • πŸ”§ Automated dotfiles sync - Initialize from any Git repository
  • 🌿 Branch support - Use specific branches for different environments
  • ⚑ One-command setup - Automatic init and apply functionality
  • πŸ›‘οΈ Safe execution - Runs in proper user context with secure PATH handling
  • 🏠 Cross-platform - Works on Alpine, Ubuntu, Debian, and more
{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/pirpedro/features/chezmoi:1": {
      "repoUrl": "https://github.com/yourusername/dotfiles",
      "branch": "main",
      "apply": true,
      "useLoginShell": true
    }
  }
}

Quick setup without repository:

{
  "features": {
    "ghcr.io/pirpedro/features/chezmoi:1": {}
  }
}

Dependencies: Requires common-utils and git features.

πŸ”§ dev-gadgets - Enhanced Git Workflow Tools

Essential Git utilities and SSH client setup for seamless repository management and secure connections.

What it includes:

  • πŸ” SSH client - Properly configured for Git over SSH
  • πŸ“ SSH directory setup - Secure ~/.ssh with correct permissions
  • 🌍 Cross-platform support - Works on Alpine, Debian/Ubuntu, and RHEL-based systems
  • ⚑ Automatic detection - Smart OS detection with fallback mechanisms
{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/pirpedro/features/dev-gadgets:1": {}
  }
}

Dependencies: Requires common-utils and git features.

πŸ—οΈ Complete Development Setup

For the ultimate development environment, combine all features:

{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/devcontainers/features/common-utils:2": {
      "installZsh": true,
      "username": "vscode",
      "userUid": "1000",
      "userGid": "1000"
    },
    "ghcr.io/devcontainers/features/git:1": {},
    "ghcr.io/pirpedro/features/dev-gadgets:1": {},
    "ghcr.io/pirpedro/features/chezmoi:1": {
      "repoUrl": "https://github.com/yourusername/dotfiles",
      "apply": true
    },
    "ghcr.io/pirpedro/features/antidote:1": {
      "setAsDefaultShell": true
    }
  }
}

This setup provides:

  • βœ… Modern Zsh with plugins and enhancements
  • βœ… Automated dotfiles management
  • βœ… Enhanced Git workflow tools
  • βœ… Secure SSH configuration
  • βœ… Optimized shell experience

πŸ“ Repository Structure

This repository follows the standard dev container Features distribution specification. Each Feature is self-contained in its own directory with proper configuration and installation scripts.

β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ antidote/              # Zsh plugin manager
β”‚   β”‚   β”œβ”€β”€ devcontainer-feature.json
β”‚   β”‚   └── install.sh
β”‚   β”œβ”€β”€ chezmoi/               # Dotfiles management
β”‚   β”‚   β”œβ”€β”€ devcontainer-feature.json
β”‚   β”‚   └── install.sh
β”‚   β”œβ”€β”€ dev-gadgets/           # Git workflow enhancements
β”‚   β”‚   β”œβ”€β”€ devcontainer-feature.json
β”‚   β”‚   └── install.sh
β”œβ”€β”€ test/                      # Feature testing
β”‚   β”œβ”€β”€ antidote/
β”‚   β”œβ”€β”€ chezmoi/
β”‚   └── dev-gadgets/
└── .github/workflows/         # CI/CD automation
    └── release.yaml

πŸ”§ Feature Development

Each feature includes:

  • πŸ“‹ Configuration - devcontainer-feature.json with options and metadata
  • βš™οΈ Installation - install.sh with cross-platform support and error handling
  • πŸ§ͺ Tests - Comprehensive testing across multiple Linux distributions
  • πŸ“– Documentation - Clear usage examples and option descriptions

πŸš€ Key Design Principles

  • πŸ”— Dependency Management - Proper installsAfter declarations
  • πŸ›‘οΈ Error Handling - Graceful failures with helpful error messages
  • 🌍 Cross-Platform - Support for Alpine, Ubuntu, Debian, and RHEL-based systems
  • πŸ‘€ User Safety - Proper user context and permission handling
  • ⚑ Performance - Optimized installations and static configurations

Options

All available options for a Feature should be declared in the devcontainer-feature.json. The syntax for the options property can be found in the devcontainer Feature json properties reference.

For example, the color feature provides an enum of three possible options (red, gold, green). If no option is provided in a user's devcontainer.json, the value is set to "red".

{
  // ...
  "options": {
    "favorite": {
      "type": "string",
      "enum": ["red", "gold", "green"],
      "default": "red",
      "description": "Choose your favorite color."
    }
  }
}

Options are exported as Feature-scoped environment variables. The option name is captialized and sanitized according to option resolution.

#!/bin/bash

echo "Activating feature 'color'"
echo "The provided favorite color is: ${FAVORITE}"

...

πŸ“¦ Using These Features

🌐 Public Registry

Features are automatically published to GitHub Container Registry (GHCR) and can be referenced in your devcontainer.json:

{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/pirpedro/features/antidote:1": {},
    "ghcr.io/pirpedro/features/chezmoi:1": {},
    "ghcr.io/pirpedro/features/dev-gadgets:1": {}
  }
}

πŸ“‹ Feature Reference

Feature Description Key Benefits
antidote Zsh plugin manager Fast shell, autosuggestions, syntax highlighting
chezmoi Dotfiles management Consistent dev environments, automated setup
dev-gadgets Git workflow tools SSH support, enhanced Git functionality

πŸ”„ Versioning & Updates

Features follow semantic versioning. Pin to major versions for stability:

{
  "features": {
    "ghcr.io/pirpedro/features/antidote:1": {}, // Stable
    "ghcr.io/pirpedro/features/antidote:1.2": {}, // Specific minor
    "ghcr.io/pirpedro/features/antidote:1.2.3": {} // Exact version
  }
}

πŸ§ͺ Development & Testing

Running Tests

Test your features locally using the dev container CLI:

# Test individual features
devcontainer features test --features antidote
devcontainer features test --features chezmoi
devcontainer features test --features dev-gadgets

# Test with scenarios (includes dependencies)
devcontainer features test --features antidote --skip-autogenerated

πŸ› οΈ Contributing

  1. Fork this repository
  2. Create a feature branch: git checkout -b feature/awesome-feature
  3. Add tests in test/your-feature/
  4. Test locally with multiple distributions
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments


Made with ❀️ for the dev container community

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages