The unofficial command-line interface for Magenta Telekom Austria
Manage your Magenta account directly from the terminal. Built with TypeScript, powered by Bun.
π Documentation β’ Features β’ Installation β’ Quick Start β’ Commands β’ Contributing
Caution
Legal Disclaimer / Rechtlicher Hinweis
This is an unofficial tool and is not affiliated with Magenta Telekom (T-Mobile Austria GmbH). Using this program may violate Magenta'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 Magenta Telekom (T-Mobile Austria GmbH). Die Verwendung dieses Programms kann gegen die Nutzungsbedingungen von Magenta 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.
Account Management
- View customer information
- Check login status
- Secure password authentication with RSA encryption
Invoice Management
- List all invoices with status
- Download invoices as PDF
- View invoice details
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
curl -fsSL https://raw.githubusercontent.com/tomLadder/magenta-cli/main/install.sh | shPre-built binaries are also available on the Releases page.
Prerequisites: Bun v1.0 or higher
# Clone the repository
git clone https://github.com/tomLadder/magenta-cli.git
cd magenta-cli
# Install dependencies
bun install
# Build the standalone executable
bun run build
# Move to your PATH (optional)
mv dist/magenta /usr/local/bin/# Run directly without building
bun run dev -- --helpmagenta loginYou'll be prompted for your email and password.
magenta whoamimagenta tariffsmagenta invoices listmagenta invoices download 123456789012| Command | Description |
|---|---|
magenta login |
Authenticate with Magenta |
magenta logout |
Clear stored credentials |
magenta whoami |
Display current user info |
magenta status |
Check login status |
magenta tariffs |
List all tariffs/contracts |
magenta invoices list |
List all invoices |
magenta invoices get <id> |
Get invoice details |
magenta invoices download <id> |
Download invoice as PDF |
magenta config get |
Show all settings |
magenta config set <key> <value> |
Set a configuration value |
magenta config reset |
Reset to defaults |
magenta config path |
Show config file location |
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
magenta --help
# Show help for a specific command
magenta login --help
magenta invoices --help
magenta invoices download --help
# Show version
magenta --versionAuthenticate with your Magenta account using email and password.
magenta login [options]| Option | Description |
|---|---|
-u, --username <username> |
Username or email |
-p, --password <password> |
Password |
--json |
Output result as JSON |
Examples:
# Interactive login (prompts for credentials)
magenta login
# Provide username upfront
magenta login --username [email protected]
# Non-interactive login (for scripts/AI agents)
magenta login --username [email protected] --password mypassword --jsonClear stored session and credentials.
magenta logoutNo options available.
Display detailed information about the currently logged-in user.
magenta whoami [options]| Option | Description |
|---|---|
--json |
Output result as JSON |
Examples:
# Pretty output
magenta whoami
# JSON output (for scripting)
magenta whoami --jsonCheck current login status and session information.
magenta status [options]| Option | Description |
|---|---|
--json |
Output result as JSON |
Examples:
# Pretty output
magenta status
# JSON output
magenta status --jsonList all tariffs and contracts associated with your account.
magenta tariffs [options]| Option | Description |
|---|---|
--json |
Output result as JSON |
Examples:
# Pretty output
magenta tariffs
# JSON output
magenta tariffs --jsonList all invoices.
magenta invoices list [options]| Option | Description |
|---|---|
--json |
Output result as JSON |
Examples:
# List all invoices
magenta invoices list
# JSON output
magenta invoices list --jsonGet detailed information about a specific invoice.
magenta invoices get <id> [options]| Argument | Description |
|---|---|
<id> |
Invoice ID or Bill Number (e.g., 123456789012 or TMA.123456789012) |
| Option | Description |
|---|---|
--json |
Output result as JSON |
Examples:
# Get invoice details
magenta invoices get 123456789012
# Using full bill ID
magenta invoices get TMA.123456789012
# JSON output
magenta invoices get 123456789012 --jsonDownload an invoice as PDF.
magenta invoices download <id> [options]| Argument | Description |
|---|---|
<id> |
Invoice ID or Bill Number |
| Option | Description |
|---|---|
-o, --output <path> |
Custom output file path |
Examples:
# Download invoice as PDF (default filename)
magenta invoices download 123456789012
# Custom output path
magenta invoices download 123456789012 --output ~/invoices/march-2026.pdf
magenta invoices download 123456789012 -o /path/to/invoice.pdfDisplay current CLI configuration.
magenta config get [options]| Option | Description |
|---|---|
--json |
Output result as JSON |
Examples:
# Pretty output
magenta config get
# JSON output
magenta config get --jsonSet a configuration value.
magenta 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
magenta config set outputFormat json
# Set default output to pretty (human-readable)
magenta config set outputFormat prettyReset all configuration to default values. This clears settings but preserves authentication.
magenta config resetNo options available.
Display the path to the configuration file.
magenta config pathNo options available.
Example output:
/Users/username/.magenta/config.json
Configuration is stored in ~/.magenta/:
| File | Description |
|---|---|
config.json |
Settings and session data |
| Key | Values | Default | Description |
|---|---|---|---|
outputFormat |
pretty, json |
pretty |
Default output format |
All commands support --json for machine-readable output:
# Get user email
magenta whoami --json | jq '.username'
# Get latest invoice amount
magenta invoices list --json | jq '.[0].amountDue.amount'
# Calculate total invoices
magenta invoices list --json | jq '[.[].amountDue.amount] | add'# Download all invoices
for id in $(magenta invoices list --json | jq -r '.[].billNo'); do
magenta invoices download "$id"
done
# Export invoice summary to CSV
magenta invoices list --json | jq -r '.[] | [.billDate, .billNo, .amountDue.amount] | @csv'src/
βββ index.ts # CLI entry point
βββ api/
β βββ client.ts # HTTP client with session handling
β βββ auth.ts # Password authentication with RSA encryption
β βββ profile.ts # User profile
β βββ dashboard.ts # Dashboard/tariffs
β βββ invoices.ts # Invoice operations
βββ cli/
β βββ commands/ # Command implementations
βββ store/
β βββ config.ts # Configuration management
βββ types/
βββ index.ts # TypeScript interfaces
Contributions are welcome! Please feel free to submit a Pull Request.
How does authentication work?
Magenta uses password-based authentication:
- You provide your email/username and password
- The password is encrypted using RSA-OAEP with Magenta's public key
- The session tokens are stored locally in
~/.magenta/config.json
How long does a session last?
Access tokens expire after approximately 15 minutes, but refresh tokens last much longer (about 14 days). The CLI will show token expiration in magenta status.
Where are my credentials stored?
Your session tokens are stored in ~/.magenta/config.json with secure file permissions (0600). Your password is never stored - only the session tokens.
What's the difference between invoice ID formats?
Magenta uses two formats:
- Bill Number:
123456789012(just the number) - Bill ID:
TMA.123456789012(with prefix)
The CLI accepts both formats for convenience.
- Built with Bun - The fast JavaScript runtime
- CLI powered by Commander.js
- Beautiful output with Chalk and Ora
- RSA encryption with node-forge
This project is licensed under the MIT License - see the LICENSE file for details.
Made with care in Austria