Metadata-Version: 2.4
Name: tickwire-cli
Version: 0.1.0
Summary: Tickwire CLI: sign in, create a sandbox, list accounts, trade with a reason and a truthful outcome, and forward webhooks to localhost, for the Tickwire MT4/MT5 cloud API.
Author-email: Tickwire <hello@tickwire.io>
License-Expression: MIT
Project-URL: Homepage, https://tickwire.io/
Project-URL: Documentation, https://tickwire.io/docs/cli/
Project-URL: Changelog, https://tickwire.io/docs/changelog/
Keywords: metatrader,mt4,mt5,trading,api,cli,webhooks
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tickwire<0.2,>=0.1.0
Requires-Dist: httpx<1,>=0.27
Provides-Extra: keyring
Requires-Dist: keyring<26,>=24; extra == "keyring"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Dynamic: license-file

# tickwire-cli

The `tickwire` command for the Tickwire MT4/MT5 cloud API, built on the
[`tickwire` Python SDK](https://tickwire.io/docs/sdk-python/).

**Not published yet.** `pip install tickwire-cli` won't find it. Install from source, from the
repository root (the SDK first, because the CLI needs it):

```sh
pip install ./sdk/python ./cli
```

Once it is published:

```sh
pip install tickwire-cli            # or "tickwire-cli[keyring]" to keep keys in the OS keychain
```

Python 3.11 or newer. MIT licensed.

## Quick start

A free sandbox (no sign-in, no card) against the public API:

```sh
export TICKWIRE_SANDBOX_URL=https://api.tickwire.io
tickwire sandbox create             # one simulated MT5 account; the key is stored, never printed
tickwire --sandbox accounts list
tickwire --sandbox trade open <account-id> --side buy --symbol EURUSD --volume 0.01 --reason "test"
```

With your own API key:

```sh
export TICKWIRE_API_URL=https://api.tickwire.io
tickwire login                      # hidden prompt; the key is checked, then stored
tickwire accounts list
tickwire listen --forward-to http://localhost:3000/webhooks
tickwire trigger trade.outcome
tickwire logs tail -f --status errors     # your request log, new calls as they happen
```

The sandbox key from `sandbox create` is restricted: it can manage accounts,
trade and read, but not use webhooks (`listen`, `trigger`). For those, use your
own key, or a sandbox key made from it (`POST /v1/sandbox/keys`) with
`tickwire login --sandbox`.

## Commands

- `login`: the key comes from a hidden prompt or stdin, never from an argument, and is never
  printed. It is stored in the OS keychain or in a `0600` file.
- `trade open|close`: `--reason` is mandatory and an `Idempotency-Key` is sent automatically.
  The result is `applied`, `no_change`, `rejected`, `held` or `unknown` (exit codes 0, 0, 3,
  4, 5). An `unknown` result is never retried.
- `listen --forward-to`: events are signed by the server, verified by the CLI, then forwarded
  byte for byte.
- `logs tail`: your request log, oldest first, `--follow` for new calls. Redacted bodies of
  failed calls only with `--bodies`, and only when the API returns them to your key. Waits for
  `Retry-After` on `429`.
- `--json` works with every command.

Full documentation: [tickwire.io/docs/cli](https://tickwire.io/docs/cli/).
