Tileward / Docs / CLI
Docs · CLI

pip install tileward.

One package is both a Python library and a command line, over the same client. The published name is tileward; the command it installs is twcli.

Install

Three dependencies, no build step.

Python 3.9 or newer. The package pulls httpx, click and rich, and nothing else.

pip install tileward
twcli --version

uv pip install tileward works the same way. The package is MIT licensed, and the source is public.

tileward on PyPI · Full documentation · Source on GitHub

What it covers

All four capabilities, from either side.

The library and the command are two faces of one client, so anything you can script you can also type, and the reverse.

 LibraryCommand
Tileward Models — an OpenAI-compatible chat surfacetw.chat, tw.modelstwcli chat, twcli models
Tileward Governance — a decision before the model writes a tokentw.guardtwcli guard
Tileward Context — recall the slice of history a question needstw.contexttwcli context
Tileward Documents — answers from your own filestw.documentstwcli docs
The account, its API keys and their policiestw.keys, tw.accounttwcli 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

Two of them, 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 a terminal, and no local port is opened, so it works over SSH and inside a container. It is RFC 8628, the device authorization grant.

A key cannot mint a key. That is deliberate: a key with that power would survive its own revocation, because whoever held it could just mint another. So 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.

Where to go next

The reference lives with the package.

Every command and the library 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: tileward-com.github.io/tileward-cli.

Connecting a client instead

If what you want is Tileward inside an editor, a chat client or an agent framework rather than in a terminal, that is a different job: Connect a client has the recipe for each, and the endpoints say which address wants which credential.