Skip to main content

A command-line tool for executing SQL commands against the Onehouse API

Project description

Onehouse CLI

A command-line tool for executing SQL commands against the Onehouse API with synchronous responses.

Setup

  1. Create a virtual environment and install dependencies:

    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    
  2. Configure credentials: From withing the onehouse-cli directory, run:

    ./onehouse-cli-configure
    

    Prompts for: Profile name, Account UID, Project UID, API Key, API Secret, Project Region, User ID, Request ID, Environment (production or staging)

    Note: The tool will ask if you want to automatically add the CLI tools to your shell PATH for global access.

  3. Credentials are stored in: ~/.onehouse/credentials

Usage

Execute SQL commands:

onehouse-cli --command "SHOW LAKES" --profile myprofile

List available profiles:

onehouse-cli --list-profiles

Custom timeout (default: 10 minutes):

onehouse-cli --command "ALTER OCU SET LIMIT = '3'" --profile myprofile --timeout 5

Features

  • Synchronous execution: Automatically polls for completion (1s intervals)
  • Multiple profiles: Store and switch between different API credentials
  • Error handling: Clear error messages with headers and response details
  • Timeout control: Configurable wait time for long-running operations
  • Status checking: Check the status of an existing request by providing its request ID

Examples

# Configure first profile
./onehouse-cli-configure

# Execute queries
onehouse-cli --command "SHOW LAKES" --profile apex
onehouse-cli --command "DELETE CLUSTER managed_cluster_retail" --profile apex

# Manage profiles
onehouse-cli --list-profiles

# Check status of an existing request
onehouse-cli --check-status "<REQUEST_ID>" --profile myprofile

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

onehouse_cli-0.1.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

onehouse_cli-0.1.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onehouse_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for onehouse_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ad1116d0f0fb439d48e1a35b501f4e6581ef5c833268121ca4986a02f5946fae
MD5 fc73976efaaf8bbe7a4d7e85eef0d32d
BLAKE2b-256 f26ec527b0c7d9ba415326a45b2ba6dcae4f5da52a4ea61c1b7263bbef3b458a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onehouse_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for onehouse_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8ff3b9767341dfd8bc3f6efb11e5ce1a4435c8c830f2640b1beb1c89297d536
MD5 4307875a50f654496cda4d0f4ba928ff
BLAKE2b-256 b1113cb6706c2aa25a71edefc51c6f09ae90a174d5fd7cfe71e5016ffe95814a

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