sweatstack-cli 0.6.0__py3-none-any.whl → 0.7.0__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.0.dist-info/METADATA +182 -0
- {sweatstack_cli-0.6.0.dist-info → sweatstack_cli-0.7.0.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.0.dist-info}/WHEEL +0 -0
- {sweatstack_cli-0.6.0.dist-info → sweatstack_cli-0.7.0.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,182 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sweatstack-cli
|
|
3
|
+
Version: 0.7.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.11+.
|
|
42
|
+
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Authenticate with SweatStack
|
|
47
|
+
sweatstack login
|
|
48
|
+
|
|
49
|
+
# Check authentication and version status
|
|
50
|
+
sweatstack status
|
|
51
|
+
|
|
52
|
+
# Deploy a static site
|
|
53
|
+
sweatstack page deploy my-page ./dist
|
|
54
|
+
|
|
55
|
+
# Create an OAuth2 application
|
|
56
|
+
sweatstack app create "My App" --page my-page --env
|
|
57
|
+
|
|
58
|
+
# Logout
|
|
59
|
+
sweatstack logout
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Commands
|
|
63
|
+
|
|
64
|
+
### Authentication
|
|
65
|
+
|
|
66
|
+
| Command | Description |
|
|
67
|
+
|---------|-------------|
|
|
68
|
+
| `sweatstack login` | Authenticate via browser (OAuth2 PKCE) |
|
|
69
|
+
| `sweatstack login --force` | Force re-authentication |
|
|
70
|
+
| `sweatstack logout` | Remove stored credentials |
|
|
71
|
+
| `sweatstack status` | Show auth status, user info, and version |
|
|
72
|
+
| `sweatstack --version` | Show version and check for updates |
|
|
73
|
+
|
|
74
|
+
### Page Deployment
|
|
75
|
+
|
|
76
|
+
Deploy static sites to SweatStack Pages.
|
|
77
|
+
|
|
78
|
+
| Command | Description |
|
|
79
|
+
|---------|-------------|
|
|
80
|
+
| `sweatstack page deploy [SLUG] [DIRECTORY]` | Deploy a static site |
|
|
81
|
+
|
|
82
|
+
- **SLUG** — Page identifier. Falls back to `sweatstack.toml` if omitted.
|
|
83
|
+
- **DIRECTORY** — Directory to deploy. Falls back to `sweatstack.toml`, then current directory.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# Deploy using CLI arguments
|
|
87
|
+
sweatstack page deploy my-page ./dist
|
|
88
|
+
|
|
89
|
+
# Deploy using sweatstack.toml defaults
|
|
90
|
+
sweatstack page deploy
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Application Management
|
|
94
|
+
|
|
95
|
+
Manage OAuth2 applications.
|
|
96
|
+
|
|
97
|
+
| Command | Description |
|
|
98
|
+
|---------|-------------|
|
|
99
|
+
| `sweatstack app create NAME` | Create a new private OAuth2 application |
|
|
100
|
+
| `sweatstack app link` | Link current directory to an existing application |
|
|
101
|
+
|
|
102
|
+
#### `app create` options
|
|
103
|
+
|
|
104
|
+
| Option | Description |
|
|
105
|
+
|--------|-------------|
|
|
106
|
+
| `--description, -d TEXT` | Application description (max 500 chars) |
|
|
107
|
+
| `--page, -p SLUG` | Associate with a SweatStack Page |
|
|
108
|
+
| `--secret, -s` | Generate a client secret |
|
|
109
|
+
| `--env` | Write credentials to `.env` |
|
|
110
|
+
| `--env-file PATH` | Write credentials to a specific file |
|
|
111
|
+
| `--json` | Output as JSON |
|
|
112
|
+
|
|
113
|
+
#### `app link` options
|
|
114
|
+
|
|
115
|
+
| Option | Description |
|
|
116
|
+
|--------|-------------|
|
|
117
|
+
| `--force, -f` | Overwrite existing `sweatstack.toml` |
|
|
118
|
+
|
|
119
|
+
## Project Configuration
|
|
120
|
+
|
|
121
|
+
Commands read defaults from a `sweatstack.toml` in the current directory. This file is created automatically by `app create` and `app link`.
|
|
122
|
+
|
|
123
|
+
```toml
|
|
124
|
+
[app]
|
|
125
|
+
name = "My App"
|
|
126
|
+
client_id = "abc123"
|
|
127
|
+
|
|
128
|
+
[page]
|
|
129
|
+
slug = "my-page"
|
|
130
|
+
directory = "dist"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## CI/CD Usage
|
|
134
|
+
|
|
135
|
+
For automated environments, set environment variables instead of interactive login:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
export SWEATSTACK_API_KEY="your-access-token"
|
|
139
|
+
export SWEATSTACK_REFRESH_TOKEN="your-refresh-token"
|
|
140
|
+
|
|
141
|
+
sweatstack page deploy my-page ./dist
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Environment Variables
|
|
145
|
+
|
|
146
|
+
| Variable | Description | Default |
|
|
147
|
+
|----------|-------------|---------|
|
|
148
|
+
| `SWEATSTACK_URL` | API base URL | `https://app.sweatstack.no` |
|
|
149
|
+
| `SWEATSTACK_API_KEY` | Access token (for CI/CD) | — |
|
|
150
|
+
| `SWEATSTACK_REFRESH_TOKEN` | Refresh token (for CI/CD) | — |
|
|
151
|
+
|
|
152
|
+
## Token Storage
|
|
153
|
+
|
|
154
|
+
Credentials are stored in your OS user data directory:
|
|
155
|
+
|
|
156
|
+
- **macOS**: `~/Library/Application Support/SweatStack/SweatStack/tokens.json`
|
|
157
|
+
- **Linux**: `~/.local/share/SweatStack/SweatStack/tokens.json`
|
|
158
|
+
- **Windows**: `%APPDATA%\SweatStack\SweatStack\tokens.json`
|
|
159
|
+
|
|
160
|
+
Token files are created with `0600` permissions (owner read/write only). This location is shared with the [sweatstack Python library](https://github.com/sweatstack/sweatstack-python), so authenticating with either tool works for both.
|
|
161
|
+
|
|
162
|
+
## Development
|
|
163
|
+
|
|
164
|
+
See [DEVELOPMENT.md](DEVELOPMENT.md) for development setup and contribution guidelines.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# Install with dev dependencies
|
|
168
|
+
uv pip install -e ".[dev]"
|
|
169
|
+
|
|
170
|
+
# Run tests
|
|
171
|
+
pytest
|
|
172
|
+
|
|
173
|
+
# Lint and format
|
|
174
|
+
ruff check . && ruff format .
|
|
175
|
+
|
|
176
|
+
# Type check
|
|
177
|
+
mypy src/sweatstack_cli
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
sweatstack_cli/__init__.py,sha256=
|
|
1
|
+
sweatstack_cli/__init__.py,sha256=n2zPulBh92qWjkryatKmyuF192Pfhslh0yCiCZdD-Co,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.0.dist-info/METADATA,sha256=e4RwtVRDIbDAH6uAPnLL4QcEXu_cvgs3yjMt-LxVqm0,5017
|
|
21
|
+
sweatstack_cli-0.7.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
22
|
+
sweatstack_cli-0.7.0.dist-info/entry_points.txt,sha256=rnH0EV1U9CQlmKQcJ7RmxGpNRTa9J-YdiIJZDYrAXb4,56
|
|
23
|
+
sweatstack_cli-0.7.0.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
|