Skip to main content

Terminal client for OnlySq Cloud 2.0 — talks to https://cloud.onlysq.ru via REST

Project description

cloud-tc

Terminal client for OnlySq Cloud 2.0 (https://cloud.onlysq.ru). Talks to the public v2 REST API — no Telegram, no Postgres on your machine, just httpx + typer + rich.

Install

From PyPI (when published):

pip install cloud-tc

Straight from git:

pip install git+https://github.com/xOnlySq/cloud-tc.git

Or for a local checkout (with -e for editable):

git clone https://github.com/xOnlySq/cloud-tc.git
cd cloud-tc
pip install -e .

Both tc and cloud-tc console scripts are installed.

Quick start

  1. Create an API token in the web UI: https://cloud.onlysq.ru/v2/ui/settings → "new token".

  2. Log in locally:

    tc login --token tck_xxxxxxxxxxxxxxxxxxxx
    

    The token is stored in ~/.cloud-tc/config.json (0600).

  3. Use it:

    tc me
    tc quota
    tc ls
    tc upload ./photo.jpg
    tc share <uid> --role viewer
    

Commands

Command Description
tc login --token tck_… Save and verify an API token
tc logout Remove local config
tc info Show local config
tc version Print package version
tc me Show current user profile
tc quota Show used / total quota
tc ls [FOLDER_ID] List files
tc upload PATH [-f FOLDER] Upload a local file
tc download UID [-o PATH] Download a file
tc rm UID Move to trash
tc restore UID Restore from trash
tc mv UID FOLDER_ID Move file to another folder
tc rename UID NEW_NAME Rename
tc mkdir NAME [-p PARENT_ID] Create folder
tc share UID [-r ROLE] [--password] [--expires] [--max-uses] Create a share link
tc tokens list / create NAME / revoke ID Manage API tokens
tc migrate-self LEGACY_TOKEN Move a legacy account to v2 (no auth required)

Configuration

You can override the server with environment variables (useful for self-hosted instances):

export TC_BASE_URL="https://cloud.example.com"
export TC_TOKEN="tck_..."
tc ls

TC_TOKEN overrides the saved token if set. TC_BASE_URL overrides the configured base URL.

Config file: ~/.cloud-tc/config.json — just { "token": "...", "base_url": "..." }.

Examples

Upload everything from a directory into a folder:

for f in *.jpg; do tc upload "$f" -f 42; done

Pipe a file through tc upload (Linux):

tc upload /dev/stdin <<< "hello"   # named pipe trick, see issues for binary

Quick public link for a file:

UID=$(tc upload ./report.pdf | awk '{print $2}')
tc share "$UID" --role viewer

Batch-migrate one legacy token from any script:

tc migrate-self USERS_LEGACY_TOKEN

License

MIT. See LICENSE.

Related

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloud_tc-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cloud_tc-0.1.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file cloud_tc-0.1.0.tar.gz.

File metadata

  • Download URL: cloud_tc-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cloud_tc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b29a030911848c445913bfa978b85f217b48b728c9eb9e3f576ebfb20ef1bd3
MD5 d92f56689d4b63cf15dba0cd70d90858
BLAKE2b-256 a35a47c0af957243db2376c7f15876310224d3055b12a045483111c628cff070

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloud_tc-0.1.0.tar.gz:

Publisher: publish.yml on xOnlySq/cloud-tc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cloud_tc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cloud_tc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cloud_tc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 07ffda874f26aacb62ec89727124c238c931d5bfafd7aebd21030272050d5e46
MD5 71e4c32dea1553512a70c7b42bf9cfd6
BLAKE2b-256 681b35a4c6284896f2c3e9b8e5a5eaa1de176bb09b2b2a517b9e243abd3b97fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for cloud_tc-0.1.0-py3-none-any.whl:

Publisher: publish.yml on xOnlySq/cloud-tc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page