talis-cli 0.1.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. talis_cli-0.1.0a1/PKG-INFO +99 -0
  2. talis_cli-0.1.0a1/README.md +72 -0
  3. talis_cli-0.1.0a1/pyproject.toml +67 -0
  4. talis_cli-0.1.0a1/setup.cfg +4 -0
  5. talis_cli-0.1.0a1/talis/__init__.py +3 -0
  6. talis_cli-0.1.0a1/talis/api.py +470 -0
  7. talis_cli-0.1.0a1/talis/cli.py +70 -0
  8. talis_cli-0.1.0a1/talis/commands/__init__.py +1 -0
  9. talis_cli-0.1.0a1/talis/commands/_shared.py +152 -0
  10. talis_cli-0.1.0a1/talis/commands/auth.py +580 -0
  11. talis_cli-0.1.0a1/talis/commands/outcome.py +176 -0
  12. talis_cli-0.1.0a1/talis/commands/portfolio.py +153 -0
  13. talis_cli-0.1.0a1/talis/commands/snapshot.py +266 -0
  14. talis_cli-0.1.0a1/talis/commands/strategies.py +118 -0
  15. talis_cli-0.1.0a1/talis/commands/test_tenant.py +212 -0
  16. talis_cli-0.1.0a1/talis/commands/trade.py +168 -0
  17. talis_cli-0.1.0a1/talis/commands/wait.py +378 -0
  18. talis_cli-0.1.0a1/talis/config.py +160 -0
  19. talis_cli-0.1.0a1/talis/output.py +99 -0
  20. talis_cli-0.1.0a1/talis/paper.py +44 -0
  21. talis_cli-0.1.0a1/talis/symbols.py +63 -0
  22. talis_cli-0.1.0a1/talis_cli.egg-info/PKG-INFO +99 -0
  23. talis_cli-0.1.0a1/talis_cli.egg-info/SOURCES.txt +36 -0
  24. talis_cli-0.1.0a1/talis_cli.egg-info/dependency_links.txt +1 -0
  25. talis_cli-0.1.0a1/talis_cli.egg-info/entry_points.txt +2 -0
  26. talis_cli-0.1.0a1/talis_cli.egg-info/requires.txt +9 -0
  27. talis_cli-0.1.0a1/talis_cli.egg-info/top_level.txt +1 -0
  28. talis_cli-0.1.0a1/tests/test_api.py +189 -0
  29. talis_cli-0.1.0a1/tests/test_commands.py +292 -0
  30. talis_cli-0.1.0a1/tests/test_config.py +166 -0
  31. talis_cli-0.1.0a1/tests/test_login_flow.py +162 -0
  32. talis_cli-0.1.0a1/tests/test_loopback_login.py +215 -0
  33. talis_cli-0.1.0a1/tests/test_non_interactive_auth.py +260 -0
  34. talis_cli-0.1.0a1/tests/test_outcome.py +132 -0
  35. talis_cli-0.1.0a1/tests/test_paper_mode.py +169 -0
  36. talis_cli-0.1.0a1/tests/test_snapshot_diff.py +222 -0
  37. talis_cli-0.1.0a1/tests/test_test_tenant.py +235 -0
  38. talis_cli-0.1.0a1/tests/test_wait.py +264 -0
@@ -0,0 +1,99 @@
1
+ Metadata-Version: 2.4
2
+ Name: talis-cli
3
+ Version: 0.1.0a1
4
+ Summary: Command-line client for the Talis trading platform. Sign in via device flow, manage sessions, view portfolio, place orders.
5
+ Author: Talis
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://talis.trade
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Topic :: Office/Business :: Financial :: Investment
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ Requires-Dist: httpx>=0.27
20
+ Requires-Dist: typer>=0.12
21
+ Requires-Dist: rich>=13
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=8; extra == "dev"
24
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
25
+ Requires-Dist: respx>=0.21; extra == "dev"
26
+ Requires-Dist: ruff>=0.6; extra == "dev"
27
+
28
+ # talis-cli
29
+
30
+ Command-line client for the [Talis](https://talis.trade) trading platform.
31
+
32
+ ```bash
33
+ pip install talis-cli
34
+
35
+ talis login # device flow — opens a browser, you approve
36
+ talis approve ABCD-EFGH # approve another login from this signed-in CLI
37
+ talis whoami # shows current session
38
+ talis portfolio # balance + open positions
39
+
40
+ talis buy BTC-USD 25 # market buy $25 of BTC
41
+ talis close BTC-USD # close 100% of the BTC position
42
+
43
+ talis outcome list # browse live HIP-4 outcome (prediction) markets
44
+ talis outcome buy 100 yes 11 # buy $11 of the YES side of outcome 100 (#1000)
45
+ talis outcome close 100 yes 25 # sell 25 YES shares of outcome 100
46
+
47
+ talis sessions # list active sessions (Connected Devices)
48
+ talis sessions revoke ab12 # revoke a session by short prefix
49
+ talis logout # revoke the current session
50
+ ```
51
+
52
+ By default the CLI targets AWS production at `https://api-aws.jarvis.trade`.
53
+ Set `TALIS_ENV=render` only when intentionally auditing the legacy Render
54
+ deployment, or set `TALIS_API_URL` to override the endpoint completely.
55
+
56
+ ## Read-only sessions
57
+
58
+ For automation, scripts, or letting an LLM browse your account without
59
+ authority to trade, request a `read` scope at login:
60
+
61
+ ```bash
62
+ talis login --read-only
63
+ ```
64
+
65
+ Read-scope sessions are denied (`403`) on every endpoint that mutates orders,
66
+ positions, strategies, or wallets — enforced server-side at the API layer.
67
+ When approving a login with `talis approve`, the approving session's scope is
68
+ also enforced: a read-only session can only approve read-only CLI access.
69
+
70
+ ## Output mode
71
+
72
+ When stdout is a TTY (interactive shell), commands render with rich formatting.
73
+ When stdout is piped or redirected, commands emit one JSON object per line —
74
+ suitable for parsing from scripts or LLM agents. Force JSON anywhere with
75
+ `--json`.
76
+
77
+ ## Credentials
78
+
79
+ The CLI stores its session token at `~/.talis/credentials` with `chmod 600`
80
+ on POSIX systems. The token is a JWT; treat it like any other credential.
81
+
82
+ ## Relationship to `cli/jarvis_cli.sh`
83
+
84
+ The bash script at [`cli/jarvis_cli.sh`](../../cli/jarvis_cli.sh) is the legacy
85
+ engineer power tool — admin-keyed, POSIX-only, prose output. It still works
86
+ and isn't going anywhere short-term.
87
+
88
+ **talis-cli is the going-forward client.** All new features (device-flow auth,
89
+ per-user credentials, JSON output, scope-aware sessions, future commands)
90
+ land here. The bash CLI will be archived once talis-cli reaches feature
91
+ parity for admin/engineer workflows.
92
+
93
+ If you're a Talis engineer with the admin API key, you can keep using either.
94
+ If you're a public user or driving the API from an LLM / script, use this one.
95
+
96
+ ## Status
97
+
98
+ Alpha. APIs may shift. File issues at the
99
+ [Talis trading engine repo](https://github.com/Jarvis-Trade/jarvis-trading-engine).
@@ -0,0 +1,72 @@
1
+ # talis-cli
2
+
3
+ Command-line client for the [Talis](https://talis.trade) trading platform.
4
+
5
+ ```bash
6
+ pip install talis-cli
7
+
8
+ talis login # device flow — opens a browser, you approve
9
+ talis approve ABCD-EFGH # approve another login from this signed-in CLI
10
+ talis whoami # shows current session
11
+ talis portfolio # balance + open positions
12
+
13
+ talis buy BTC-USD 25 # market buy $25 of BTC
14
+ talis close BTC-USD # close 100% of the BTC position
15
+
16
+ talis outcome list # browse live HIP-4 outcome (prediction) markets
17
+ talis outcome buy 100 yes 11 # buy $11 of the YES side of outcome 100 (#1000)
18
+ talis outcome close 100 yes 25 # sell 25 YES shares of outcome 100
19
+
20
+ talis sessions # list active sessions (Connected Devices)
21
+ talis sessions revoke ab12 # revoke a session by short prefix
22
+ talis logout # revoke the current session
23
+ ```
24
+
25
+ By default the CLI targets AWS production at `https://api-aws.jarvis.trade`.
26
+ Set `TALIS_ENV=render` only when intentionally auditing the legacy Render
27
+ deployment, or set `TALIS_API_URL` to override the endpoint completely.
28
+
29
+ ## Read-only sessions
30
+
31
+ For automation, scripts, or letting an LLM browse your account without
32
+ authority to trade, request a `read` scope at login:
33
+
34
+ ```bash
35
+ talis login --read-only
36
+ ```
37
+
38
+ Read-scope sessions are denied (`403`) on every endpoint that mutates orders,
39
+ positions, strategies, or wallets — enforced server-side at the API layer.
40
+ When approving a login with `talis approve`, the approving session's scope is
41
+ also enforced: a read-only session can only approve read-only CLI access.
42
+
43
+ ## Output mode
44
+
45
+ When stdout is a TTY (interactive shell), commands render with rich formatting.
46
+ When stdout is piped or redirected, commands emit one JSON object per line —
47
+ suitable for parsing from scripts or LLM agents. Force JSON anywhere with
48
+ `--json`.
49
+
50
+ ## Credentials
51
+
52
+ The CLI stores its session token at `~/.talis/credentials` with `chmod 600`
53
+ on POSIX systems. The token is a JWT; treat it like any other credential.
54
+
55
+ ## Relationship to `cli/jarvis_cli.sh`
56
+
57
+ The bash script at [`cli/jarvis_cli.sh`](../../cli/jarvis_cli.sh) is the legacy
58
+ engineer power tool — admin-keyed, POSIX-only, prose output. It still works
59
+ and isn't going anywhere short-term.
60
+
61
+ **talis-cli is the going-forward client.** All new features (device-flow auth,
62
+ per-user credentials, JSON output, scope-aware sessions, future commands)
63
+ land here. The bash CLI will be archived once talis-cli reaches feature
64
+ parity for admin/engineer workflows.
65
+
66
+ If you're a Talis engineer with the admin API key, you can keep using either.
67
+ If you're a public user or driving the API from an LLM / script, use this one.
68
+
69
+ ## Status
70
+
71
+ Alpha. APIs may shift. File issues at the
72
+ [Talis trading engine repo](https://github.com/Jarvis-Trade/jarvis-trading-engine).
@@ -0,0 +1,67 @@
1
+ [project]
2
+ name = "talis-cli"
3
+ version = "0.1.0a1"
4
+ description = "Command-line client for the Talis trading platform. Sign in via device flow, manage sessions, view portfolio, place orders."
5
+ readme = "README.md"
6
+ license = "Apache-2.0"
7
+ requires-python = ">=3.10"
8
+ authors = [
9
+ {name = "Talis"}
10
+ ]
11
+ classifiers = [
12
+ "Development Status :: 3 - Alpha",
13
+ "Environment :: Console",
14
+ "Intended Audience :: Developers",
15
+ "Programming Language :: Python :: 3 :: Only",
16
+ "Programming Language :: Python :: 3.10",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Topic :: Office/Business :: Financial :: Investment",
21
+ ]
22
+
23
+ dependencies = [
24
+ # Small, well-known deps. The CLI is meant to be `pip install`-able by
25
+ # end users (including LLMs and their hosts), so we keep the surface
26
+ # area tight.
27
+ "httpx>=0.27",
28
+ "typer>=0.12",
29
+ "rich>=13", # pretty TTY rendering; we degrade to JSON when stdout is piped
30
+ ]
31
+
32
+ [project.optional-dependencies]
33
+ dev = [
34
+ "pytest>=8",
35
+ "pytest-asyncio>=0.23",
36
+ "respx>=0.21", # httpx response mocking for fake-control-plane tests
37
+ "ruff>=0.6",
38
+ ]
39
+
40
+ [project.scripts]
41
+ talis = "talis.cli:main"
42
+
43
+ [project.urls]
44
+ Homepage = "https://talis.trade"
45
+
46
+ [build-system]
47
+ requires = ["setuptools>=68", "wheel"]
48
+ build-backend = "setuptools.build_meta"
49
+
50
+ [tool.setuptools.packages.find]
51
+ where = ["."]
52
+ include = ["talis*"]
53
+
54
+ [tool.ruff]
55
+ line-length = 100
56
+ target-version = "py310"
57
+
58
+ [tool.ruff.lint]
59
+ select = ["E", "F", "I", "B", "SIM", "UP", "W"]
60
+ ignore = [
61
+ "E501", # line-too-long — let rich-rendered help text breathe
62
+ "B904", # raise … from None — typer.Exit is control flow, not a chained error
63
+ ]
64
+
65
+ [tool.pytest.ini_options]
66
+ asyncio_mode = "auto"
67
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """Talis command-line client."""
2
+
3
+ __version__ = "0.1.0a1"