grains-cli 0.2.0__tar.gz → 0.2.1__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.
- {grains_cli-0.2.0 → grains_cli-0.2.1}/PKG-INFO +1 -1
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/deploy.py +22 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/main.py +5 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli.egg-info/PKG-INFO +1 -1
- {grains_cli-0.2.0 → grains_cli-0.2.1}/pyproject.toml +1 -1
- {grains_cli-0.2.0 → grains_cli-0.2.1}/LICENSE +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/README.md +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/__init__.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/apiclient.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/dev.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/init.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/login.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/pay.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/ship.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/templates.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli/verify.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli.egg-info/SOURCES.txt +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli.egg-info/dependency_links.txt +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli.egg-info/entry_points.txt +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli.egg-info/requires.txt +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/grains_cli.egg-info/top_level.txt +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/setup.cfg +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/tests/test_deploy.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/tests/test_dev.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/tests/test_init.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/tests/test_init_node.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/tests/test_pay.py +0 -0
- {grains_cli-0.2.0 → grains_cli-0.2.1}/tests/test_verify.py +0 -0
|
@@ -78,3 +78,25 @@ def cmd_agents(args: argparse.Namespace) -> int:
|
|
|
78
78
|
vis = "public" if a.get("public") else "private"
|
|
79
79
|
print(f"{a['name']:<24} {a.get('status', ''):<8} {vis}{price}")
|
|
80
80
|
return 0
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def cmd_balance(args: argparse.Namespace) -> int:
|
|
84
|
+
client = _client_or_exit(args)
|
|
85
|
+
try:
|
|
86
|
+
data = client._req("GET", "/v1/balance")
|
|
87
|
+
except GrainsAPIError as e:
|
|
88
|
+
print(f"error: {e}", file=sys.stderr)
|
|
89
|
+
return 1
|
|
90
|
+
agents = data.get("agents", [])
|
|
91
|
+
if not agents:
|
|
92
|
+
print("No paid calls yet. Set a price with `grains_set_price` in Claude "
|
|
93
|
+
"or from the dashboard, and this fills up.")
|
|
94
|
+
return 0
|
|
95
|
+
cur = data.get("currency", "USDC")
|
|
96
|
+
print(f"{'agent':<24} {'calls':>6} {'gross':>12} {'fee':>10} {'net':>12}")
|
|
97
|
+
for a in agents:
|
|
98
|
+
print(f"{a['agent']:<24} {a['calls']:>6} {a['gross']:>12} {a['fee']:>10} {a['net']:>12}")
|
|
99
|
+
t = data["total"]
|
|
100
|
+
print("-" * 68)
|
|
101
|
+
print(f"{'total':<24} {'':>6} {t['gross']:>12} {t['fee']:>10} {t['net']:>12} {cur}")
|
|
102
|
+
return 0
|
|
@@ -70,6 +70,11 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
70
70
|
p_logs.add_argument("--api")
|
|
71
71
|
p_logs.set_defaults(func=deploy_cmd.cmd_logs)
|
|
72
72
|
|
|
73
|
+
p_balance = sub.add_parser("balance", help="earnings across your paid agents")
|
|
74
|
+
p_balance.add_argument("--token")
|
|
75
|
+
p_balance.add_argument("--api")
|
|
76
|
+
p_balance.set_defaults(func=deploy_cmd.cmd_balance)
|
|
77
|
+
|
|
73
78
|
p_agents = sub.add_parser("agents", help="list your agents")
|
|
74
79
|
p_agents.add_argument("--token")
|
|
75
80
|
p_agents.add_argument("--api")
|
|
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
|