diff --git a/docs/getting-started.md b/docs/getting-started.md index 28111ca82a..d60cdd665f 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -223,11 +223,124 @@ Note that when you ran `mise use --global node@22`, `mise` updated the global `m node = "22" ``` -## 4. Next steps {#next-steps} +## 4. Use tools from backends (npm, pipx, core, aqua, github) {#tool-backends} + +```mermaid +flowchart LR + subgraph Backends + core + aqua + github + npm + pipx + end + + core --> node["core:node"] + core --> python["core:python"] + aqua -->gh["aqua:cli/cli"] + github -->ripgrep["github:BurntSushi/ripgrep"] + github -->ruff["github:astral-sh/ruff"] + npm --> prettier["npm:prettier"] + npm --> claude_code["npm:@anthropic-ai/claude-code"] + pipx -->black["pipx:black"] + pipx -->pycowsay["pipx:pycowsay"] + aqua -->terraform["aqua:hashicorp/terraform"] + + subgraph Tools + node + python + gh + ripgrep + ruff + prettier + claude_code + black + pycowsay + terraform + end +``` + +Backends are ecosystems or package managers that mise uses to install tools. With `mise use`, you can install multiple tools from each backend. + +For example, to install [claude-code](https://www.npmjs.com/package/@anthropic-ai/claude-code) with the npm backend: + +```sh +# run claude-code via mise x|exec +mise exec npm:@anthropic-ai/claude-code -- claude-code --version + +# or if mise is activated in your shell +mise use --global npm:@anthropic-ai/claude-code +claude-code --version +``` + +Install [black](https://github.com/psf/black) with the pipx backend: + +```sh +# run black via mise x|exec +mise exec pipx:black -- black --version + +# or if mise is activated in your shell +mise use --global pipx:black +black --version +``` + +mise can also install tools directly from github with the github backend: + +```sh +# run ripgrep via mise x|exec +mise exec github:BurntSushi/ripgrep -- ripgrep --version + +# or if mise is activated in your shell +mise use --global github:BurntSushi/ripgrep +ripgrep --version +``` + +See [Backends](/dev-tools/backends/) for more ecosystems and details. + +### 5. Setting environment variables {#environment-variables} + +You can set environment variables in `mise.toml` which will be set if mise is activated or if `mise x|exec` is used in a directory: + +```toml [mise.toml] +[env] +NODE_ENV = "production" +``` + +```sh +mise exec -- node --eval 'console.log(process.env.NODE_ENV)' + +# or if mise is activated in your shell +echo "node env: $NODE_ENV" +# node env: production +``` + +### 6. Run a task {#run-a-task} + +You can define simple tasks in `mise.toml` and run them with `mise run`: + +```toml [mise.toml] +[tasks] +hello = "echo hello from mise" +``` + +Run it: + +```sh +mise run hello +# hello from mise +``` + +:::tip +mise tasks will automatically install all of the tools from `mise.toml` before running the task. +::: + +See [tasks](/tasks/) for more information on how to define and use tasks. + +## 7. Next steps {#next-steps} Follow the [walkthrough](/walkthrough) for more examples on how to use mise. -### Set up the autocompletion {#autocompletion} +### Set up autocompletion {#autocompletion} See [autocompletion](/installing-mise.html#autocompletion) to learn how to set up autocompletion for your shell.