sweatstack-cli 0.6.0__py3-none-any.whl → 0.7.1__py3-none-any.whl
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.
- sweatstack_cli/__init__.py +1 -1
- sweatstack_cli/commands/app.py +9 -0
- sweatstack_cli/commands/page.py +12 -0
- sweatstack_cli-0.7.1.dist-info/METADATA +139 -0
- {sweatstack_cli-0.6.0.dist-info → sweatstack_cli-0.7.1.dist-info}/RECORD +7 -7
- sweatstack_cli-0.6.0.dist-info/METADATA +0 -132
- {sweatstack_cli-0.6.0.dist-info → sweatstack_cli-0.7.1.dist-info}/WHEEL +0 -0
- {sweatstack_cli-0.6.0.dist-info → sweatstack_cli-0.7.1.dist-info}/entry_points.txt +0 -0
sweatstack_cli/__init__.py
CHANGED
sweatstack_cli/commands/app.py
CHANGED
|
@@ -19,6 +19,12 @@ app = typer.Typer(name="app", help="Manage OAuth2 applications.")
|
|
|
19
19
|
@app.command()
|
|
20
20
|
def create(
|
|
21
21
|
name: str = typer.Argument(..., help="Application name."),
|
|
22
|
+
description: str | None = typer.Option(
|
|
23
|
+
None,
|
|
24
|
+
"--description",
|
|
25
|
+
"-d",
|
|
26
|
+
help="Application description (max 500 chars).",
|
|
27
|
+
),
|
|
22
28
|
page: str | None = typer.Option(
|
|
23
29
|
None,
|
|
24
30
|
"--page",
|
|
@@ -54,6 +60,9 @@ def create(
|
|
|
54
60
|
|
|
55
61
|
body: dict[str, str | bool] = {"name": name}
|
|
56
62
|
|
|
63
|
+
if description:
|
|
64
|
+
body["description"] = description
|
|
65
|
+
|
|
57
66
|
if page:
|
|
58
67
|
body["page"] = page
|
|
59
68
|
|
sweatstack_cli/commands/page.py
CHANGED
|
@@ -9,6 +9,7 @@ import typer
|
|
|
9
9
|
from rich.progress import Progress, SpinnerColumn, TextColumn
|
|
10
10
|
|
|
11
11
|
from sweatstack_cli.api import APIClient
|
|
12
|
+
from sweatstack_cli.config import get_settings
|
|
12
13
|
from sweatstack_cli.console import console
|
|
13
14
|
from sweatstack_cli.exceptions import APIError, AuthenticationError
|
|
14
15
|
from sweatstack_cli.project import CONFIG_FILENAME, ProjectConfig
|
|
@@ -146,3 +147,14 @@ def deploy(
|
|
|
146
147
|
console.print(f"[green]✓[/green] Deployed [bold]{page_slug}[/bold] successfully!")
|
|
147
148
|
console.print(f" Files: {file_count}")
|
|
148
149
|
console.print(f" URL: {result.get('url', 'N/A')}")
|
|
150
|
+
|
|
151
|
+
# Nudge to publish if app is private
|
|
152
|
+
application = result.get("application", {})
|
|
153
|
+
if application.get("is_private"):
|
|
154
|
+
app_id = application.get("id")
|
|
155
|
+
if app_id:
|
|
156
|
+
base_url = get_settings().api_url
|
|
157
|
+
console.print()
|
|
158
|
+
console.print("Your app is private. Ready to go public?")
|
|
159
|
+
publish_url = f"{base_url}/applications/{app_id}/publish"
|
|
160
|
+
console.print(f" {publish_url}")
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sweatstack-cli
|
|
3
|
+
Version: 0.7.1
|
|
4
|
+
Summary: Command-line interface for SweatStack — the sports data platform for developers
|
|
5
|
+
Project-URL: Homepage, https://sweatstack.no
|
|
6
|
+
Project-URL: Documentation, https://docs.sweatstack.no
|
|
7
|
+
Project-URL: Repository, https://github.com/sweatstack/sweatstack-cli
|
|
8
|
+
Author-email: Aart Goossens <aart@sweatstack.no>
|
|
9
|
+
License: MIT
|
|
10
|
+
Keywords: api,cli,fitness,sports,sweatstack
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Environment :: Console
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Requires-Dist: httpx>=0.28.0
|
|
21
|
+
Requires-Dist: platformdirs>=4.0
|
|
22
|
+
Requires-Dist: typer>=0.15.0
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: coverage>=7.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: mypy>=1.14; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest-httpx>=0.35; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: ruff>=0.9; extra == 'dev'
|
|
29
|
+
Description-Content-Type: text/markdown
|
|
30
|
+
|
|
31
|
+
# SweatStack CLI
|
|
32
|
+
|
|
33
|
+
Command-line interface for [SweatStack](https://sweatstack.no) — the sports data platform for developers.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
Requires Python 3.11+. We recommend [uv](https://docs.astral.sh/uv/) for installation.
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
# Run directly without installing
|
|
41
|
+
uvx sweatstack-cli
|
|
42
|
+
|
|
43
|
+
# Or install as a tool
|
|
44
|
+
uv tool install sweatstack-cli
|
|
45
|
+
|
|
46
|
+
# Or with pip
|
|
47
|
+
pip install sweatstack-cli
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
To upgrade:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
uv tool upgrade sweatstack-cli
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
To reinstall (e.g. after a broken install or Python version change):
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
uvx --reinstall sweatstack-cli
|
|
60
|
+
# or if installed as a tool
|
|
61
|
+
uv tool install --reinstall sweatstack-cli
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Quick Start
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Authenticate with SweatStack
|
|
68
|
+
sweatstack login
|
|
69
|
+
|
|
70
|
+
# Create an app and deploy
|
|
71
|
+
sweatstack app create "My App" --page my-page --env
|
|
72
|
+
sweatstack page deploy
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Commands
|
|
76
|
+
|
|
77
|
+
### Authentication
|
|
78
|
+
|
|
79
|
+
| Command | Description |
|
|
80
|
+
|---------|-------------|
|
|
81
|
+
| `sweatstack login` | Authenticate via browser (OAuth2 PKCE) |
|
|
82
|
+
| `sweatstack login --force` | Force re-authentication |
|
|
83
|
+
| `sweatstack logout` | Remove stored credentials |
|
|
84
|
+
| `sweatstack status` | Show auth status, user info, and version |
|
|
85
|
+
| `sweatstack --version` | Show version and check for updates |
|
|
86
|
+
|
|
87
|
+
### Application Management
|
|
88
|
+
|
|
89
|
+
| Command | Description |
|
|
90
|
+
|---------|-------------|
|
|
91
|
+
| `sweatstack app create NAME` | Create a new private OAuth2 application |
|
|
92
|
+
| `sweatstack app link` | Link current directory to an existing application |
|
|
93
|
+
|
|
94
|
+
#### `app create` options
|
|
95
|
+
|
|
96
|
+
| Option | Description |
|
|
97
|
+
|--------|-------------|
|
|
98
|
+
| `--description, -d TEXT` | Application description (max 500 chars) |
|
|
99
|
+
| `--page, -p SLUG` | Associate with a SweatStack Page |
|
|
100
|
+
| `--secret, -s` | Generate a client secret |
|
|
101
|
+
| `--env` | Write credentials to `.env` |
|
|
102
|
+
| `--env-file PATH` | Write credentials to a specific file |
|
|
103
|
+
| `--json` | Output as JSON |
|
|
104
|
+
|
|
105
|
+
#### `app link` options
|
|
106
|
+
|
|
107
|
+
| Option | Description |
|
|
108
|
+
|--------|-------------|
|
|
109
|
+
| `--force, -f` | Overwrite existing `sweatstack.toml` |
|
|
110
|
+
|
|
111
|
+
### Project Configuration
|
|
112
|
+
|
|
113
|
+
Both `app create` and `app link` generate a `sweatstack.toml` in the current directory. Other commands read defaults from this file.
|
|
114
|
+
|
|
115
|
+
```toml
|
|
116
|
+
[app]
|
|
117
|
+
name = "My App"
|
|
118
|
+
client_id = "abc123"
|
|
119
|
+
|
|
120
|
+
[page]
|
|
121
|
+
slug = "my-page"
|
|
122
|
+
directory = "dist"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Page Deployment
|
|
126
|
+
|
|
127
|
+
Deploy static sites to SweatStack Pages.
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Deploy using sweatstack.toml defaults (recommended)
|
|
131
|
+
sweatstack page deploy
|
|
132
|
+
|
|
133
|
+
# Or specify slug and directory directly
|
|
134
|
+
sweatstack page deploy my-page ./dist
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
sweatstack_cli/__init__.py,sha256=
|
|
1
|
+
sweatstack_cli/__init__.py,sha256=Ukl0v4zMZ7-TDQDGOgP_hE5bZNOGupnWszo_V3w4JM4,100
|
|
2
2
|
sweatstack_cli/config.py,sha256=cD4OXnVAKVagYazyk9Cw-WWx62tJPqcjQt1cknYyymM,706
|
|
3
3
|
sweatstack_cli/console.py,sha256=69KWAM7ksnYRTONMYTXGXN4LWRAQhRxcLXO0LcWGLqo,300
|
|
4
4
|
sweatstack_cli/exceptions.py,sha256=qEUu8GydXGRKR4ndAdZ2wnkHekmFpBXDJiT5bXdl7Yk,613
|
|
@@ -14,10 +14,10 @@ sweatstack_cli/auth/jwt.py,sha256=Ja6ccFyRKtX5MPjFdHNavVYf8KTz0MYT86StbnF-cwg,15
|
|
|
14
14
|
sweatstack_cli/auth/pkce.py,sha256=sO_xUeN1UIvXKX0yEIGgMTIIzvfCOCUwlyNAveEd16k,1542
|
|
15
15
|
sweatstack_cli/auth/tokens.py,sha256=kc8ytoO9PAyjLD6wUTIagVuP7_ia5ZjW5m_WjXIRIkA,4942
|
|
16
16
|
sweatstack_cli/commands/__init__.py,sha256=YCO8wYVvdGeoEI0p_oUm8ANLneuET4SHsKDjitMjAgY,35
|
|
17
|
-
sweatstack_cli/commands/app.py,sha256=
|
|
17
|
+
sweatstack_cli/commands/app.py,sha256=vTMR1Hs76LOJe8q1_FY1AcNPG7LOJdz8SCOfY3ZwayY,6945
|
|
18
18
|
sweatstack_cli/commands/auth.py,sha256=lmlN2RcZIHdbZG-EEUVFwOSn6vPN-Ijgh_5E-cFQVtU,3478
|
|
19
|
-
sweatstack_cli/commands/page.py,sha256=
|
|
20
|
-
sweatstack_cli-0.
|
|
21
|
-
sweatstack_cli-0.
|
|
22
|
-
sweatstack_cli-0.
|
|
23
|
-
sweatstack_cli-0.
|
|
19
|
+
sweatstack_cli/commands/page.py,sha256=tEWjzOmht_IKm47lbprJz-XDKibrx5nFlStuvBRST6A,5329
|
|
20
|
+
sweatstack_cli-0.7.1.dist-info/METADATA,sha256=CQ4JeU0g8Cqo4tLd4vUK8mAoUqgiCa7fK1AocVBTPko,3664
|
|
21
|
+
sweatstack_cli-0.7.1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
22
|
+
sweatstack_cli-0.7.1.dist-info/entry_points.txt,sha256=rnH0EV1U9CQlmKQcJ7RmxGpNRTa9J-YdiIJZDYrAXb4,56
|
|
23
|
+
sweatstack_cli-0.7.1.dist-info/RECORD,,
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: sweatstack-cli
|
|
3
|
-
Version: 0.6.0
|
|
4
|
-
Summary: Command-line interface for SweatStack — the sports data platform for developers
|
|
5
|
-
Project-URL: Homepage, https://sweatstack.no
|
|
6
|
-
Project-URL: Documentation, https://docs.sweatstack.no
|
|
7
|
-
Project-URL: Repository, https://github.com/sweatstack/sweatstack-cli
|
|
8
|
-
Author-email: Aart Goossens <aart@sweatstack.no>
|
|
9
|
-
License: MIT
|
|
10
|
-
Keywords: api,cli,fitness,sports,sweatstack
|
|
11
|
-
Classifier: Development Status :: 3 - Alpha
|
|
12
|
-
Classifier: Environment :: Console
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
-
Classifier: Operating System :: OS Independent
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
-
Classifier: Typing :: Typed
|
|
19
|
-
Requires-Python: >=3.11
|
|
20
|
-
Requires-Dist: httpx>=0.28.0
|
|
21
|
-
Requires-Dist: platformdirs>=4.0
|
|
22
|
-
Requires-Dist: typer>=0.15.0
|
|
23
|
-
Provides-Extra: dev
|
|
24
|
-
Requires-Dist: coverage>=7.0; extra == 'dev'
|
|
25
|
-
Requires-Dist: mypy>=1.14; extra == 'dev'
|
|
26
|
-
Requires-Dist: pytest-httpx>=0.35; extra == 'dev'
|
|
27
|
-
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
28
|
-
Requires-Dist: ruff>=0.9; extra == 'dev'
|
|
29
|
-
Description-Content-Type: text/markdown
|
|
30
|
-
|
|
31
|
-
# SweatStack CLI
|
|
32
|
-
|
|
33
|
-
Command-line interface for [SweatStack](https://sweatstack.no) — the sports data platform for developers.
|
|
34
|
-
|
|
35
|
-
## Installation
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
pip install sweatstack-cli
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Requires Python 3.13+.
|
|
42
|
-
|
|
43
|
-
## Quick Start
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
# Authenticate with SweatStack
|
|
47
|
-
sweatstack login
|
|
48
|
-
|
|
49
|
-
# Check who you're logged in as
|
|
50
|
-
sweatstack whoami
|
|
51
|
-
|
|
52
|
-
# Deploy a static site
|
|
53
|
-
sweatstack pages deploy ./dist --prod
|
|
54
|
-
|
|
55
|
-
# View authentication status
|
|
56
|
-
sweatstack status
|
|
57
|
-
|
|
58
|
-
# Logout
|
|
59
|
-
sweatstack logout
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Commands
|
|
63
|
-
|
|
64
|
-
### Authentication
|
|
65
|
-
|
|
66
|
-
| Command | Description |
|
|
67
|
-
|---------|-------------|
|
|
68
|
-
| `sweatstack login` | Authenticate via browser |
|
|
69
|
-
| `sweatstack login --force` | Force re-authentication |
|
|
70
|
-
| `sweatstack logout` | Remove stored credentials |
|
|
71
|
-
| `sweatstack whoami` | Show current user |
|
|
72
|
-
| `sweatstack status` | Show token status and expiry |
|
|
73
|
-
|
|
74
|
-
### Pages
|
|
75
|
-
|
|
76
|
-
| Command | Description |
|
|
77
|
-
|---------|-------------|
|
|
78
|
-
| `sweatstack pages deploy <dir>` | Deploy static site |
|
|
79
|
-
| `sweatstack pages deploy --prod` | Deploy to production |
|
|
80
|
-
| `sweatstack pages list` | List all sites |
|
|
81
|
-
| `sweatstack pages delete <name>` | Delete a site |
|
|
82
|
-
|
|
83
|
-
## CI/CD Usage
|
|
84
|
-
|
|
85
|
-
For automated environments, use environment variables instead of interactive login:
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
export SWEATSTACK_API_KEY="your-access-token"
|
|
89
|
-
export SWEATSTACK_REFRESH_TOKEN="your-refresh-token"
|
|
90
|
-
|
|
91
|
-
sweatstack pages deploy ./dist --prod
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## Configuration
|
|
95
|
-
|
|
96
|
-
| Environment Variable | Description | Default |
|
|
97
|
-
|---------------------|-------------|---------|
|
|
98
|
-
| `SWEATSTACK_URL` | API base URL | `https://app.sweatstack.no` |
|
|
99
|
-
| `SWEATSTACK_API_KEY` | Access token | — |
|
|
100
|
-
| `SWEATSTACK_REFRESH_TOKEN` | Refresh token | — |
|
|
101
|
-
|
|
102
|
-
## Token Storage
|
|
103
|
-
|
|
104
|
-
Credentials are stored securely in your OS user data directory:
|
|
105
|
-
|
|
106
|
-
- **macOS**: `~/Library/Application Support/SweatStack/SweatStack/tokens.json`
|
|
107
|
-
- **Linux**: `~/.local/share/SweatStack/SweatStack/tokens.json`
|
|
108
|
-
- **Windows**: `%APPDATA%\SweatStack\SweatStack\tokens.json`
|
|
109
|
-
|
|
110
|
-
This location is shared with the [sweatstack Python library](https://github.com/sweatstack/sweatstack-python), so authenticating with either tool works for both.
|
|
111
|
-
|
|
112
|
-
## Development
|
|
113
|
-
|
|
114
|
-
See [DEVELOPMENT.md](DEVELOPMENT.md) for development setup and contribution guidelines.
|
|
115
|
-
|
|
116
|
-
```bash
|
|
117
|
-
# Install with dev dependencies
|
|
118
|
-
uv pip install -e ".[dev]"
|
|
119
|
-
|
|
120
|
-
# Run tests
|
|
121
|
-
pytest
|
|
122
|
-
|
|
123
|
-
# Lint and format
|
|
124
|
-
ruff check . && ruff format .
|
|
125
|
-
|
|
126
|
-
# Type check
|
|
127
|
-
mypy src/sweatstack_cli
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## License
|
|
131
|
-
|
|
132
|
-
MIT
|
|
File without changes
|
|
File without changes
|