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

# MonoWiki

> Search Wikipedia, import multilingual articles as Markdown, and index reference material for Monomento.

MonoWiki provides a Wikipedia-specific research path. It searches one language
edition, fetches article HTML through Wikipedia's REST API, converts it to
Markdown, and can store the result in [Monomento](/ai-clis/monomento) as
`doc_type=wikipedia`.

*Published contract: `monowiki 0.2.1`, OpenCLIs build
`2026-04-12-113757`. The installed-state row, immutable payload, public CDN
pointer, and CDN release metadata agree on this identity. The exact installed
payload was also code-signature verified on macOS.*

## Quick Start

```bash theme={null}
openclis install monowiki

monowiki --version
monowiki search "distributed systems" --lang en
monowiki fetch "Distributed computing" --lang en --no-index
monowiki fetch "분산 컴퓨팅" --lang ko
```

Search first when the title is ambiguous, then use `--no-index` to inspect an
article before adding it to the shared corpus.

## Published Command Surface

The current public build has **3 operational root commands** plus help and
version aliases.

| Command                                      | Reads                          | Writes                            | Contract                                                                            |
| -------------------------------------------- | ------------------------------ | --------------------------------- | ----------------------------------------------------------------------------------- |
| `search <query> [--lang <code>]`             | Wikipedia MediaWiki search API | Nothing persistent                | Returns at most 10 candidates with compact text snippets. Default language is `en`. |
| `fetch <title> [--lang <code>] [--no-index]` | Wikipedia REST HTML API        | A `wikipedia` document by default | Converts article HTML to Markdown; `--no-index` prints Markdown only.               |
| `list`                                       | Shared Monomento database      | Nothing                           | Lists only rows whose `doc_type` is `wikipedia`.                                    |
| `help`, `--help`, `-h`                       | Embedded root guide            | Nothing                           | Prints the same root guide as bare `monowiki`.                                      |
| `version`, `--version`, `-v`                 | Package identity               | Nothing                           | Prints `monowiki 0.2.1`.                                                            |

There is no direct citation verifier, revision-history reader, edit command, or
MCP schema. MonoWiki captures the current article response seen by the client.

## Parser and Option Ordering

MonoWiki uses a hand-written dispatcher. The title or query is built from every
token **before the first token beginning with `--`**. Put options after the
title/query:

```bash theme={null}
monowiki fetch "인공지능" --lang ko --no-index   # correct
monowiki fetch --lang ko "인공지능"              # fails: empty title
```

There is no command-specific help:

```bash theme={null}
monowiki help fetch       # prints the root guide
monowiki fetch --help     # fails because the title is empty
```

Unknown options are not comprehensively rejected. Use only `--lang <code>` and
`--no-index` in the documented order.

<Note>
  Repository HEAD contains a `docs [topic]` dispatcher for a future build. The
  immutable `0.2.1 / 2026-04-12-113757` payload rejects `docs` with a non-zero
  exit, so it is not part of the current public contract.
</Note>

## Network and Article Identity

`search` uses the selected edition's MediaWiki action API with a fixed limit of
10\. Search snippets pass through a simple tag stripper. `fetch` uses
`https://<lang>.wikipedia.org/api/rest_v1/page/html/<title>` with a required
MonoWiki User-Agent and a 30-second timeout.

The implementation changes spaces to underscores when forming the article
path. It follows normal HTTP redirects, derives the displayed/stored title
from the first Markdown H1 when available, but constructs the stored URL from
the **requested** language and title rather than the final response URL.
Consequently, two aliases that resolve to the same article can remain separate
Monomento documents.

Index replacement compares content at that stored URL. An unchanged fetch is
skipped; changed content replaces it. There is no revision ID, ETag cache,
rate limiter, or retry/backoff state in MonoWiki.

## Language and Evidence Boundary

`--lang <code>` selects the Wikipedia host directly. The default is `en`; an
invalid or unavailable edition fails at the HTTP layer. Articles in two
language editions are independent sources, not assumed literal translations.

Wikipedia is useful for orientation, terminology, and finding citations. It is
not proof of a software release, current runtime, or repository state. Preserve
the article identity, then follow primary citations or compare the claim with
code, runtime, release metadata, and official documentation.

## Read and Write Boundaries

| Operation          | Network |                     Persistent local write |
| ------------------ | ------: | -----------------------------------------: |
| `search`           |     Yes |                                         No |
| `fetch`            |     Yes | Yes, article plus Monomento search records |
| `fetch --no-index` |     Yes |                     No; Markdown on stdout |
| `list`             |      No |                                         No |

Monomento resolves the database through `MONOMENTO_HOME`, the current
`~/.monolex/monomento.db`, and then the legacy Monolex application-support
path. Use Monomento for cross-source search and section reads.

## Published Platforms

| Platform            | Binary         |
| ------------------- | -------------- |
| macOS Apple Silicon | `monowiki`     |
| macOS Intel         | `monowiki`     |
| Linux ARM64         | `monowiki`     |
| Linux x86-64        | `monowiki`     |
| Windows ARM64       | `monowiki.exe` |
| Windows x86-64      | `monowiki.exe` |

These six platform entries come from the immutable CDN release metadata.

## Relationships

| Need                                      | Tool                            |
| ----------------------------------------- | ------------------------------- |
| Wikipedia background                      | **MonoWiki**                    |
| General static websites or official docs  | [MonoFetch](/ai-clis/monofetch) |
| Browser-rendered or authenticated sources | [MonoSurf](/monosurf/index)     |
| RSS, Atom, or JSON Feed entries           | [MonoRSS](/ai-clis/monorss)     |
| Search imported reference material        | [Monomento](/ai-clis/monomento) |
| Join research with code and git evidence  | [MonoFlow](/ai-clis/monoflow)   |
