Install and upgrade
Install the takumi CLI as a prebuilt binary with cargo binstall or build it with cargo install, keep it up to date with takumi upgrade, and remove it.
Cargo installs the CLI in one of two ways. cargo binstall downloads a prebuilt binary in seconds, while cargo install builds takumi on your machine, which takes a few minutes and needs Rust 1.91 or later.
Install Rust
Both ways run through Cargo. Skip this step if cargo --version prints a version, and for cargo install, if it prints 1.91 or later. Otherwise install Rust with rustup, which also puts Cargo on your PATH:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shOn Windows, download and run rustup-init.exe from rustup.rs instead. Run rustup update if you already have an older Rust.
Install a prebuilt binary
cargo-binstall downloads the binary for your platform from the takumi release on GitHub and puts it in ~/.cargo/bin:
cargo binstall takumi-cliIf Cargo says no such command: binstall, install cargo-binstall by following its instructions first.
Releases carry binaries for macOS, Windows, and Linux, each on x64 and arm64. The Linux binary is statically linked, so it runs on both glibc and musl systems such as Alpine. When a release has no binary for your platform, cargo binstall builds takumi from source the way cargo install does, which needs Rust 1.91 or later. Check that it runs:
takumi --versionBuild from source
cargo install --locked takumi-cliCargo builds the takumi binary in release mode and puts it in ~/.cargo/bin. The first build takes a few minutes. Check that it runs:
takumi --version--locked builds with the dependency versions takumi was tested with. To install a particular release, add --version <version>.
Install the latest unreleased version
Changes reach the GitHub repository before they reach a release. To build from the repository's default branch instead of crates.io:
cargo install --locked --git https://github.com/kane50613/takumi takumi-cliTo follow another branch, add --branch <name>. To pin a commit or tag, add --rev <commit> or --tag <tag>.
To build from a clone of the repository, run this in its root:
cargo install --locked --path takumi-cliUpgrade
takumi upgradetakumi upgrade reinstalls takumi from the source Cargo recorded when you installed it, into the same directory. An install from crates.io moves to the newest release, and an install that followed a branch moves to that branch's latest commit. It never checks for updates on its own.
takumi upgrade does not upgrade an install from cargo binstall. Run cargo binstall takumi-cli again instead, which downloads the newest release.
To see the cargo install command it would run without running it, add --dry-run:
takumi upgrade --dry-runtakumi upgrade does not run when it cannot move the install forward. It prints the command to run instead, to standard error, and exits with code 1, with or without --dry-run:
- A Git install pinned with
--tagor--revstays at that pin. The printed command follows the default branch instead. - An install from a local clone upgrades after you pull the clone. The printed command rebuilds from it.
- A binary that
cargo installdid not install, such as one copied from another machine, upgrades the way you installed it.
On Windows, a running program cannot be replaced, so takumi upgrade prints the cargo install command and exits with code 1. Run the command in PowerShell once takumi has exited. The commands takumi prints on Windows are quoted for PowerShell, and on other systems for a POSIX shell such as bash or zsh.
A printed command leaves out the password in a Git URL, and the user name too unless the URL uses SSH. If the repository needs them, give them to Git another way, such as a credential helper, before you run the command.
Shell completion
takumi completions writes a script that completes takumi's commands, flags, and their values when you press Tab. Save it where your shell reads completions, then open a new shell:
# bash
mkdir -p ~/.local/share/bash-completion/completions
takumi completions bash > ~/.local/share/bash-completion/completions/takumi
# zsh: add `fpath+=~/.zfunc` before `compinit` in ~/.zshrc
mkdir -p ~/.zfunc
takumi completions zsh > ~/.zfunc/_takumi
# fish
mkdir -p ~/.config/fish/completions
takumi completions fish > ~/.config/fish/completions/takumi.fish
# PowerShell: add `. ~/takumi.ps1` to $PROFILE once
takumi completions powershell > ~/takumi.ps1PowerShell needs the script in a file of its own, since it starts with using statements that must come first in a script.
Run the command again after takumi upgrade, so the script knows the new commands and flags.
Uninstall
cargo uninstall takumi-cliThis removes the takumi binary and Cargo's record of it, whichever source it came from.
Last updated on