Command-line interface for SweatStack — the sports data platform for developers
Project description
SweatStack CLI
Command-line interface for SweatStack — the sports data platform for developers.
Installation
pip install sweatstack-cli
Requires Python 3.11+.
Quick Start
# Authenticate with SweatStack
sweatstack login
# Check authentication and version status
sweatstack status
# Deploy a static site
sweatstack page deploy my-page ./dist
# Create an OAuth2 application
sweatstack app create "My App" --page my-page --env
# Logout
sweatstack logout
Commands
Authentication
| Command | Description |
|---|---|
sweatstack login |
Authenticate via browser (OAuth2 PKCE) |
sweatstack login --force |
Force re-authentication |
sweatstack logout |
Remove stored credentials |
sweatstack status |
Show auth status, user info, and version |
sweatstack --version |
Show version and check for updates |
Page Deployment
Deploy static sites to SweatStack Pages.
| Command | Description |
|---|---|
sweatstack page deploy [SLUG] [DIRECTORY] |
Deploy a static site |
- SLUG — Page identifier. Falls back to
sweatstack.tomlif omitted. - DIRECTORY — Directory to deploy. Falls back to
sweatstack.toml, then current directory.
# Deploy using CLI arguments
sweatstack page deploy my-page ./dist
# Deploy using sweatstack.toml defaults
sweatstack page deploy
Application Management
Manage OAuth2 applications.
| Command | Description |
|---|---|
sweatstack app create NAME |
Create a new private OAuth2 application |
sweatstack app link |
Link current directory to an existing application |
app create options
| Option | Description |
|---|---|
--description, -d TEXT |
Application description (max 500 chars) |
--page, -p SLUG |
Associate with a SweatStack Page |
--secret, -s |
Generate a client secret |
--env |
Write credentials to .env |
--env-file PATH |
Write credentials to a specific file |
--json |
Output as JSON |
app link options
| Option | Description |
|---|---|
--force, -f |
Overwrite existing sweatstack.toml |
Project Configuration
Commands read defaults from a sweatstack.toml in the current directory. This file is created automatically by app create and app link.
[app]
name = "My App"
client_id = "abc123"
[page]
slug = "my-page"
directory = "dist"
CI/CD Usage
For automated environments, set environment variables instead of interactive login:
export SWEATSTACK_API_KEY="your-access-token"
export SWEATSTACK_REFRESH_TOKEN="your-refresh-token"
sweatstack page deploy my-page ./dist
Environment Variables
| Variable | Description | Default |
|---|---|---|
SWEATSTACK_URL |
API base URL | https://app.sweatstack.no |
SWEATSTACK_API_KEY |
Access token (for CI/CD) | — |
SWEATSTACK_REFRESH_TOKEN |
Refresh token (for CI/CD) | — |
Token Storage
Credentials are stored in your OS user data directory:
- macOS:
~/Library/Application Support/SweatStack/SweatStack/tokens.json - Linux:
~/.local/share/SweatStack/SweatStack/tokens.json - Windows:
%APPDATA%\SweatStack\SweatStack\tokens.json
Token files are created with 0600 permissions (owner read/write only). This location is shared with the sweatstack Python library, so authenticating with either tool works for both.
Development
See DEVELOPMENT.md for development setup and contribution guidelines.
# Install with dev dependencies
uv pip install -e ".[dev]"
# Run tests
pytest
# Lint and format
ruff check . && ruff format .
# Type check
mypy src/sweatstack_cli
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sweatstack_cli-0.7.0.tar.gz.
File metadata
- Download URL: sweatstack_cli-0.7.0.tar.gz
- Upload date:
- Size: 74.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a6355917c1aa3fa7baa0b49ed97ef9d8fb56f757968fca15bc08ab5119b2afb
|
|
| MD5 |
445b5577f5802aa1b840a4dff291ee01
|
|
| BLAKE2b-256 |
eab3a3510a28389b7b2476c86ab51a99e1f1823ecc7132a35cd6fd22b8d9def4
|
File details
Details for the file sweatstack_cli-0.7.0-py3-none-any.whl.
File metadata
- Download URL: sweatstack_cli-0.7.0-py3-none-any.whl
- Upload date:
- Size: 23.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f62cd1b45301bcb092dbf41fef61c34bbf53230ece359be429c9d46770852b1
|
|
| MD5 |
aa6169beaeb579032955d87b569e8557
|
|
| BLAKE2b-256 |
9eedd38d7bd0d10f1acb3c33e78cd737432750497dca8968fd251820c1d4a869
|