README.md

May 9, 2026 · View on GitHub

A single Xonsh command to create and cd into a directory, or into a fetched git repo or archive file. A port of Oh My Zsh's take command.

I reckon the source is a good showcase of mixing Python and shell commands in Xonsh.

Status: It works. Issues and PRs for additional features are welcome!

If you like the idea click ⭐ on the repo and tweet.

Installation

I haven't uploaded this to PyPi, I will if anyone expresses interest.

xpip install -U git+https://github.com/nahoj/xontrib-take

Then:

xontrib load take

Examples

~/test @ ls
~/test @ take foo/bar
~/test/foo/bar @
~/test @ take https://github.com/nahoj/xontrib-take.git
Clonage dans 'xontrib-take'...
...
…/xontrib-take main @
~/test @ take https://github.com/nahoj/xontrib-take/archive/refs/heads/main.zip
...
Archive:  /tmp/tmp.n2rudhhtF0
   creating: ./xontrib-take-main/
...
~/test/xontrib-take-main @

Development

# install pre-commit plugins and activate the commit hook
pre-commit install
pre-commit autoupdate

Releasing your package

  • Bump the version of your package.
  • Create a GitHub release (The release notes are automatically generated as a draft release after each push).
  • And publish with poetry publish --build or twine

Credits

This xontrib is a direct translation of Oh My Zsh's handy take command, inspired by mkcd aliases around the world :)

This package was created with xontrib template.


Xontrib Promotion (DO and REMOVE THIS SECTION)

  • Publish your xontrib to PyPi via Github Actions and users can install your xontrib via xpip install xontrib-myxontrib. Easiest way to achieve it is to use Github Actions. Register to https://pypi.org/ and create API token. Go to repository "Settings" - "Secrets" and your PyPI API token as PYPI_API_TOKEN as a "Repository Secret". Now when you create new Release the Github Actions will publish the xontrib to PyPi automatically. Release status will be in Actions sction. See also .github/workflows/release.yml.