Skip to content

Repository files navigation

rubika-cli

A typed Rubika CLI for personal account automation over Rubika's encrypted web/private JSON services. Its command conventions now match the Bale CLI: named profiles, global debug flags, structured failures, raw response artifacts, predictable exit behavior, and familiar auth, contacts, messages, profiles, diagnostics, and raw groups.

Features

  • OTP login for multiple isolated profiles
  • active-profile selection and per-command --profile
  • contacts, dialogs, history, search, text sends, and single-file media sends
  • target resolution by GUID, phone, contact name, or recent-dialog title
  • explicit confirmation for sends with --yes automation override
  • layered detection for request, network, HTTP, JSON, encryption, application, and upload failures
  • HTTP and application rate-limit detection using explicit server signals
  • retry-time parsing from Retry-After and known Rubika response fields
  • safe API-host failover for network/server/protocol failures
  • --debug -v/-vv/-vvv response logging and exact raw response artifacts
  • HAR failure inspection

The project does not classify an account as limited merely because several sends failed. Rate limits, blocks, permissions, restrictions, and authentication failures are classified from explicit HTTP or decrypted Rubika response data.

Install

uv sync --extra dev
uv run rubika --help

Or:

uv tool install .
rubika --help

Quick start

rubika --profile personal auth login 09123456789
rubika profiles use personal
rubika status
rubika contacts list
rubika messages dialogs
rubika messages send Hamed "hello" --yes

Debug a send and preserve the actual response:

rubika --profile personal --debug -vvv messages send Hamed "hello" --yes

Inspect a HAR:

rubika diagnostics har-errors ./rubika.har --json

Profile storage

~/.config/rubika-cli/profiles/active-profile.json
~/.config/rubika-cli/profiles/<profile>/session.json
~/.config/rubika-cli/profiles/<profile>/session.json.challenge

Session files contain Rubika authentication and private-key material. They are created with owner-only permissions. Never commit or share them.

Debug security

Debug sessions default to .rubika-debug/<timestamp>-pid<id>/. Request JSON and structured logs redact auth keys, private keys, signatures, cookies, OTP data, and token-shaped fields. Exact raw response files and decoded response artifacts can still contain private account content; inspect them before sharing.

Protocol note

The supplied Rubika assets and HAR use JSON over HTTPS with optional data_enc encryption, not Bale's gRPC-Web protocol. Consequently, this CLI implements Rubika-specific HTTP, JSON, decryption, and application-status handling while keeping the user-facing CLI conventions consistent with Bale.

Documentation

Quality checks

uv run --extra dev pytest
uv run --extra dev ruff check src tests
uv run --extra dev mypy

Acceptable use

Use this only with your own Rubika accounts and with recipients who expect communication. The CLI does not include scraping, contact harvesting, or multi-recipient blasting.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages