UNPKG

@jalasem/dss

Version:

Dev Spaces Switcher (DSS) - Seamlessly manage isolated development environments with separate SSH keys and Git configurations. Enhanced UI with beautiful tables and improved documentation.

349 lines (252 loc) โ€ข 7.84 kB
<div align="center"> # ๐Ÿš€ Dev Spaces Switcher (DSS) *Seamlessly manage isolated development environments with separate SSH keys and Git configurations* [![npm version](https://badge.fury.io/js/%40jalasem%2Fdss.svg)](https://badge.fury.io/js/%40jalasem%2Fdss) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![TypeScript](https://img.shields.io/badge/Built%20with-TypeScript-blue.svg)](https://www.typescriptlang.org/) --- **Stop manually managing SSH keys and Git configs when switching between projects, clients, or companies.** DSS provides isolated development environments that automatically handle SSH authentication and Git configuration, letting you focus on what matters most: your code. </div> ## โœจ Features | Feature | Description | |---------|-------------| | ๐Ÿ—๏ธ **Space Management** | Create and manage isolated workspaces for different projects | | ๐Ÿ” **SSH Key Automation** | Automatically generate and switch SSH keys when changing spaces | | ๐Ÿ“ **Git Configuration** | Streamlined GitHub user configuration for each space | | ๐ŸŽจ **Rich CLI Interface** | Beautiful command-line interface with colors and progress indicators | | ๐Ÿ” **Fuzzy Search** | Intelligent search functionality for quick space discovery | | ๐Ÿ“ฆ **Batch Operations** | Perform operations on multiple spaces efficiently | | ๐Ÿ’พ **Import/Export** | Backup and restore space configurations | | โšก **Performance** | Fast operations with comprehensive test coverage | ## ๐Ÿš€ Quick Start ### Installation Install DSS globally using your preferred package manager: <table> <tr> <td> **npm** ```bash npm install -g @jalasem/dss ``` </td> <td> **yarn** ```bash yarn global add @jalasem/dss ``` </td> <td> **pnpm** ```bash pnpm add -g @jalasem/dss ``` </td> </tr> </table> ### Verify Installation ```bash dss --version ``` ## ๐Ÿ“– Usage Guide After installation, use the `dss` command to manage your development spaces: ### Core Commands <details> <summary><b>๐Ÿ†• Creating a New Space</b></summary> ```bash dss add ``` Interactive wizard to create a new development space: - Enter space name (auto-slugified) - Provide email and username - Automatically generates SSH keys - Sets up Git configuration </details> <details> <summary><b>๐Ÿ“‹ List All Spaces</b></summary> ```bash dss list ``` Displays a beautiful table of all your spaces showing: - Space names with active indicators - Associated email addresses - Usernames - Current status (active/inactive) </details> <details> <summary><b>๐Ÿ”„ Switch Between Spaces</b></summary> ```bash dss switch [spaceName] ``` Switch to a different development space: - Without `spaceName`: Interactive selection menu - With `spaceName`: Direct switch to specified space - Updates Git config and SSH agent automatically </details> <details> <summary><b>๐Ÿ—‘๏ธ Remove a Space</b></summary> ```bash dss remove [spaceName] ``` Safely remove a development space: - Interactive confirmation required - Cannot remove active space - Cleans up SSH keys and configurations </details> <details> <summary><b>โœ๏ธ Edit Space Configuration</b></summary> ```bash dss edit [spaceName] ``` Modify existing space settings: - Update email and username - Regenerate SSH keys if needed - Interactive editing workflow </details> ### Advanced Features <details> <summary><b>๐Ÿ” Fuzzy Search Spaces</b></summary> ```bash dss search [query] ``` Quickly find spaces using intelligent search: - Search by name, email, or username - Fuzzy matching for typos - Fast results display </details> <details> <summary><b>๐Ÿ“ฆ Batch Operations</b></summary> ```bash dss batch ``` Perform operations on multiple spaces: - Quick switching between spaces - Bulk configuration updates - Efficient workflow management </details> <details> <summary><b>๐Ÿ’พ Backup & Restore</b></summary> Export your configuration: ```bash dss export [--output config.json] ``` Import from backup: ```bash dss import [--file config.json] ``` Perfect for: - Moving between machines - Backup strategies - Team configuration sharing </details> <details> <summary><b>๐Ÿ”ง Space Inspection</b></summary> ```bash dss inspect [spaceName] ``` View detailed information about a space: - SSH key paths and fingerprints - Git configuration details - GitHub access status - Configuration history </details> <details> <summary><b>๐Ÿงช Test GitHub Access</b></summary> ```bash dss test [spaceName] ``` Verify GitHub SSH connectivity: - Tests SSH key authentication - Validates GitHub access - Provides troubleshooting tips </details> ## ๐ŸŽฏ Use Cases <table> <tr> <td width="50%"> ### ๐Ÿข **Freelancers & Consultants** - Separate spaces for each client - Isolated SSH keys and Git configs - Quick switching between projects - Professional identity management </td> <td width="50%"> ### ๐Ÿญ **Enterprise Developers** - Work and personal GitHub accounts - Different SSH keys for security - Project-specific configurations - Compliance with company policies </td> </tr> <tr> <td> ### ๐Ÿ‘ฅ **Open Source Contributors** - Personal vs. professional identities - Multiple GitHub accounts - Easy context switching - Organized contribution workflow </td> <td> ### ๐ŸŽ“ **Students & Educators** - School vs. personal projects - Different email addresses - Learning environment isolation - Portfolio organization </td> </tr> </table> ## ๐Ÿ†• What's New in v1.1.0 <div align="center"> | Feature | Description | Impact | |---------|-------------|---------| | ๐ŸŽจ **Enhanced UI** | Rich colored output with progress indicators | Better user experience | | ๐Ÿ” **Fuzzy Search** | Intelligent search functionality | Faster space discovery | | ๐Ÿ“ฆ **Batch Operations** | Multi-space switching and operations | Improved workflow efficiency | | ๐Ÿ”„ **Import/Export** | Backup and restore configurations | Data portability | | โšก **Performance** | Optimized operations and memory usage | Faster execution | | ๐Ÿงช **Testing** | Comprehensive test coverage (90%+) | Higher reliability | | ๐Ÿ“š **Documentation** | Improved help text and guides | Better onboarding | </div> ## ๐Ÿ› ๏ธ Development ### Contributing We welcome contributions! Here's how to get started: 1. **Fork the repository** 2. **Create a feature branch**: `git checkout -b feature/amazing-feature` 3. **Make your changes** with tests 4. **Run the test suite**: `npm test` 5. **Submit a pull request** ### Local Development ```bash # Clone and setup git clone https://github.com/jalasem/dss.git cd dss npm install # Development workflow npm run dev # Run in development mode npm run build # Build for production npm run lint # Check code style npm test # Run test suite npm run test:watch # Run tests in watch mode npm run test:coverage # Generate coverage report ``` ### Project Structure ``` src/ โ”œโ”€โ”€ index.ts # CLI entry point โ”œโ”€โ”€ utils/ โ”‚ โ”œโ”€โ”€ SpaceManager.ts # Core business logic โ”‚ โ”œโ”€โ”€ ui.ts # Rich UI components โ”‚ โ”œโ”€โ”€ sshKeyGen.ts # SSH key generation โ”‚ โ”œโ”€โ”€ fuzzySearch.ts # Search functionality โ”‚ โ””โ”€โ”€ batchOperations.ts # Bulk operations โ””โ”€โ”€ __tests__/ # Test suites ``` ## ๐Ÿ™ Acknowledgments - **Contributors**: Thank you to all developers who've contributed to this project - **Open Source Community**: For the amazing tools and libraries that make this possible - **Users**: For feedback, bug reports, and feature requests that help improve DSS --- <div align="center"> **Made with โค๏ธ by developers, for developers** [Report Bug](https://github.com/jalasem/dss/issues) ยท [Request Feature](https://github.com/jalasem/dss/issues) ยท [Documentation](https://github.com/jalasem/dss#readme) </div>