> ## Documentation Index
> Fetch the complete documentation index at: https://docs-hub.magicmealkits.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Command-line tool: mmkhub (beta)

> Install, sign in to and use mmkhub, the command-line tool for your hub's tools in a terminal or an AI agent. It is in beta.

> [!NOTE]
>
> **Beta.** The current version is 0.1.0-beta.1 and runs on **macOS** (Apple
> silicon and Intel) only. **Linux and Windows are coming soon.** Commands and
> output may change before the first full release. Running the install command
> again updates mmkhub to the latest version.

## Overview

**mmkhub** uses the tools your hub has connected, such as Gmail, Calendar, Drive
and YouTube, from a terminal. People and AI agents (Claude Code, Codex and others)
use the same program.

* **Your hub's tools become commands.** Connect a service to your hub and commands
  such as `mmkhub gmail ...` and `mmkhub youtube ...` appear, with nothing more to install.
* **Large files go straight to Google.** Videos and attachments never pass through the hub.
* **Built for AI agents.** Run by an agent, it answers in JSON and will not run a
  command that cannot be undone without the user's confirmation.
* **Signs in through your hub.** There are no API keys to create.

> [!NOTE]
>
> This is not the Magic Meal Kits CLI (`mmk`). The two can be installed side by
> side without affecting each other.

## Installation

### Let your AI install it

The easiest way. Replace `https://your-hub-address` with your hub's address and
paste this into an AI agent such as Claude Code or Codex. It installs mmkhub and
shows you a sign-in link; you approve it in your hub.

```text theme={null}
Install mmkhub (the Magic Meal Kits Hub command-line tool) and connect it to my hub at https://your-hub-address.
1. Run in a terminal: curl -fsSL https://github.com/pureugong/mmkhub-releases/releases/latest/download/install.sh | sh (macOS only for now.)
2. Run mmkhub auth login --device --start --hub https://your-hub-address and show me the link and code.
   When I say I approved it, run mmkhub auth login --device --resume.
3. Run mmkhub skills install, then check the connection with mmkhub auth status.
Never print a token.
```

### Install it yourself

No administrator rights are needed. The install script checks the download's
SHA256 checksum and installs nothing if it does not match.

> [tab] macOS
>
> **1. Open a terminal**
>
> On macOS, search for **Terminal** in Spotlight (⌘ + Space).
>
> **2. Paste the install command**
>
> ```bash theme={null}
> curl -fsSL https://github.com/pureugong/mmkhub-releases/releases/latest/download/install.sh | sh
> ```
>
> ![Example terminal. The install command is underlined and the echo line under the PATH notice is boxed in red](https://mintcdn.com/mcp-hub/LYZs_Ri8a1KO1WzK/assets/cli/cli-mac-01-install.png?fit=max\&auto=format\&n=LYZs_Ri8a1KO1WzK\&q=85\&s=4f1ab1ff9c0128315ebda61f62de7c3f)
>
> If a PATH notice appears, paste the line under it that starts with `echo`
> as well. You only do this once. mmkhub goes in `~/.local/bin`.
>
> **3. Sign in to your hub**
>
> Replace `https://your-hub-address` with your hub's address.
>
> ```bash theme={null}
> mmkhub auth login --device --hub https://your-hub-address
> ```
>
> ![Example terminal. The approval link is boxed in red and the code is circled](https://mintcdn.com/mcp-hub/LYZs_Ri8a1KO1WzK/assets/cli/cli-mac-02-login.png?fit=max\&auto=format\&n=LYZs_Ri8a1KO1WzK\&q=85\&s=88f4c0e73af30c1791d804e479f5e2ca)
>
> **4. Approve it in your hub**
>
> ![The hub's device approval screen, with the code, the selected address and the Allow button marked in red](https://mintcdn.com/mcp-hub/tmVTVz6eOcv1CuGH/assets/muse/03-approve.png?fit=max\&auto=format\&n=tmVTVz6eOcv1CuGH\&q=85\&s=23f8ca014d46ce16153a299d0e841320)
>
> Open the link, sign in to your hub, check that the code matches the one in
> the terminal and press **Allow**. The terminal carries on by itself.
>
> **5. Check, and install the agent guide**
>
> ```bash theme={null}
> mmkhub auth status
> mmkhub skills install
> ```
>
> ![Example terminal. The signed\_in true line and the skill install path are boxed in red](https://mintcdn.com/mcp-hub/LYZs_Ri8a1KO1WzK/assets/cli/cli-mac-03-status.png?fit=max\&auto=format\&n=LYZs_Ri8a1KO1WzK\&q=85\&s=f3bb1d48a9ab5b129d1e74d162891f59)
>
> `signed_in: true` means you are connected. `skills install` puts the guide
> AI agents read in place.

> [tab] Windows
>
> > [!NOTE]
> >
> > **Coming soon.** This beta runs on macOS only. Install steps for Windows
> > will appear in this tab when it is ready.

> [tab] Linux
>
> > [!NOTE]
> >
> > **Coming soon.** This beta runs on macOS only. Install steps for Linux
> > will appear in this tab when it is ready.

### With a package manager

With Homebrew, `brew upgrade mmkhub` keeps mmkhub up to date.

> [tab] Homebrew (macOS)
>
> ```bash theme={null}
> brew install magic-meal-kits/tap/mmkhub
> ```

> [tab] Scoop (Windows)
>
> Coming soon.

### Manual download

Download the archive for your Mac from the
[releases page](https://github.com/pureugong/mmkhub-releases/releases)
(`aarch64-apple-darwin` for Apple silicon, `x86_64-apple-darwin` for Intel) and put
`mmkhub` in a folder on your PATH. The `SHA256SUMS` file
lets you check what you downloaded.

## Usage examples

```bash theme={null}
mmkhub tools list                                            # your hub's tools, and the command each became
mmkhub gmail search-threads --account work --query "from:me" # search mail
mmkhub drive upload report.pdf --account work                # upload straight to Drive
mmkhub youtube upload video.mp4 --account youtube --title "Title" # uploads as private
mmkhub call gmail_search_threads --json '{"account":"work","query":"from:me"}'
```

Every tool connected to your hub appears as a command. Commands that cannot be
undone, such as sending mail or deleting a video, ask before they run.

## Agent mode

Run inside an agent such as Claude Code or Codex, mmkhub switches to agent mode
on its own.

* Results and errors both come back as JSON. An error carries a `hint` saying what to do next.
* A command that cannot be undone, such as sending or deleting, does not run without
  `--yes`. The agent asks the user first and adds `--yes` once they agree.
* After `mmkhub skills install`, the agent finds the commands it needs by itself.

`--agent` turns agent mode on and `--no-agent` turns it off.

## Global flags

| Flag | What it does |
| - | - |
| `-o`, `--output` | Output format: `json`, `yaml`, `table`, `ndjson`. A table at a terminal, JSON in a pipe |
| `-y`, `--yes` | Run a command that cannot be undone without asking |
| `--agent`, `--no-agent` | Turn agent mode on or off |
| `--read-only` | Refuse every command that changes data |
| `--hub` | Your hub's address. Remembered after you sign in |
| `--jq` | Filter the result with a jq expression |
| `--page-all` | Follow every page to the end |
| `--from` | One call per line of JSON, from a file or standard input (`-`) |

## Environment variables

Nothing needs setting. Change these only when you need to.

| Variable | What it does |
| - | - |
| `MMKHUB_URL` | Your hub's address. Remembered after you sign in, so rarely needed |
| `MMKHUB_ACCOUNT` | The default `--account` |
| `MMKHUB_READ_ONLY` | `true` refuses every command that changes data |
| `MMKHUB_OUTPUT` | Output format: `json`, `yaml`, `table`, `ndjson` |
| `MMKHUB_ACCESS_TOKEN`, `MMKHUB_MCP_URL` | Pass a token directly, for CI or a sandbox that cannot sign in |
| `MMKHUB_CONFIG_DIR` | Where the sign-in is kept. Default `~/.config/mmkhub` |
| `MMKHUB_UPLOAD_CHUNK`, `MMKHUB_UPLOAD_RETRIES` | Upload chunk size in bytes, and how many times to retry |
| `MMKHUB_VERSION`, `MMKHUB_INSTALL_DIR` | Install script: which version, and where |

## Uninstall

* **Installed with the script:** `rm ~/.local/bin/mmkhub`
* **Installed with Homebrew:** `brew uninstall mmkhub`
* To remove the sign-in too: `rm -rf ~/.config/mmkhub`

To cut the hub side off, revoke **MMK Hub CLI** under **Approved connectors** in
your hub's admin screen.

## Troubleshooting

> [accordion] command not found: mmkhub
>
> The install folder is not on your PATH. Paste the `echo` line the installer
> printed.

> [accordion] It says the code has expired
>
> A code lasts ten minutes. Run the sign-in command again.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.