# pip install tileward One package is both a Python library and a command line over the same client, covering Tileward Models, Tileward Context, Tileward Governance and Tileward Documents. The published name is `tileward`; the command it installs is `twcli`. This page covers installing it, what it covers, and the two credentials it uses. Page: https://tileward.com/docs/cli/ ## Install Python 3.9 or newer. The package pulls `httpx`, `click` and `rich`. ``` pip install tileward twcli --version ``` - `uv pip install tileward` works the same way. - The package is MIT licensed, and the source is public. ## What it covers | Capability | Library | Command | |---|---|---| | Tileward Models: an OpenAI-compatible chat surface | `tw.chat`, `tw.models` | `twcli chat`, `twcli models` | | Tileward Governance: a decision before the model writes a token | `tw.guard` | `twcli guard` | | Tileward Context: recall the slice of history a question needs | `tw.context` | `twcli context` | | Tileward Documents: answers from your own files | `tw.documents` | `twcli docs` | | The account, its API keys and their policies | `tw.keys`, `tw.account` | `twcli keys`, `twcli account` | ``` # the command twcli chat "Say hello in one sentence." ``` ``` # the library, same client, same credentials from tileward import Tileward tw = Tileward() print(tw.chat.say("Say hello in one sentence.")) ``` ## Credentials There are two, and they are not interchangeable. An API key reaches the model, the guard, Context and Documents. The account itself (keys, billing, policies, audit) needs a signed console session. ``` twcli auth login twcli keys create --label laptop --save ``` - `twcli auth login` prints a code, you approve it in a browser, and the terminal ends up holding a session. No password is typed into the terminal and no local port is opened, so it works over SSH and inside a container. It is [RFC 8628](https://www.rfc-editor.org/rfc/rfc8628), the device authorization grant. - A key cannot mint a key: the session mints, and the key does the work. - Governance also needs a policy bound to the key, set in the console under Settings → API keys. A key with no policy refuses nothing. ## Reference The command list, the Python API, profiles and configuration, exit codes and errors, and calling Tileward from an OpenAI-compatible client are all on the package's own documentation site. ## Related - [Full documentation](https://tileward-com.github.io/tileward-cli/): every command and the library reference - [tileward on PyPI](https://pypi.org/project/tileward/): the published package - [Source on GitHub](https://github.com/Tileward-com/tileward-cli): the public source - [Connect a client](https://tileward.com/docs/): recipes for editors, chat clients and agent frameworks - [Endpoints](https://tileward.com/docs/#endpoints): which address wants which credential