Skip to content

tomLadder/spusu-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“± spusu-cli

The unofficial command-line interface for spusu.at

Manage your spusu mobile account directly from the terminal. Built with TypeScript, powered by Bun.

πŸ“– Documentation β€’ Features β€’ Installation β€’ Quick Start β€’ Commands β€’ Contributing

Documentation Version License Bun TypeScript Platform


Caution

Legal Disclaimer / Rechtlicher Hinweis

This is an unofficial tool and is not affiliated with spusu (Mass Response Service GmbH). Using this program may violate spusu's terms of service. You are solely responsible for ensuring your use complies with applicable terms and laws. The developers accept no liability for any damages or legal consequences arising from its use. Use at your own risk.

Dies ist ein inoffizielles Tool und steht in keiner Verbindung zu spusu (Mass Response Service GmbH). Die Verwendung dieses Programms kann gegen die Nutzungsbedingungen von spusu verstoßen. Sie sind selbst dafür verantwortlich, die RechtmÀßigkeit Ihrer Nutzung sicherzustellen. Die Entwickler übernehmen keine Haftung für SchÀden oder rechtliche Konsequenzen. Die Nutzung erfolgt auf eigenes Risiko.


Features

Account Management

  • View customer information
  • Check login status
  • Secure SMS TAN authentication

Invoice Management

  • List all invoices with status
  • Download invoices as PDF
  • Download itemised bills as Excel
  • Filter by year

Tariff Information

  • View active tariffs and contracts
  • See contract details and status

Developer Experience

  • JSON output for scripting and AI agents
  • Beautiful terminal UI with spinners
  • Cross-platform compatibility

Installation

Quick Install (macOS / Linux)

curl -fsSL https://raw.githubusercontent.com/tomLadder/spusu-cli/main/install.sh | sh

Pre-built binaries are also available on the Releases page.

From Source

Prerequisites: Bun v1.0 or higher

# Clone the repository
git clone https://github.com/tomLadder/spusu-cli.git
cd spusu-cli

# Install dependencies
bun install

# Build the standalone executable
bun run build

# Move to your PATH (optional)
mv dist/spusu /usr/local/bin/

Development Mode

# Run directly without building
bun run dev -- --help

Quick Start

1. Login to your account

spusu login

You'll receive a TAN code via SMS to complete authentication.

2. Check your identity

spusu whoami

3. List your invoices

spusu invoices list

4. Download an invoice

spusu invoices download 1234567 --year 2026

Commands

Quick Reference

Command Description
spusu login Authenticate with SMS TAN
spusu logout Clear stored credentials
spusu whoami Display current user info
spusu status Check login status
spusu invoices list List all invoices
spusu invoices get <id> Get invoice details
spusu invoices download <id> Download invoice as PDF or Excel
spusu tariffs List all tariffs/contracts
spusu config get Show all settings
spusu config set <key> <value> Set a configuration value
spusu config reset Reset to defaults
spusu config path Show config file location

Global Options

These options are available on all commands:

Option Description
-h, --help Display help for the command
-V, --version Display CLI version (root command only)
# Show general help
spusu --help

# Show help for a specific command
spusu login --help
spusu invoices --help
spusu invoices download --help

# Show version
spusu --version

Command Reference

spusu login

Authenticate with your spusu account using SMS TAN verification.

spusu login [options]
Option Description
-p, --phone <phone> Phone number in Austrian format (e.g., +4369912345678)
-t, --tan <code> TAN code received via SMS (for non-interactive login)
--json Output result as JSON

Examples:

# Interactive login (prompts for phone and TAN)
spusu login

# Provide phone number upfront
spusu login --phone +4369912345678

# Non-interactive two-step login (for scripts/AI agents)
spusu login --phone +4369912345678 --json          # Step 1: Request TAN
spusu login --phone +4369912345678 --tan ABC123 --json  # Step 2: Complete login

spusu logout

Clear stored session and credentials.

spusu logout

No options available.


spusu whoami

Display detailed information about the currently logged-in user.

spusu whoami [options]
Option Description
--json Output result as JSON

Examples:

# Pretty output
spusu whoami

# JSON output (for scripting)
spusu whoami --json

spusu status

Check current login status and session information.

spusu status [options]
Option Description
--json Output result as JSON

Examples:

# Pretty output
spusu status

# JSON output
spusu status --json

spusu invoices list

List all invoices for a given year.

spusu invoices list [options]
Option Description
-y, --year <year> Filter by year (defaults to current year)
--json Output result as JSON

Examples:

# List invoices for current year
spusu invoices list

# List invoices for specific year
spusu invoices list --year 2025
spusu invoices list -y 2024

# JSON output
spusu invoices list --json
spusu invoices list --year 2025 --json

spusu invoices get <id>

Get detailed information about a specific invoice.

spusu invoices get <id> [options]
Argument Description
<id> Invoice ID (numeric)
Option Description
-y, --year <year> Invoice year (defaults to current year)
--json Output result as JSON

Examples:

# Get invoice details
spusu invoices get 1234567

# Get invoice from specific year
spusu invoices get 1234567 --year 2025
spusu invoices get 1234567 -y 2025

# JSON output
spusu invoices get 1234567 --json

spusu invoices download <id>

Download an invoice as PDF or itemised bill as Excel.

spusu invoices download <id> [options]
Argument Description
<id> Invoice ID (numeric)
Option Description
-y, --year <year> Invoice year (defaults to current year)
-o, --output <path> Custom output file path
--excel Download itemised bill as Excel (.xlsx) instead of PDF

Examples:

# Download invoice as PDF (default)
spusu invoices download 1234567

# Specify year
spusu invoices download 1234567 --year 2026
spusu invoices download 1234567 -y 2026

# Custom output path
spusu invoices download 1234567 --output ~/invoices/march-2026.pdf
spusu invoices download 1234567 -o /path/to/invoice.pdf

# Download itemised bill as Excel
spusu invoices download 1234567 --excel

# Combine options
spusu invoices download 1234567 --year 2026 --excel --output ~/bills/march.xlsx

spusu tariffs

List all tariffs and contracts associated with your account.

spusu tariffs [options]
Option Description
--json Output result as JSON

Examples:

# Pretty output
spusu tariffs

# JSON output
spusu tariffs --json

spusu config get

Display current CLI configuration.

spusu config get [options]
Option Description
--json Output result as JSON

Examples:

# Pretty output
spusu config get

# JSON output
spusu config get --json

spusu config set <key> <value>

Set a configuration value.

spusu config set <key> <value>
Argument Description
<key> Configuration key (see available keys below)
<value> Value to set

Available Keys:

Key Values Description
outputFormat pretty, json Default output format for all commands

Examples:

# Set default output to JSON
spusu config set outputFormat json

# Set default output to pretty (human-readable)
spusu config set outputFormat pretty

spusu config reset

Reset all configuration to default values. This clears settings but preserves authentication.

spusu config reset

No options available.


spusu config path

Display the path to the configuration file.

spusu config path

No options available.

Example output:

/Users/username/.spusu/config.json

Configuration

Configuration is stored in ~/.spusu/:

File Description
config.json Settings and session data

Available Settings

Key Values Default Description
outputFormat pretty, json pretty Default output format

Scripting & Automation

JSON Output

All commands support --json for machine-readable output:

# Get customer number
spusu whoami --json | jq '.customerNumber'

# Get latest invoice ID
spusu invoices list --json | jq '.invoices[0].id'

# Calculate total spent this year
spusu invoices list --json | jq '[.invoices[].total.amount] | add'

Batch Operations

# Download all invoices for a year
for id in $(spusu invoices list --year 2026 --json | jq -r '.invoices[].id'); do
  spusu invoices download "$id" --year 2026
done

# Export invoice summary to CSV
spusu invoices list --json | jq -r '.invoices[] | [.invoiceDate, .invoiceNumber, .total.amount] | @csv'

Architecture

src/
β”œβ”€β”€ index.ts           # CLI entry point
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ client.ts      # HTTP client with session handling
β”‚   β”œβ”€β”€ auth.ts        # SMS TAN authentication
β”‚   β”œβ”€β”€ customer.ts    # Customer info
β”‚   β”œβ”€β”€ invoices.ts    # Invoice operations
β”‚   └── tariffs.ts     # Tariff information
β”œβ”€β”€ cli/
β”‚   └── commands/      # Command implementations
β”œβ”€β”€ store/
β”‚   └── config.ts      # Configuration management
└── types/
    └── index.ts       # TypeScript interfaces

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting a PR.


FAQ

How does authentication work?

spusu uses SMS TAN-based authentication:

  1. You provide your phone number
  2. spusu sends a TAN code via SMS
  3. You enter the TAN code to complete login
  4. The session is stored locally in ~/.spusu/config.json
How long does a session last?

Session duration is determined by spusu's servers. If your session expires, simply run spusu login again.

Where are my credentials stored?

Your session is stored in ~/.spusu/config.json with secure file permissions (0600). Only the session ID is stored, not your password or TAN codes.

Can I use this with multiple phone numbers?

Currently, only one session is supported at a time. Logging in with a different number will replace the existing session.


Acknowledgments


License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with care in Austria

About

πŸ“± CLI for managing your spusu.at mobile account from the terminal

Resources

License

Contributing

Stars

Watchers

Forks

Contributors