o2-cli 0.1.2__tar.gz → 0.1.3__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.
- {o2_cli-0.1.2 → o2_cli-0.1.3}/PKG-INFO +1 -1
- o2_cli-0.1.3/o2_cli/__init__.py +42 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli.egg-info/PKG-INFO +1 -1
- {o2_cli-0.1.2 → o2_cli-0.1.3}/pyproject.toml +1 -1
- o2_cli-0.1.2/o2_cli/__init__.py +0 -30
- {o2_cli-0.1.2 → o2_cli-0.1.3}/LICENSE +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/README.md +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/__main__.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/api_sync.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/cli.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/client.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/__init__.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/_helpers.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/account.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/admin.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/auth.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/balance.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/deposits.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/fees.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/markets.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/mm.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/notifications.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/orders.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/positions.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/settings.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/setup_cmd.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/trades.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/commands/withdrawals.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/config.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/exceptions.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/output.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/self_update.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli/setup.py +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli.egg-info/SOURCES.txt +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli.egg-info/dependency_links.txt +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli.egg-info/entry_points.txt +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli.egg-info/requires.txt +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/o2_cli.egg-info/top_level.txt +0 -0
- {o2_cli-0.1.2 → o2_cli-0.1.3}/setup.cfg +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""O2 CLI - Command-line interface for O2 DEX Trading Platform."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
__version__ = "0.1.3"
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def ensure_skill_installed() -> bool:
|
|
9
|
+
"""自动安装或更新 Claude Code Skill 到 ~/.claude/skills/o2-cli/。
|
|
10
|
+
|
|
11
|
+
首次运行时安装。CLI 升级后自动刷新 skill 内容。
|
|
12
|
+
|
|
13
|
+
Returns:
|
|
14
|
+
True 如果 skill 已存在或刚安装成功,False 如果安装失败。
|
|
15
|
+
"""
|
|
16
|
+
skill_dir = Path.home() / ".claude" / "skills" / "o2-cli"
|
|
17
|
+
skill_file = skill_dir / "SKILL.md"
|
|
18
|
+
version_file = skill_dir / ".version"
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
from o2_cli.setup import SKILL_CONTENT
|
|
22
|
+
|
|
23
|
+
# Check if skill needs update (missing or version mismatch)
|
|
24
|
+
current_version = __version__
|
|
25
|
+
installed_version = ""
|
|
26
|
+
if version_file.exists():
|
|
27
|
+
installed_version = version_file.read_text(encoding="utf-8").strip()
|
|
28
|
+
|
|
29
|
+
needs_update = (
|
|
30
|
+
not skill_file.exists()
|
|
31
|
+
or installed_version != current_version
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
if not needs_update:
|
|
35
|
+
return True
|
|
36
|
+
|
|
37
|
+
skill_dir.mkdir(parents=True, exist_ok=True)
|
|
38
|
+
skill_file.write_text(SKILL_CONTENT, encoding="utf-8")
|
|
39
|
+
version_file.write_text(current_version, encoding="utf-8")
|
|
40
|
+
return True
|
|
41
|
+
except OSError:
|
|
42
|
+
return False
|
o2_cli-0.1.2/o2_cli/__init__.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"""O2 CLI - Command-line interface for O2 DEX Trading Platform."""
|
|
2
|
-
|
|
3
|
-
from pathlib import Path
|
|
4
|
-
|
|
5
|
-
__version__ = "0.1.2"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
def ensure_skill_installed() -> bool:
|
|
9
|
-
"""自动安装 Claude Code Skill 到 ~/.claude/skills/o2-cli/。
|
|
10
|
-
|
|
11
|
-
首次运行 o2 命令时检查并安装。不覆盖已有文件(用户可能自定义过)。
|
|
12
|
-
|
|
13
|
-
Returns:
|
|
14
|
-
True 如果 skill 已存在或刚安装成功,False 如果安装失败。
|
|
15
|
-
"""
|
|
16
|
-
skill_dir = Path.home() / ".claude" / "skills" / "o2-cli"
|
|
17
|
-
skill_file = skill_dir / "SKILL.md"
|
|
18
|
-
|
|
19
|
-
if skill_file.exists():
|
|
20
|
-
return True
|
|
21
|
-
|
|
22
|
-
try:
|
|
23
|
-
from o2_cli.setup import SKILL_CONTENT
|
|
24
|
-
|
|
25
|
-
skill_dir.mkdir(parents=True, exist_ok=True)
|
|
26
|
-
skill_file.write_text(SKILL_CONTENT, encoding="utf-8")
|
|
27
|
-
return True
|
|
28
|
-
except OSError:
|
|
29
|
-
# 权限不足或其他 IO 错误,静默失败不影响 CLI 使用
|
|
30
|
-
return False
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|