CLI
The CLI is the real client — commands you run on the machine that writes strategies. Control is the node's browser UI.
pip install mftik # Python 3.12+; same package as import mftikConnect / identity
mftik connect <url> # authenticate this machine
mftik whoami # which credential (via / key name)
mftik profiles # nodes this machine is connected to
mftik disconnect <name> # forget the key hereconnect tries /health then /api/health, and stores which API base answered. Local compose API is http://localhost:8000; Caddy / quick-start default UI is http://localhost:8080.
--setupclaims an unclaimed node (opt-in; claiming is not undoable from this side).--tokenuses an existing key (CI; only path that needs no tty).- Keys minted by connect are named
mftik-cli@{hostname}. disconnectforgets the key here; the row on the node stays until revoked there.
Profile file: ~/.config/mftik/config.toml (or $XDG_CONFIG_HOME/mftik/config.toml, or MFTIK_CONFIG). Mode 0600. Holds bearer tokens. Which profile: --profile, then MFTIK_PROFILE, then last connect default.
The cookie is never written. What is stored is an mftik_ak_ key, sent as Bearer. A key cannot manage keys — mint and revoke stay in the UI. MFTIK_AUTH_ENABLED=0 issues no key; a profile without a token is normal.
Strategy loop
Scaffold, check, push, and run — see Quick start and Write & publish.
mftik init ./hello
mftik check <path> [cfg] # import gate + on_initialized, offline
mftik push <path> # copy tree into private registry (always origin=private; replaces)
mftik rm <name> # delete by registry name, not path
mftik run <path> [cfg] # push, deploy, tail
mftik ps
mftik logs <session> # -f tails
mftik stop <session>check --againstasksGET /environmentwhether the node has declared extras (does not make check talk for the import itself).pushcopies.pyandstrategy.ymlif present.rmdefaults toorigin=private;--origin publicfor a tree this node published. 409 if a live session is running it.run --no-pushdeploysprivate::{Type}without copying.--no-followprints the session id and exits (CI). Ctrl-C drops the tail and does not stop the session.
Env
mftik env list
mftik env deps
mftik env add <name> # --version optional, --dist when it differs
mftik env approve <dist>
mftik env rm <name>
mftik env import <url> # preview; --confirm installsrequires is checked against the stamp; undeclared extras are refused even if already on sys.path. Detail: Write & publish.
Exit codes
| Code | Meaning |
|---|---|
| 0 | ok |
| 1 | user-fixable |
| 2 | node did not answer |
| 130 | interrupted |
Errors are one line on stderr.
