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.1.tar.gz (8.7 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.1-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: onehouse_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 8.7 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.1.tar.gz
Algorithm Hash digest
SHA256 08aaa8d3182be14f404fe948456d9a3055e9d098b6a32c58886775562df9e76f
MD5 73e760ed18561cefac7e248e84a5c512
BLAKE2b-256 dde87e6a23ed44bb6ccad63a7f4794046c52318fedd857beb62aafc0f1e6eb60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: onehouse_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c092d2466736f0075a41cd94d8e6e9b1722e195db90fe74a0168c48aaaf652e
MD5 8f644be0ab442b23263139554871b4c2
BLAKE2b-256 1ef4f22e4c7e53ee8ea20ee79c172b927e770bfe648e1f1d6bd6354e946257ae

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