Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Windows Command Prompt Utilities

A collection of Windows batch utilities that provide powerful aliases and functions for Git, NPM, and Python development, converted from zsh to Windows command prompt format.

πŸš€ Features

  • Git Utilities: Complete git workflow aliases and functions
  • NPM Utilities: Package management and testing shortcuts
  • Python Utilities: Environment management and testing tools
  • Cross-directory Support: All utilities work from any directory
  • Windows Native: Optimized for Windows command prompt

πŸ“ Structure

cmd/
β”œβ”€β”€ _bashrc.cmd              # Main configuration file
β”œβ”€β”€ git-utils/               # Git utilities
β”‚   β”œβ”€β”€ git-update.bat
β”‚   β”œβ”€β”€ git-status.bat
β”‚   β”œβ”€β”€ git-restore-all.bat
β”‚   β”œβ”€β”€ git-checkout.bat
β”‚   β”œβ”€β”€ git-branch-update-all.bat
β”‚   β”œβ”€β”€ git-diff-n.bat
β”‚   β”œβ”€β”€ git-worktree-add.bat
β”‚   β”œβ”€β”€ git-worktree-checkout.bat
β”‚   β”œβ”€β”€ git-pull-request.bat
β”‚   β”œβ”€β”€ test-git-aliases.bat
β”‚   └── README.md
β”œβ”€β”€ npm-utils/               # NPM utilities
β”‚   β”œβ”€β”€ npm-test-integration.bat
β”‚   β”œβ”€β”€ npm-test-system-custom.bat
β”‚   β”œβ”€β”€ npm-test-integration-inband.bat
β”‚   β”œβ”€β”€ npm-test-system-inband.bat
β”‚   β”œβ”€β”€ npm-install-build.bat
β”‚   β”œβ”€β”€ npm-clean-build.bat
β”‚   β”œβ”€β”€ npm-remove-dist.bat
β”‚   β”œβ”€β”€ test-npm-aliases.bat
β”‚   └── README.md
β”œβ”€β”€ python-utils/            # Python utilities
β”‚   β”œβ”€β”€ python-env.bat
β”‚   β”œβ”€β”€ python-install-requirements.bat
β”‚   β”œβ”€β”€ python-install-zowe.bat
β”‚   β”œβ”€β”€ python-test-unit.bat
β”‚   β”œβ”€β”€ python-test-integration.bat
β”‚   β”œβ”€β”€ test-python-aliases.bat
β”‚   └── README.md
β”œβ”€β”€ _bashrc.cmd              # Main configuration file
β”œβ”€β”€ _zsh_aliases.sh          # Original zsh aliases (reference)
β”œβ”€β”€ code.cmd                 # VS Code launcher
β”œβ”€β”€ wget.exe                 # Wget for Windows
└── README.md                # This file

πŸ› οΈ Installation

Quick Setup

  1. Clone the repository:

    git clone https://github.com/zFernand0/cmd.git
    cd cmd
  2. Load the configuration:

    _bashrc.cmd
  3. Verify installation:

    test-git-aliases
    test-npm-aliases
    test-python-aliases

Auto-load Setup (Recommended)

Method 1: Windows Registry (System-wide)

  1. Open Registry Editor: Press Win+R, type regedit, and press Enter
  2. Navigate to: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor
  3. Add/Modify: Create or modify the AutoRun string value
  4. Set Value: C:\path\to\cmd\_bashrc.cmd (replace with your actual path)
  5. Restart: Close and reopen any command prompt windows

Method 2: User-specific Registry

  1. Open Registry Editor: Press Win+R, type regedit, and press Enter
  2. Navigate to: Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor
  3. Add/Modify: Create or modify the AutoRun string value
  4. Set Value: C:\path\to\cmd\_bashrc.cmd (replace with your actual path)
  5. Restart: Close and reopen any command prompt windows

Method 3: PowerShell Profile

  1. Create/Edit Profile:
    notepad $PROFILE
  2. Add Line:
    & "C:\path\to\cmd\_bashrc.cmd"
  3. Restart: Close and reopen PowerShell

Manual Setup

  1. Add to your PATH (optional):

    • Add the cmd directory to your system PATH
    • Or run _bashrc.cmd in each new command prompt session
  2. Batch File Shortcut (optional):

    • Create a shortcut to cmd.exe
    • Modify the target to: cmd.exe /k "C:\path\to\cmd\_bashrc.cmd"

πŸ“š Available Commands

This repository provides hundreds of aliases and functions for Git, NPM, and Python development. Here are some key examples:

Git Commands

Basic Operations:

  • g β†’ git (basic git command)
  • gs β†’ git status (with fetch and worktree list)
  • gu β†’ git update (fetch and pull)
  • ga β†’ git add, gc β†’ git commit

Branch Management:

  • gb β†’ git branch, gbv β†’ git branch -vv
  • gch β†’ git checkout (with fetch)
  • gbU β†’ Update all branches

Push/Pull:

  • gpl β†’ git pull, gph β†’ git push
  • gpho β†’ git push -u origin

Advanced:

  • gwA β†’ Add worktree with naming
  • gpr β†’ Fetch PR branches
  • gst β†’ git stash, gsta β†’ git stash apply

πŸ“– Complete Git Reference: See git-utils/README.md for all 50+ git commands

NPM Commands

Basic Operations:

  • n β†’ npm, ni β†’ npm install
  • nr β†’ npm run, nrb β†’ npm run build
  • nrs β†’ npm run start

Testing:

  • ntu β†’ npm run test:unit
  • nti β†’ npm run test:integration
  • nts β†’ npm run test:system

Utilities:

  • nib β†’ Install and build
  • nrcb β†’ Clean and build
  • rmd β†’ Remove dist + git restore

πŸ“– Complete NPM Reference: See npm-utils/README.md for all 30+ npm commands

Python Commands

Basic Operations:

  • p3 β†’ python3, pyp β†’ python3 -m pip
  • pir β†’ Install requirements.txt
  • penv β†’ Environment management

Testing:

  • pyt β†’ pytest -s
  • tpu β†’ Run unit tests
  • tpi β†’ Run integration tests

πŸ“– Complete Python Reference: See python-utils/README.md for all 15+ python commands

πŸ”§ Configuration

Environment Variables

The _bashrc.cmd file automatically sets up:

  • PATH: Adds utility directories to PATH
  • FNM: Node.js version management (if available)

Customization

You can customize the utilities by:

  1. Modifying batch files in the utility directories
  2. Adding new aliases to _bashrc.cmd
  3. Creating new utility directories for additional tools

πŸ§ͺ Testing

Run the test scripts to verify all utilities are working:

# Test all utilities
test-git-aliases
test-npm-aliases
test-python-aliases

# Or test individual utilities
git-utils\test-git-aliases.bat
npm-utils\test-npm-aliases.bat
python-utils\test-python-aliases.bat

πŸ“– Usage Examples

Git Workflow

gs          # Check status
ga .        # Stage all changes
gc -m "feat: add new feature"  # Commit
gu          # Update repository
gbU         # Update all branches

NPM Development

ni          # Install dependencies
nrb         # Build project
nrs         # Start development server
ntu         # Run unit tests
nti --watch # Run integration tests in watch mode

Python Development

penv        # Create/activate virtual environment
pir         # Install requirements
pyt         # Run all tests
tpu         # Run unit tests
tpi         # Run integration tests

πŸ”„ Migration from zsh

This project converts zsh aliases to Windows batch format:

  • Original: _zsh_aliases.sh (zsh format)
  • Converted: _bashrc.cmd + utility directories (Windows format)

Key differences:

  • Uses doskey for aliases instead of alias
  • Standalone .bat files instead of shell functions
  • Windows path syntax (\ instead of /)
  • Windows-compatible commands (rmdir instead of rm)

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is open source and available under the Apache License 2.0.

πŸ™ Acknowledgments

  • Original zsh aliases that inspired this project
  • Windows command prompt community
  • Contributors and users of this utility collection

Made with ❀️ for Windows developers

About

Powerful Windows Command Prompt utilities, converted from zsh, that provide essential aliases and functions to supercharge your Git, NPM, and Python development workflows

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages