Run the CLI with npm
[⏱️ ~3 min] Install `mdk` on your PATH with `npm install -g` and verify it
To run a single mdk command without installing anything — in CI, or to try a version before you adopt it — use
npx instead.
TL;DR
Run from any folder:
npm install -gputsmdkin npm's global folder (npm prefix -g), not in a project. A source checkout runs its install line from the clone's root,mdk/.
- Install
mdkon your PATH withnpm install -g @tetherto/mdk-cli
Overview
mdk is MDK's command-line tool for standing up and operating a stack from your terminal. It scaffolds a stack
(mdk create), boots it (mdk run), and reports its health (mdk status), all driven by the mdk.yaml spec
mdk onboard writes for you.
Prerequisites
Install
Install the published CLI from npm. A source checkout is only needed to work on the CLI itself.
Put mdk on your PATH
If mdk --version already prints a version, skip to verifying your install.
A. Install from npm
npm install -g @tetherto/mdk-cliThis installs the newest published release. To install a specific release, add its version after the package name, for
example npm install -g @tetherto/mdk-cli@0.15.0, and follow the docs for that release.
npx @tetherto/mdk-cli <command> runs a single command without installing anything globally, which
suits CI and one-off scaffolding.
B. Install from a source checkout
Contributors who are changing the CLI's own source build it and link that build onto their PATH instead.
git clone https://github.com/tetherto/mdk.git
cd mdk
npm install && cd packages/cli && npm run build && npm linkThe last line runs from the repository root, mdk/. npm install there installs every workspace, which the CLI's
sibling packages need, and the line can be run again from mdk/ after a git pull or a tag checkout.
A CLI built from source scaffolds from the checkout's own templates, so mdk create app and mdk create dashboard
need the checkout's UI packages built. Build them once from mdk/:
npm run setup:ui && npm run build:uiWithout them, those commands skip the starter UI and print the same command.
To pin a tagged release, pick a tag from mdk tags and check it out before installing, for example
git checkout -b local/v0.15.0 v0.15.0.
Run project commands from your project
Commands such as mdk skill add and mdk onboard write into your current directory, so run them from the app or UI
project you are working in. mdk --version, mdk version, mdk help and --help read no project, so they work from
any directory.
Command groups
Commands grouped by purpose:
| Group | Commands |
|---|---|
| Set up | mdk onboard |
| Build | mdk create worker|app|dashboard, mdk add app|worker <source>, mdk remove app <name>, mdk validate app|worker [name] |
| Run | mdk run [target] [name], mdk stop, mdk restart, mdk status |
| Auth | mdk rbac init|apply|show, mdk user, mdk serviceaccount, mdk login, mdk logout, mdk whoami |
| Other | mdk skill add, mdk version, mdk help |
The CLI's command surface documents the full flag reference.
Update
npm install -g @tetherto/mdk-cliThis replaces the installed CLI with the newest published release. To move to a specific release, install it by version,
for example npm install -g @tetherto/mdk-cli@0.15.0, and follow the docs for that release.
Update a source checkout
How a source checkout updates depends on whether it tracks main or is pinned to a
tag. Run every command from the repository root, mdk/, and build only the CLI workspace: npm run build at the root
builds every workspace in the monorepo.
On main, pull the latest commits:
git pull
npm install && npm --workspace packages/cli run buildOn a pinned tag, such as a local/v0.14.0 branch, git pull fails with There is no tracking information for the current branch, since a branch created from a tag tracks no remote branch. Fetch the tags and check out the new one instead, for
example v0.15.0:
git fetch --tags
git checkout -b local/v0.15.0 v0.15.0
npm install && npm --workspace packages/cli run buildThe earlier npm link still points at packages/cli, so mdk --version reports the new version without linking again.
Uninstall
npm rm -g @tetherto/mdk-cliNext steps
- Try the demo to see a stack running end to end
- Run a Worker in a stack with a dashboard and an agent, with no app code
- Create the first operator once a stack runs, so the dashboard and every route have someone to sign in as
- Build with your agent so a coding agent knows MDK conventions