Skip to main content

A simple CLI client for kyun.sh

Project description

Kyun CLI (Beta)

A command-line interface for using kyun.sh.

Note: This project is currently in beta. Use the website for Stripe payments.


Installation

The following assumes you are on Linux. You will need to change some commands if on Windows or macOS.

Install from PyPI (Recommended)

Install with pipx:

sudo apt install pipx
pipx ensurepath
pipx install kyuncli

# Now you can use Kyun CLI
kyun account login

# To upgrade
pipx upgrade kyuncli

# To uninstall
pipx uninstall kyuncli

Install from releases

Use the .whl link from Releases:

pipx install <link-to-release>

Build it yourself

If you prefer to build the package yourself:

sudo apt install pipx
pipx ensurepath

git clone https://git.kyun.sh/nthpyrodev/kyuncli.git
cd kyuncli
python3 -m venv .venv
source .venv/bin/activate
pip install build
python -m build
deactivate

# Install your locally built wheel
pipx install dist/kyuncli-*.whl

# Now you can use Kyun CLI
kyun account login

# To uninstall
pipx uninstall kyuncli

Installing in a virtual environment (for development)

git clone https://git.kyun.sh/nthpyrodev/kyuncli.git
cd kyuncli
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Shell Autocompletion (Linux)

Enable tab completion using:

echo 'eval "$(_KYUN_COMPLETE=bash_source kyun)"' >> ~/.bashrc
source ~/.bashrc

Dependencies

  • click
  • httpx
  • requests
  • qrcode
  • keyring
  • platformdirs
  • websocket-client

Usage

Account Management

# Create a new account
kyun account create

# Login to your account to create the API to use
kyun account login

# Switch between accounts
kyun account switch <hash>

# List all accounts
kyun account list

# Check balance
kyun account balance

# Remove an account (does not delete your account, just removes it locally)
kyun account remove <hash>

SSH Key Management

# List SSH keys
kyun account ssh list

# Add SSH key from file
kyun account ssh add --file ~/.ssh/id_rsa.pub --name "My Key"

# Add SSH key directly
kyun account ssh add --key "ssh-rsa AAAAB3..." --name "My Key"

# Rename SSH key
kyun account ssh rename <key_id> "New Name"

# Delete SSH key
kyun account ssh delete <key_id>

Contact Information Management

# Get contact information
kyun account contact get

# Update email address
kyun account contact update --email "your@email.com"

# Update Matrix ID
kyun account contact update --matrix "@user:matrix.org"

# Update both email and Matrix
kyun account contact update --email "your@email.com" --matrix "@user:matrix.org"

# Link Telegram account
kyun account contact telegram link --code "ABC123"

# Unlink Telegram account
kyun account contact telegram unlink

2FA/OTP Management

# Check if 2FA is enabled
kyun account otp status

# Enable 2FA (Also creates backup scratch token)
kyun account otp enable

# Disable 2FA
kyun account otp disable

Danbo Management

# List all Danbos
kyun danbo list

# Get detailed Danbo info
kyun danbo get <danbo_id>

# Buy a new Danbo
kyun danbo buy

# Rename a Danbo
kyun danbo rename <danbo_id> "New Name"

# View Danbo resource usage statistics
kyun danbo stats <danbo_id>

# View stats for last 60 minutes
kyun danbo stats <danbo_id> --minutes 60

# Delete a Danbo (Irreversible)
kyun danbo manage delete <danbo_id>

# Cancel a Danbo (deleted on next renewal)
kyun danbo manage cancel <danbo_id>

# Cancel a Danbo with 2FA code
kyun danbo manage cancel <danbo_id>

Danbo Power Management

# Start a Danbo
kyun danbo power start <danbo_id>

# Stop a Danbo
kyun danbo power stop <danbo_id>

# Reboot a Danbo
kyun danbo power reboot <danbo_id>

# Graceful shutdown
kyun danbo power shutdown <danbo_id>

Danbo Specs Management

# View current specs
kyun danbo get <danbo_id>

# Check max upgrade options
kyun danbo specs max-upgrade <danbo_id>

# Change specs
kyun danbo specs change <danbo_id>

Danbo IP Management

# Show danbo information
kyun danbo get <danbo_id>

# Add IPv4
kyun danbo ip add <danbo_id>

# Remove IPv4
kyun danbo ip remove <danbo_id> <ip_address>

# Set primary IP
kyun danbo ip set-primary-ip <danbo_id> <ip_address>

# List reverse DNS entries for an IP
kyun danbo ip rdns list <danbo_id> <ip_address>

# Add reverse DNS entry
kyun danbo ip rdns add <danbo_id> <ip_address> <domain>

# Remove reverse DNS entry
kyun danbo ip rdns remove <danbo_id> <ip_address> <domain>

Danbo SSH Management

# View authorized keys
kyun danbo ssh get-authorized <danbo_id>

# Set authorized keys from account (Replaces existing)
kyun danbo ssh set-authorized <danbo_id> --from-account

# Set authorized keys from file (Replaces existing)
kyun danbo ssh set-authorized <danbo_id> --file ~/.ssh/authorized_keys

# Add key to authorized keys
kyun danbo ssh add-to-authorized <danbo_id> --key "ssh-rsa AAAAB3..."

# Remove key from authorized keys
kyun danbo ssh remove-from-authorized <danbo_id> --key "ssh-rsa AAAAB3.."

# Get SSH host keys
kyun danbo ssh get-host-keys <danbo_id>

Danbo Bandwidth Management

# Check current bandwidth limit
kyun danbo bandwidth get <danbo_id>

# Set bandwidth limit (--limit flag optional)
kyun danbo bandwidth set <danbo_id> --limit 100

# Clear bandwidth limit
kyun danbo bandwidth clear <danbo_id>

Danbo OS Management

# Install an OS on a Danbo
kyun danbo os install <danbo_id>

# Get the installed OS name
kyun danbo os get <danbo_id>

# Set the OS name
kyun danbo os set <danbo_id> "Debian 12 Bookworm"

Danbo Subdomain Management

# List subdomains
kyun danbo subdomains list <danbo_id>

# Create subdomain
kyun danbo subdomains create <danbo_id> --name "subdomain" --domain "kyun.li" --ip "ip_address"

# Delete subdomain
kyun danbo subdomains delete <danbo_id> <subdomain_id>

Danbo Brick Management

# List attached Bricks
kyun danbo bricks list <danbo_id>

# Attach Brick to Danbo
kyun danbo bricks attach <danbo_id> <brick_id>

# Detach Brick from Danbo
kyun danbo bricks detach <danbo_id> <brick_id>

Brick Storage Management

# List all Bricks
kyun brick list

# Get Brick details
kyun brick get <brick_id>

# Buy a new Brick
kyun brick buy

# Grow a Brick
kyun brick grow <brick_id>

# Check max growth
kyun brick max-grow <brick_id>

# Delete a Brick (Irreversible)
kyun brick delete <brick_id>

# Unsuspend a Brick
kyun brick unsuspend <brick_id>

Deposit Management

# View exchange rates
kyun deposit rates

# List pending deposits
kyun deposit pending

# Create new deposit
kyun deposit create

# Get deposit info
kyun deposit get <deposit_id>

# Check deposit status
kyun deposit status <deposit_id>

Support Chat

# List all chats
kyun chat list

# Start new chat
kyun chat start

# Start chat using ultra private mode
kyun chat start --private

# Open live chat session
kyun chat open <chat_id>

# Use commands inside live chat session:
# /help

# Delete chat
kyun chat delete <chat_id>

# Check online staff
kyun chat staff

# Enable ultra private mode
kyun chat privacy enable <chat_id>

# Disable ultra private mode
kyun chat privacy disable <chat_id>

Configuration

Config File Location

Account info is stored in a config file:

  • Linux: ~/.config/kyuncli/config.json
  • macOS: ~/Library/Application Support/kyuncli/config.json
  • Windows: %APPDATA%\kyuncli\config.json

The config file stores:

  • Account hash
  • User ID

TODO

  • Add Stripe support
  • Add serial access

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

kyuncli-0.1.2b4.tar.gz (46.5 kB view details)

Uploaded Source

Built Distribution

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

kyuncli-0.1.2b4-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file kyuncli-0.1.2b4.tar.gz.

File metadata

  • Download URL: kyuncli-0.1.2b4.tar.gz
  • Upload date:
  • Size: 46.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for kyuncli-0.1.2b4.tar.gz
Algorithm Hash digest
SHA256 9fd622d5a22d77828819886ceac77498300006803050983c6bd1517b40fb5ffc
MD5 06756b2f6032e5f2d303a6529c0692bd
BLAKE2b-256 d46270c6e34b8bf8f59eccfcd6235594f5a191a45e97346fdb980a4ae85531c1

See more details on using hashes here.

File details

Details for the file kyuncli-0.1.2b4-py3-none-any.whl.

File metadata

  • Download URL: kyuncli-0.1.2b4-py3-none-any.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for kyuncli-0.1.2b4-py3-none-any.whl
Algorithm Hash digest
SHA256 663e0959fe04b3fd4f7f803859db0cb0f410aeccb31e1646056c9c350f48c204
MD5 1bef41cfbd8268ea3f22a37efd48a77a
BLAKE2b-256 7d370575ca66b064e29145e3b7e1d05718b8b1368201d14283b498b6bbabf407

See more details on using hashes here.

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