Skip to main content

Initialize mise (polyglot asdf-like runtime manager in Rust)
in a more performant and flexible way

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

This xontrib adds a couple of (maybe too tiny to notice) improvements:

  • (no cost) replaces the subprocess syntax for the hook mise function with a pure python syntax, which for some reason improves hook runtime by ~60% (but in absolute terms maybe just a dozen or two ms)
  • (less convenient) replaces a hook on every prompt paint with hooks on
    • shell launch
    • changing dirs
    • empty commands
      useful to refresh shell status when you edit .tool-versions outside of shell (optional)
    • commands that containt custom text chunks
      useful to refresh shell status when you edit .tool-versions in a shell (optional)

Installation

To install use pip:

xpip install xontrib-mise
# or: xpip install -U git+https://github.com/eugenesvk/xontrib-mise

Usage

This xontrib requires mise to be in PATH or ~/bin; or if it's added to PATH via another xontrib (e.g, you installed it via Homebrew and use xontrib-homebrew), then you should load this xontrib after the one setting PATH

  1. Add the following to your .py xontrib loading config and import it in your xonsh run control file (~/.xonshrc or ~/.config/rc.xsh):
from xonsh.xontribs 	import xontribs_load
from xonsh.built_ins	import XSH
envx = XSH.env

xontribs = [ "mise", # Initializes mise (polyglot asdf-like runtime manager)
 # your other xontribs
]
# ↓ optional configuration variables
if 'mise' in xontribs: # Configure mise only if you're actually loading
  # config var                        	  value             	  |default|alt_cmd¦ comment
  envx['XONTRIB_MISE_CHUNK_LIST']     	= ['.tool-versions']	# |['.tool-versions']|False¦ (feeble attempts to track edits to `.tool-versions` in the command line) update mise status if command contains any of the string chunks in this list; False to disable this listener completely
  envx['XONTRIB_MISE_NEWLINE_REFRESH']	= True              	# |True|False¦ update mise status if command is empty (e.g, ⏎ on a blank line to refresh after editing `.tool-versions` in a text editor); False to disable this listener completely
  envx['XONTRIB_MISE_FORCE_COLOR']    	= True              	# |True|False¦ preserve colored mise output
  envx['XONTRIB_MISE_LOGLEVEL']       	= 1                 	# |1|0¦ print xontrib log messages: 0 none, 1 error; 'mise' stderr is always passed through
# (old variables with _RTX_ in the name continue to work)
xontribs_load(xontribs) # actually load all xontribs in the list
  1. Or just add this to your xonsh run control file
xontrib load mise # Initializes mise (polyglot asdf-like runtime manager)
# configure like in the example above, but replace envx['VAR'] with $VAR
$XONTRIB_MISE_LOGLEVEL = 1

Known issues

  • In the future xontrib-mise will be autoloaded, but this is currently blocked due to a xonsh bug: too early autoload prevents reading user config; also, autoloading can't be disabled

Credits

This package was created with xontrib template

Release files for xontrib-mise 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xontrib-mise 0.0.7
File Size Uploaded
xontrib_mise-0.0.7.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xontrib-mise 0.0.7
File Interpreter ABI Platform
xontrib_mise-0.0.7-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / xontrib_mise-0.0.7.tar.gz

Download URL xontrib_mise-0.0.7.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
11cee059feb0333d577fd8c41fb0c1e7b122b3595fbdad007c547100afbad8ca
BLAKE2b-256 checksum
How to use checksums
375af254a8478990b49c4b6ff61091b447d0666c3f34543defdbe0e95b12b9e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / xontrib_mise-0.0.7-py3-none-any.whl

Download URL xontrib_mise-0.0.7-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b881853a5a37136ec5f7384319821f313adbe7cd9653161a3ea1828bada1f74
BLAKE2b-256 checksum
How to use checksums
df4fa9ca9d7f943c98b98f688de055fc79fb02386e8758cdb3b40a69f993cece
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page