Metadata-Version: 2.5
Name: clitwy
Version: 2.0.0
Summary: Use MCP and OpenAPI services through named command-line tools or Python.
Project-URL: Repository, https://github.com/twardoch/clitw
License-Expression: Apache-2.0
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: distlib<1,>=0.4; sys_platform == 'win32'
Requires-Dist: filelock>=3.16
Requires-Dist: httpx<1,>=0.28
Requires-Dist: mcp2cli==3.9.0
Requires-Dist: mcp<3,>=2.3
Requires-Dist: platformdirs<6,>=4
Requires-Dist: python-dotenv<2,>=1
Requires-Dist: pyyaml<7,>=6
Description-Content-Type: text/markdown

---
this_file: README.md
---

# clitwy

`clitwy` turns MCP servers and OpenAPI descriptions into named command-line tools. Browse the bundled integrations offline, install the ones you use, and pass provider arguments through to mcp2cli.

```bash
uv tool install clitwy
clitwy catalog openapi
clitwy catalog mcp --json
clitwy openapi install mcx-crates-io-apik
clitwy run crates-io-apik --list --compact
mcx-crates-io-apik get-site-metadata
```

The `mcx-*` console scripts and `clitwy run` use the same bindings. A bundled provider installs on first use. For a single live check, run `clitwy openapi try mcx-crates-io-apik` or `clitwy mcp try NAME` after installation. Use `--help` on either installer or try command for destinations, credentials, report files and custom integrations.

To install a local MCP executable that speaks stdio, give it a name and a path. Quote paths that contain spaces.

```sh
clitwy mcp install --stdio local-server "/path/to/MCP Server"
clitwy run local-server --list --compact
```

`clitwy mcp install` also exports each installed command to `$XDG_BIN_HOME` or `~/.local/bin` on macOS and Linux, and to the Python user scripts directory on Windows. Use `--bin-dir DIR` to choose another export directory.

```python
from clitwy import catalog, run

print(catalog("mcp"))
status = run("crates-io-apik", ["--list", "--compact"])
```

Set `CLITW_HOME` to select a separate installation directory. The default is `$XDG_DATA_HOME/clitw` or `~/.local/share/clitw`. Credentials belong in your environment or a configuration file you control. The bundled service definitions live in [the MCP catalog](src/clitwy/mcp/catalog.json) and [the OpenAPI catalog](src/clitwy/openapi/catalog.json). Bulk OpenAPI installation skips unavailable or invalid schemas and recipes that need a tenant-specific API base. To enable one of those recipes, supply its verified `--base-url` on a named install, then use `clitwy run NAME`. Swagger 2 schemas use the `swagger2openapi` converter, supplied on PATH or through npm.

The auxiliary commands `clitwy groups` and `clitwy doctor` have their own help. Try commands use reviewed reads or discovery.

## Upgrade from the earlier clitw tool

If you already installed the `clitwy` package, run `uv tool upgrade clitwy` and replace `tw` with `clitwy` in your shell scripts.

If you installed this project with uv under its former name `clitw` and uv reports a command conflict, remove that tool before installing `clitwy`. Use the same `CLITW_HOME` as before so both offline migrations can update your existing provider launchers.

```sh
uv tool uninstall clitw
uv tool install clitwy
clitwy openapi install --migrate-names
clitwy mcp install --migrate-names
```

Change Python imports from `clitw` to `clitwy`. Update shell scripts to call `clitwy` in place of `tw`.

## Find a service

`clitwy info` shows service descriptions, links, tags and available pricing. `clitwy search` narrows the list before you install anything. Add `--json` for records keyed by canonical launcher name, or `--md` for a Markdown heading and labeled details for each tool. `clitwy catalog`, `clitwy groups list` and `clitwy groups tag` also take `--md`.

```sh
clitwy info mcx-openai-apik
clitwy search archive
clitwy info mcx-openai-apik --json
clitwy info --data-path
```

The last command prints the location of your optional personal YAML file. Use it to add notes, tags or costs from your own account. For a price comparison, check the currency, billing unit and source of each amount. [Service metadata and personal overlays](src_docs/md/integrations.md#service-metadata)

## Standalone commands and authentication

`mcxadmin-build-mcp` and `mcxadmin-build-openapi` put individual provider commands on your PATH. Provider names end in `-api` or `-mcp`. The final `k` selects key authentication and `o` selects OAuth. A bare suffix identifies a binding without service credentials. Pass one or more catalog names to build a selection, or omit names for the full inventory. On macOS and Linux the default destination is `~/.local/bin` unless you set `XDG_BIN_HOME`. Use `--bin-dir DIR` to choose another directory. Existing commands from another installation are preserved.

```bash
mcxadmin-build-mcp mcx-deepwiki-github-search-mcp
mcx-deepwiki-github-search-mcp --list --compact
mcxadmin-build-openapi mcx-archive-wayback-api
mcx-archive-wayback-api get-wayback-v1-available --url https://example.com/
```

Run `mcxadmin-auth` or `clitwy auth` in a terminal to authorize installed providers. It offers browser sign-in for eligible MCP servers and prompts privately for missing API keys. A provider still controls which accounts, subscriptions and permissions it accepts.

```bash
clitwy auth --list               # Check OAuth and key status without prompting
clitwy auth mcx-pika-mcpo        # Authorize one installed provider
clitwy auth all --skip-through mcx-pika-mcpo  # Resume after Pika
mcxadmin-oauth                    # Browser sign-ins only, one provider at a time
mcxadmin-oauth mcx-pika-mcpo mcx-runway-mcpo        # Select installed MCP providers
clitwy auth keys mcx-openai-apik  # Configure a single provider's API key
clitwy mcp try mcx-pika-mcpo mcx-runway-mcpo       # Verify the connection after signing in
```

Run `clitwy uninstall NAME` to remove a provider's local registration and managed launchers and exclude it from future setup and authorization in the same `CLITW_HOME`.

## Development

```bash
uv run clitwy --help
uv run pytest
uv build
uv run --group docs properdocs build --strict -f src_docs/mkdocs.yaml
```

Agent instructions live in `skills/`. Documentation sources live in `src_docs/md/` and the built site in `docs/`. The package uses hatch-vcs for tag-derived versions. `scripts/auto-gittag-semver` previews the next tag. Its `--apply` option creates that tag locally on a clean commit. clitwy uses [mcp2cli](https://github.com/knowsuchagency/mcp2cli) and follows the [CLI-Anything](https://github.com/HKUDS/CLI-Anything) practice of verifying a tool through its real entry point.
