{"id":24659962,"url":"https://github.com/offerrall/pyalias-windows-alias-manager","last_synced_at":"2026-05-10T05:45:35.989Z","repository":{"id":134154027,"uuid":"598413443","full_name":"offerrall/PyAlias-Windows-Alias-Manager","owner":"offerrall","description":"Simple CLI Alias Manager for Windows","archived":false,"fork":false,"pushed_at":"2024-09-24T15:40:16.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-26T03:15:20.699Z","etag":null,"topics":["alias","aliaswindows","c","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/offerrall.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-07T03:44:00.000Z","updated_at":"2024-09-24T15:40:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"bac49382-06fb-4ec7-9bde-2dda7f216b0e","html_url":"https://github.com/offerrall/PyAlias-Windows-Alias-Manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offerrall%2FPyAlias-Windows-Alias-Manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offerrall%2FPyAlias-Windows-Alias-Manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offerrall%2FPyAlias-Windows-Alias-Manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offerrall%2FPyAlias-Windows-Alias-Manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/offerrall","download_url":"https://codeload.github.com/offerrall/PyAlias-Windows-Alias-Manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244747009,"owners_count":20503303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alias","aliaswindows","c","python"],"created_at":"2025-01-26T03:15:30.153Z","updated_at":"2026-05-10T05:45:35.984Z","avatar_url":"https://github.com/offerrall.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyAlias\n\nFast, persistent command aliases for Windows that work exactly like native commands.\n\n## Features\n\n✓ **Native behavior** - Works in cmd.exe, PowerShell, Git Bash, any terminal  \n✓ **Persistent** - Survives restarts and terminal sessions  \n✓ **Fast** - 21x faster than .bat files (0.75ms vs 15ms per execution)  \n✓ **Reliable** - Works correctly with arguments in automation scripts  \n✓ **Auto-install** - Adds itself to PATH automatically  \n✓ **Simple** - 200 lines of Python, 200 lines of C  \n\n## Installation\n```bash\npip install git+https://github.com/offerrall/PyAlias-Windows-Alias-Manager\n```\n\n**Requirements:** \n- Windows\n- Python 3.10+\n- gcc (MinGW-w64) - [Download here](https://www.mingw-w64.org/)\n\nOn first run, PyAlias automatically adds `~/.pyalias` to your PATH. Restart your terminal after installation.\n\n## Quick Start\n```bash\n# Create aliases\npyalias new ls \"dir /b\"\npyalias new gs \"git status\"\npyalias new gp \"git push\"\npyalias new dev \"cd C:\\projects \u0026\u0026 npm run dev\"\n\n# Use them\nls\ngs\ngp origin main\n\n# Manage\npyalias list\npyalias read ls\npyalias delete ls\n```\n\n## Commands\n```bash\npyalias new \u003calias\u003e \u003ccommand\u003e    # Create alias\npyalias list                     # List all aliases  \npyalias read \u003calias\u003e             # Show alias command\npyalias delete \u003calias\u003e           # Delete alias\npyalias -h                       # Help\n```\n\n## Why Not Just Use .bat Files?\n\nYou might wonder: \"Windows already supports `.bat` files, why do I need this?\"\n\n**.bat files have critical limitations:**\n\n1. **20x slower** - Batch files take ~15ms to execute vs ~0.75ms for `.exe`\n2. **Arguments break in automation** - `.bat` files don't pass arguments correctly when called from Python's `subprocess`\n   - Your automation scripts will fail\n   - `.exe` works reliably everywhere\n\n3. **Batch syntax quirks** - Need `@echo off`, special escaping for `%`, `\u0026`, `|`\n   - `.exe` just runs the command directly\n\n**Benchmark from real tests:**\n```\n100 executions in cmd.exe:\n  .exe:  75ms   (0.75ms each)\n  .bat:  1579ms (15.79ms each)\n  \nResult: .exe is 21x faster\n```\n\n## How It Works\n\n**When you create an alias:**\n1. PyAlias copies `launcher.exe` → `~/.pyalias/ls.exe`\n2. Creates `~/.pyalias/ls.txt` containing the command\n3. Adds `~/.pyalias` to your PATH (once)\n\n**When you run the alias:**\n1. Windows finds `ls.exe` in PATH\n2. `ls.exe` reads its own filename: \"ls\"\n3. Opens `ls.txt` in the same directory\n4. Executes the command with any arguments you passed\n```\nUser types:    ls -la\nExecutes:      ls.exe → reads ls.txt (\"dir /b\") → runs \"dir /b -la\"\n```\n\n## Why C?\n\nThe launcher is written in C for speed and reliability:\n\n- **Instant execution** - No interpreter overhead like batch files\n- **Static memory** - No malloc, deterministic behavior\n- **Robust** - Handles long paths (32KB), large commands (8KB)\n- **Portable** - Single 20KB executable per alias\n\n## Technical Details\n\n**Launcher architecture:**\n- Static memory allocation (no malloc)\n- 32KB path buffer (handles Windows long paths)\n- 8KB command buffer (practically unlimited)\n- Error handling with specific messages\n\n**Storage:**\n- Aliases stored in `C:\\Users\\YourName\\.pyalias\\`\n- Each alias is one `.exe` + one `.txt` file\n- 50 aliases = ~1MB total\n\n## Limitations\n\nThese are inherent to how subprocesses work, not PyAlias limitations:\n\n- **Can't change directory** - `cd` in a subprocess doesn't affect the parent shell\n- **Can't modify environment** - `set VAR=value` only affects the subprocess\n\nFor these use cases, use shell-specific solutions (`.bashrc`, PowerShell profiles, etc.)\n\n## Contributing\n\nPull requests welcome. Keep it simple and fast.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofferrall%2Fpyalias-windows-alias-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fofferrall%2Fpyalias-windows-alias-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fofferrall%2Fpyalias-windows-alias-manager/lists"}