fere-cli 0.2.3.dev21__tar.gz → 0.3.0.dev23__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.3.dev21 → fere_cli-0.3.0.dev23}/PKG-INFO +2 -2
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/pyproject.toml +2 -2
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/commands/auth.py +2 -64
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/main.py +1 -2
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/.gitignore +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/README.md +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/install.sh +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/__init__.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/async_util.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/banner.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/commands/__init__.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/commands/chat.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/commands/earn.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/commands/hooks.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/commands/limit_order.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/commands/portfolio.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/commands/swap.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/commands/utility.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/config.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/output.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/src/fere_cli/update.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/tests/test_install_sh.py +0 -0
- {fere_cli-0.2.3.dev21 → fere_cli-0.3.0.dev23}/tests/test_update.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fere-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0.dev23
|
|
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.
|
|
9
|
+
Requires-Dist: fere-sdk>=0.3.0.dev23
|
|
10
10
|
Requires-Dist: httpx>=0.27
|
|
11
11
|
Requires-Dist: rich>=13.0
|
|
12
12
|
Provides-Extra: dev
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "fere-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0.dev23"
|
|
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.
|
|
10
|
+
"fere-sdk>=0.3.0.dev23",
|
|
11
11
|
"httpx>=0.27",
|
|
12
12
|
"click>=8.1",
|
|
13
13
|
"rich>=13.0",
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
"""Auth commands: fere auth, fere whoami, fere credits
|
|
1
|
+
"""Auth commands: fere auth, fere whoami, fere credits."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
import dataclasses
|
|
6
|
-
from datetime import datetime
|
|
7
|
-
|
|
8
5
|
import click
|
|
9
6
|
from fere_sdk import FereClient
|
|
10
7
|
from rich.console import Console
|
|
11
8
|
|
|
12
9
|
from ..async_util import async_command, get_client, is_tty
|
|
13
10
|
from ..config import load_config, save_config
|
|
14
|
-
from ..output import
|
|
11
|
+
from ..output import print_error, print_success
|
|
15
12
|
|
|
16
13
|
console = Console()
|
|
17
14
|
|
|
@@ -100,62 +97,3 @@ async def credits(ctx):
|
|
|
100
97
|
except Exception as e:
|
|
101
98
|
print_error(str(e))
|
|
102
99
|
raise SystemExit(1)
|
|
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
|
-
|
|
119
|
-
@click.command(name="claim-daily")
|
|
120
|
-
@click.pass_context
|
|
121
|
-
@async_command
|
|
122
|
-
async def claim_daily_credits(ctx):
|
|
123
|
-
"""Claim your daily credits bonus."""
|
|
124
|
-
try:
|
|
125
|
-
client = await get_client(ctx)
|
|
126
|
-
result = await client.claim_daily_credits()
|
|
127
|
-
await client.close()
|
|
128
|
-
|
|
129
|
-
data = dataclasses.asdict(result)
|
|
130
|
-
if not result.success:
|
|
131
|
-
if result.error == "claim_cooldown":
|
|
132
|
-
msg = (
|
|
133
|
-
"Already claimed today."
|
|
134
|
-
f" Next claim available at"
|
|
135
|
-
f" {_fmt_dt(result.next_claim_available_at)}"
|
|
136
|
-
if result.next_claim_available_at
|
|
137
|
-
else "Already claimed today."
|
|
138
|
-
)
|
|
139
|
-
elif result.error == "balance_too_high":
|
|
140
|
-
bal = result.current_balance
|
|
141
|
-
msg = (
|
|
142
|
-
f"Balance too high to claim (current: {bal} credits)."
|
|
143
|
-
if bal is not None
|
|
144
|
-
else "Balance too high to claim."
|
|
145
|
-
)
|
|
146
|
-
elif result.error == "user_not_found":
|
|
147
|
-
msg = "User not found. Try logging in again."
|
|
148
|
-
else:
|
|
149
|
-
msg = result.error or "Daily claim failed."
|
|
150
|
-
print_error(msg, details=data)
|
|
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
|
-
)
|
|
156
|
-
print_success(data)
|
|
157
|
-
except click.ClickException:
|
|
158
|
-
raise
|
|
159
|
-
except Exception as e:
|
|
160
|
-
print_error(str(e))
|
|
161
|
-
raise SystemExit(1)
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import click
|
|
6
6
|
|
|
7
7
|
from . import __version__
|
|
8
|
-
from .commands.auth import auth,
|
|
8
|
+
from .commands.auth import auth, credits, whoami
|
|
9
9
|
from .commands.chat import chat, threads
|
|
10
10
|
from .commands.earn import earn
|
|
11
11
|
from .commands.hooks import hooks
|
|
@@ -72,7 +72,6 @@ def cli(ctx, output_json, quiet, agent, base_url):
|
|
|
72
72
|
cli.add_command(auth)
|
|
73
73
|
cli.add_command(whoami)
|
|
74
74
|
cli.add_command(credits)
|
|
75
|
-
cli.add_command(claim_daily_credits, name="claim-daily")
|
|
76
75
|
|
|
77
76
|
# Chat
|
|
78
77
|
cli.add_command(chat)
|
|
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
|