| name | mfk-usecase-install |
| description | Make the mfk-usecase command available, installing it only if it is missing. Use when another skill reports that `mfk-usecase` is not on PATH, or when the user asks to install, update or upgrade the ideamans Money Forward Kessai invoice downloader. Prefers an already-installed binary, then the latest GitHub release, then a build from source with go install. |
| license | MIT |
| compatibility | Requires curl (or wget) and tar to install from a release, or a Go toolchain for the source fallback. Standalone — does not need mfk-usecase to be present already. Installs from the public repository github.com/ideamans/mfk-usecase-cli, so no GitHub authentication is needed. |
| allowed-tools | Bash(curl:*) Bash(wget:*) Bash(tar:*) Bash(unzip:*) Bash(go:*) Bash(uname:*) Bash(command:*) Bash(which:*) Bash(mkdir:*) Bash(mv:*) Bash(cp:*) Bash(rm:*) Bash(chmod:*) Bash(ls:*) Bash(test:*) Bash(echo:*) Read |
mfk-usecase-install
Make the mfk-usecase command usable, doing the least work that achieves it.
Route 1 — an existing installation on PATH
command -v mfk-usecase && mfk-usecase --version
If that resolves, use it and stop here. Do not check for a newer release —
it costs an API call and the user did not ask for an upgrade.
Two checks before trusting the hit:
- It is the right tool.
mfk-usecase llm | head -1 must read
# mfk-usecase CLI — AIエージェント向けリファレンス.
- It is recent enough. If
mfk-usecase llm is not a known command, the
binary predates the embedded reference. Say so and continue to route 2.
Continue past this section only when the command is missing, is the wrong tool,
is too old, or the user explicitly asked to update.
Route 2 — the latest GitHub release
VERSION=$(curl -fsSL https://api.github.com/repos/ideamans/mfk-usecase-cli/releases/latest \
| grep '"tag_name"' | head -1 | cut -d'"' -f4)
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m); [ "$ARCH" = "x86_64" ] && ARCH=amd64
curl -fsSL -o /tmp/mfk-usecase.tar.gz \
"https://github.com/ideamans/mfk-usecase-cli/releases/download/${VERSION}/mfk-usecase-cli_${VERSION#v}_${OS}_${ARCH}.tar.gz"
The archive is named mfk-usecase-cli_… but the binary inside is
mfk-usecase — without the -cli suffix. Windows ships a .zip.
If the API returns no release at all, this repository may not have published one
yet — fall back to route 3 rather than retrying.
Install onto PATH
tar -xzf /tmp/mfk-usecase.tar.gz -C /tmp
mkdir -p ~/.local/bin && mv /tmp/mfk-usecase ~/.local/bin/ && chmod +x ~/.local/bin/mfk-usecase
Prefer the first writable directory already on PATH — ~/.local/bin, then
/usr/local/bin. Two things not to do on your own initiative:
- If nothing on PATH is writable, leave the binary in
/tmp, print the exact
sudo mv command and let the user run it. Do not run sudo yourself.
- If
~/.local/bin is not on PATH, give the user the line to add to their shell
profile. Do not edit the profile for them.
Note that the repository's make install also uses sudo to write into
/usr/local/bin. Prefer the ~/.local/bin route above, which needs no
privileges.
Route 3 — build from source
Needs a Go toolchain and compiles rather than downloads. Note the /cmd suffix —
the main package is not at the module root.
go install github.com/ideamans/mfk-usecase-cli/cmd@latest
go install names the binary after the last path element, so this produces
cmd, not mfk-usecase. Rename it:
mv "$(go env GOPATH)/bin/cmd" "$(go env GOPATH)/bin/mfk-usecase"
Say so explicitly — a binary called cmd on PATH is confusing and easily
overwritten by another project installed the same way.
Verify
mfk-usecase --version
mfk-usecase llm | head -5
Report which route was taken, the version and the install path.
Then say what is still needed: mfk-usecase cannot download anything without
MFK_API_KEY in the environment. Ask the user to export it rather than passing
--api-key on the command line, which would leave the key in shell history.