fere-cli 0.2.1__tar.gz → 0.2.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.
- {fere_cli-0.2.1 → fere_cli-0.2.3}/PKG-INFO +3 -2
- {fere_cli-0.2.1 → fere_cli-0.2.3}/pyproject.toml +3 -2
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/commands/auth.py +22 -2
- {fere_cli-0.2.1 → fere_cli-0.2.3}/.gitignore +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/README.md +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/install.sh +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/__init__.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/async_util.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/banner.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/commands/__init__.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/commands/chat.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/commands/earn.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/commands/hooks.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/commands/limit_order.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/commands/portfolio.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/commands/swap.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/commands/utility.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/config.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/main.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/output.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/src/fere_cli/update.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/tests/test_install_sh.py +0 -0
- {fere_cli-0.2.1 → fere_cli-0.2.3}/tests/test_update.py +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fere-cli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Terminal CLI for FereAI crypto trading and research
|
|
5
5
|
Author-email: Fere AI <info@fere.ai>
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Requires-Python: >=3.10
|
|
8
8
|
Requires-Dist: click>=8.1
|
|
9
|
-
Requires-Dist: fere-sdk>=0.2.
|
|
9
|
+
Requires-Dist: fere-sdk>=0.2.2
|
|
10
|
+
Requires-Dist: httpx>=0.27
|
|
10
11
|
Requires-Dist: rich>=13.0
|
|
11
12
|
Provides-Extra: dev
|
|
12
13
|
Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "fere-cli"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.3"
|
|
4
4
|
description = "Terminal CLI for FereAI crypto trading and research"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
7
7
|
license = "MIT"
|
|
8
8
|
authors = [{ name = "Fere AI", email = "info@fere.ai" }]
|
|
9
9
|
dependencies = [
|
|
10
|
-
"fere-sdk>=0.2.
|
|
10
|
+
"fere-sdk>=0.2.2",
|
|
11
|
+
"httpx>=0.27",
|
|
11
12
|
"click>=8.1",
|
|
12
13
|
"rich>=13.0",
|
|
13
14
|
]
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import dataclasses
|
|
6
|
+
from datetime import datetime
|
|
6
7
|
|
|
7
8
|
import click
|
|
8
9
|
from fere_sdk import FereClient
|
|
@@ -10,7 +11,7 @@ from rich.console import Console
|
|
|
10
11
|
|
|
11
12
|
from ..async_util import async_command, get_client, is_tty
|
|
12
13
|
from ..config import load_config, save_config
|
|
13
|
-
from ..output import print_error, print_success
|
|
14
|
+
from ..output import is_json_mode, print_error, print_success
|
|
14
15
|
|
|
15
16
|
console = Console()
|
|
16
17
|
|
|
@@ -101,6 +102,20 @@ async def credits(ctx):
|
|
|
101
102
|
raise SystemExit(1)
|
|
102
103
|
|
|
103
104
|
|
|
105
|
+
def _fmt_dt(value: str | None) -> str:
|
|
106
|
+
"""Format an ISO 8601 UTC datetime string in the local timezone."""
|
|
107
|
+
if not value:
|
|
108
|
+
return ""
|
|
109
|
+
try:
|
|
110
|
+
dt = datetime.fromisoformat(value.replace("Z", "+00:00")).astimezone()
|
|
111
|
+
tz_name = dt.strftime("%Z") or dt.strftime("%z")
|
|
112
|
+
return (dt.strftime("%b %d, %Y at %I:%M %p ") + tz_name).replace(
|
|
113
|
+
" 0", " "
|
|
114
|
+
)
|
|
115
|
+
except ValueError:
|
|
116
|
+
return value
|
|
117
|
+
|
|
118
|
+
|
|
104
119
|
@click.command(name="claim-daily")
|
|
105
120
|
@click.pass_context
|
|
106
121
|
@async_command
|
|
@@ -116,7 +131,8 @@ async def claim_daily_credits(ctx):
|
|
|
116
131
|
if result.error == "claim_cooldown":
|
|
117
132
|
msg = (
|
|
118
133
|
"Already claimed today."
|
|
119
|
-
f" Next claim available at
|
|
134
|
+
f" Next claim available at"
|
|
135
|
+
f" {_fmt_dt(result.next_claim_available_at)}"
|
|
120
136
|
if result.next_claim_available_at
|
|
121
137
|
else "Already claimed today."
|
|
122
138
|
)
|
|
@@ -133,6 +149,10 @@ async def claim_daily_credits(ctx):
|
|
|
133
149
|
msg = result.error or "Daily claim failed."
|
|
134
150
|
print_error(msg, details=data)
|
|
135
151
|
raise SystemExit(1)
|
|
152
|
+
if not is_json_mode() and data.get("next_claim_available_at"):
|
|
153
|
+
data["next_claim_available_at"] = _fmt_dt(
|
|
154
|
+
data["next_claim_available_at"]
|
|
155
|
+
)
|
|
136
156
|
print_success(data)
|
|
137
157
|
except click.ClickException:
|
|
138
158
|
raise
|
|
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
|