labnotes

Move to Mise

way faster than asdf and makes more sense

tags
mise
asdf

Installation

Disabling asdf

First remove the asdf line in the zshrc file.

* Install mise

1
  brew install mise

And then in your .zshrc

1
  echo 'eval "$(mise activate zsh)"' >> ~/.zshrc

Then start a new shell

Use your old stuff

Make sure that things are looking good:

1
  mise doctor

Then

1
  mise install

My .tool-versions looks like:

1
2
golang 1.23.5
ruby 3.4.1

And now

1
go version
go version go1.23.5 darwin/arm64
1
  ruby -v
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [arm64-darwin24]

Removing .asdf

1
  rm -r ~/.asdf

Installing global tools

1
2
3
  mise use -g go@latest
  mise use -g ruby@3.4.1
  muse use -g node@latest

You can also install cli tools from say npm. For example:

1
  mise use -g npm:repomix

Setting up mise.toml

Here's a sample pnmp based node project. Put this in your project directory, and run mise dev and it should download all of the requirements, from node to node_modules.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
  [tools]
  node = "20"
  pnpm = "latest"
  [npm:repomix] = "latest"

  [hooks]

  [env]
  _.path = ['./node_modules/.bin']

  [tasks.pnpm-install]
  description = 'Installs dependencies with pnpm'
  run = 'pnpm install'
  sources = ['package.json', 'pnpm-lock.yaml', 'mise.toml']
  outputs = ['node_modules/.pnpm/lock.yaml']

  [tasks.dev]
  description = 'Calls your dev script in `package.json`'
  run = 'npm run dev'
  depends = ['pnpm-install']

  [tasks.clean]
  description = 'Clears out dist'
  run = 'rm -rf dist/'

  [tasks.build]
  description = 'Clears out dist'
  run = ['npm run build', 'du -sh dist']
  depends = ['pnpm-install','clean']

  [tasks.llm-dump]
  description = 'Runs repomix'
  run = ['repomix --ignore "output*,**/*.log,tmp/,inputs/**/*md,data_integrity/**/*.json"']

  [tasks.llm-clipboard]
  description = 'Copies repomix to the clipboard'
  run = [ 'cat repomix-output.txt | pbcopy']
  depends = [ 'llm-dump' ]

Tasks

Another way to define tasks is to create something in, for example, mise/tasks/summarize

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  #!/bin/bash
  #MISE description="Summarize the post"

  PROMPT="give me 5 different, two sentences summaries of this post get people to read more"
  if [ -z "$1" ]; then
      echo "Usage: $0 <file> <prompt>"
      exit 1
  fi

  if [ -z "$2" ]; then
      echo "Usage: $0 <file> <prompt>"
      exit 1
  fi


  if [ ! -f "$1" ]; then
      echo "File $1 does not exist"
      exit 1
  fi



  # Get MODEL from environment, default to claude-3.7-sonnet
  MODEL=${MODEL:-claude-3.7-sonnet}

  cat "$1" | \
  llm -m $MODEL \
  	"$(PROMPT)"

Here you get the benefit of syntax highlight and all the rest.

Previously

howto

Claude Code in Emacs

Integrating Anthropic’s CLI with your editor

tags
emacs
ai
claude-code

Next

labnotes

go wormhole

easy to use in codespaces

tags
tools
wormhole