nexus-agent-cli 0.1.0__tar.gz → 0.2.0__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.
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/.gitignore +1 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/PKG-INFO +18 -3
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/README.md +17 -2
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/api_client.py +12 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/commands/run/cmd.py +22 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/pyproject.toml +1 -1
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/__init__.py +0 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/__main__.py +0 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/auth_pkce.py +0 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/commands/__init__.py +0 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/commands/auth/__init__.py +0 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/commands/auth/cmd.py +0 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/commands/run/__init__.py +0 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/config.py +0 -0
- {nexus_agent_cli-0.1.0 → nexus_agent_cli-0.2.0}/nexus_agent_cli/main.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nexus-agent-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Nexus internal agent ops CLI — pull run params, push analysis results, send notifications. Admin only.
|
|
5
5
|
Requires-Python: >=3.10
|
|
6
6
|
Requires-Dist: httpx>=0.27
|
|
@@ -20,8 +20,14 @@ Nexus **内部** agent 运维 CLI。用于把"每周分析任务"从 AWS 跑逐
|
|
|
20
20
|
## 安装
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
pip install nexus-agent-cli
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
本地开发(可编辑安装):
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
git clone https://github.com/lookatwallstreet/nexus-agent-cli.git
|
|
30
|
+
cd nexus-agent-cli && pip install -e .
|
|
25
31
|
```
|
|
26
32
|
|
|
27
33
|
## 登录(一次)
|
|
@@ -81,6 +87,15 @@ NEXUS_AGENT_API_BASE_URL=http://127.0.0.1:8000/api nexus-agent run-config
|
|
|
81
87
|
`run-config/`、`upload/market-analysis/`、`upload/portfolio-recommendation/`、
|
|
82
88
|
`upload/backtest/`、`notify/`。
|
|
83
89
|
|
|
90
|
+
## 发布新版本
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# 1. 改 pyproject.toml 的 version
|
|
94
|
+
# 2. 构建并发布到 PyPI(用 .zshrc 里的 UV_PUBLISH_PASSWORD all-projects token)
|
|
95
|
+
rm -rf dist && python -m build
|
|
96
|
+
TWINE_USERNAME=__token__ TWINE_PASSWORD="$UV_PUBLISH_PASSWORD" twine upload dist/*
|
|
97
|
+
```
|
|
98
|
+
|
|
84
99
|
## 迁移说明
|
|
85
100
|
|
|
86
101
|
当前 AWS(EventBridge → ECS Fargate)的每周定时运行**保持不变**。本 CLI 提供并行的
|
|
@@ -9,8 +9,14 @@ Nexus **内部** agent 运维 CLI。用于把"每周分析任务"从 AWS 跑逐
|
|
|
9
9
|
## 安装
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
pip install nexus-agent-cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
本地开发(可编辑安装):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git clone https://github.com/lookatwallstreet/nexus-agent-cli.git
|
|
19
|
+
cd nexus-agent-cli && pip install -e .
|
|
14
20
|
```
|
|
15
21
|
|
|
16
22
|
## 登录(一次)
|
|
@@ -70,6 +76,15 @@ NEXUS_AGENT_API_BASE_URL=http://127.0.0.1:8000/api nexus-agent run-config
|
|
|
70
76
|
`run-config/`、`upload/market-analysis/`、`upload/portfolio-recommendation/`、
|
|
71
77
|
`upload/backtest/`、`notify/`。
|
|
72
78
|
|
|
79
|
+
## 发布新版本
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# 1. 改 pyproject.toml 的 version
|
|
83
|
+
# 2. 构建并发布到 PyPI(用 .zshrc 里的 UV_PUBLISH_PASSWORD all-projects token)
|
|
84
|
+
rm -rf dist && python -m build
|
|
85
|
+
TWINE_USERNAME=__token__ TWINE_PASSWORD="$UV_PUBLISH_PASSWORD" twine upload dist/*
|
|
86
|
+
```
|
|
87
|
+
|
|
73
88
|
## 迁移说明
|
|
74
89
|
|
|
75
90
|
当前 AWS(EventBridge → ECS Fargate)的每周定时运行**保持不变**。本 CLI 提供并行的
|
|
@@ -48,6 +48,18 @@ def get_run_config(tickers: str | None = None) -> Any:
|
|
|
48
48
|
return get_json("/nexus-agent/run-config/", params=params)
|
|
49
49
|
|
|
50
50
|
|
|
51
|
+
def get_strategy_data(
|
|
52
|
+
ticker: str, start_date: str | None = None, end_date: str | None = None
|
|
53
|
+
) -> Any:
|
|
54
|
+
"""GET /nexus-agent/strategy-data/ — strategy trigger rows (Sheets creds stay server-side)."""
|
|
55
|
+
params: dict[str, Any] = {"ticker": ticker}
|
|
56
|
+
if start_date:
|
|
57
|
+
params["start_date"] = start_date
|
|
58
|
+
if end_date:
|
|
59
|
+
params["end_date"] = end_date
|
|
60
|
+
return get_json("/nexus-agent/strategy-data/", params=params)
|
|
61
|
+
|
|
62
|
+
|
|
51
63
|
def upload_market_analysis(ticker: str, content: str, language: str = "zh") -> Any:
|
|
52
64
|
"""POST /nexus-agent/upload/market-analysis/"""
|
|
53
65
|
return post_json(
|
|
@@ -30,6 +30,28 @@ def register(app: typer.Typer) -> None:
|
|
|
30
30
|
_run_err(e)
|
|
31
31
|
console.print(JSON(json.dumps(data)))
|
|
32
32
|
|
|
33
|
+
@app.command(
|
|
34
|
+
"strategy-data",
|
|
35
|
+
help="Pull strategy trigger rows for one ticker (Sheets creds stay server-side).",
|
|
36
|
+
)
|
|
37
|
+
def strategy_data(
|
|
38
|
+
ticker: str = typer.Option(..., "--ticker", help="tqqq / soxl / ibit."),
|
|
39
|
+
start: str = typer.Option(None, "--start", help="Start date YYYY-MM-DD (optional)."),
|
|
40
|
+
end: str = typer.Option(None, "--end", help="End date YYYY-MM-DD (optional)."),
|
|
41
|
+
out: Path = typer.Option(
|
|
42
|
+
None, "--out", help="Write the JSON response to this file instead of stdout."
|
|
43
|
+
),
|
|
44
|
+
) -> None:
|
|
45
|
+
try:
|
|
46
|
+
data = api_client.get_strategy_data(ticker, start_date=start, end_date=end)
|
|
47
|
+
except Exception as e:
|
|
48
|
+
_run_err(e)
|
|
49
|
+
if out is not None:
|
|
50
|
+
out.write_text(json.dumps(data, ensure_ascii=False, indent=2), encoding="utf-8")
|
|
51
|
+
console.print(f"[green]已保存 {data.get('count')} 行 →[/green] {out}")
|
|
52
|
+
else:
|
|
53
|
+
console.print(JSON(json.dumps(data)))
|
|
54
|
+
|
|
33
55
|
@app.command(
|
|
34
56
|
"push-market-analysis", help="Upload a market analysis markdown report for one ticker."
|
|
35
57
|
)
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "nexus-agent-cli"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.2.0"
|
|
8
8
|
description = "Nexus internal agent ops CLI — pull run params, push analysis results, send notifications. Admin only."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.10"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|