---
title: "meko-cli"
url: "https://docs.mekodata.ai/reference/meko-cli/"
---

# meko-cli

Search, save a memory, and upload a file on Meko running locally

`meko-cli` works with the datapacks on your computer: list them, search them, save a memory, and upload a file. [`meko`](/reference/meko/) runs the server; `meko-cli` talks to it.

The [installer](/reference/meko/#install) puts both commands in `~/.local/bin`. The server has to be running, and `meko status` has to show the context engine ready, or `meko-cli` fails.

`search`, `add_memory`, `upload`, and `upload_status` take `--datapack`. Without it, they use the default datapack Meko creates on first start. Meko creates that datapack only once, so after it is deleted, those commands need `--datapack`.

While this Meko is [linked to Meko Cloud](/reference/meko/#commands), those four commands use Meko Cloud's default datapack if you don't specify `--datapack`. The name is looked up on your computer and in Meko Cloud, and a datapack that exists on your computer is used there.

`meko-cli` runs one command and exits.

**Get help**

Typing a `meko-cli` command after `meko`, such as `meko search`, does not run it. `meko` prints the `meko-cli` command and exits.

Run `meko-cli` with no command to list the commands. `<command> --help` prints that command's flags.

## Commands

`search`, `add_memory`, `upload`, and `upload_status` take `--datapack NAME|ID`. Every command takes `--data-dir`. `--json` prints the raw reply, except on `export`.

| Command                                                 | What it does                                                                                                                                                                                                                                              |
|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `meko-cli datapacks`                                    | List datapacks by name, with their descriptions. `--json` adds each id. While Meko Cloud is linked, this includes Meko Cloud's datapacks and this computer's.                                                                                             |
| `meko-cli create_datapack <name>`                       | Create a datapack. While Meko Cloud is linked, the new datapack is created there.                                                                                                                                                                         |
| `meko-cli delete_datapack <name|id> [--force]`          | Delete a datapack and everything in it. It asks first. `--force` skips the question.                                                                                                                                                                      |
| `meko-cli export [<name|id>] [-o FILE] [--force]`       | Write one datapack on this computer to a zip: memories, collective memories, conversations, knowledge files, artifacts, and the call log. `export` only writes a datapack that is on your computer. It will not replace a file unless you pass `--force`. |
| `meko-cli search "<question>" [--source S] [--limit N]` | Search memories, the knowledge base, and past conversations. `--source` is `memory`, `knowledge_base`, or `conversation`. The default is all three. `--limit` caps each source (default 8).                                                               |
| `meko-cli add_memory "<text>"`                          | Save a memory, word for word. `-` or no text reads stdin.                                                                                                                                                                                                 |
| `meko-cli upload <file>... [--no-wait]`                 | Add PDF, text, Markdown, JSON, CSV, XML, or HTML files, up to 50 MiB each, and wait until they are indexed. `--no-wait` returns once the upload is accepted.                                                                                              |
| `meko-cli upload_status <key>`                          | How an uploaded file is doing.                                                                                                                                                                                                                            |

To connect an agent, or to link Meko Cloud, use [`meko`](/reference/meko/). The [Quick start](/quick-start/) walks through both.
