Skip to main content

Command-line tools for Kumiho Cloud asset management

Project description

kumiho-cli

Command-line tools for Kumiho Cloud asset management system.

PyPI version Python 3.8+ License

Overview

kumiho-cli provides command-line utilities for authenticating with Kumiho Cloud and managing credentials. It's used by all Kumiho SDKs (Python, C++, Dart, FastAPI) to provide a unified authentication experience.

Installation

pip install kumiho-cli

Or install with pipx (recommended for CLI tools):

pipx install kumiho-cli

Quick Start

Login

Authenticate with your Kumiho Cloud credentials:

kumiho-cli login

This will:

  1. Prompt for your Kumiho Cloud email and password
  2. Obtain authentication tokens from Firebase
  3. Exchange for a Control Plane JWT
  4. Store credentials securely in ~/.kumiho/kumiho_authentication.json

Refresh Token

Refresh your authentication token:

kumiho-cli refresh

Check Status

View your current authentication status:

kumiho-cli whoami

Credential Storage

Credentials are stored in:

  • Location: ~/.kumiho/kumiho_authentication.json
  • Permissions: 0600 (read/write for owner only)
  • Format: JSON with Firebase ID token, refresh token, and Control Plane JWT

Environment Variables

Variable Description Default
KUMIHO_CONFIG_DIR Override config directory ~/.kumiho
KUMIHO_FIREBASE_API_KEY Firebase API key (built-in)
KUMIHO_FIREBASE_PROJECT_ID Firebase project ID (optional)
KUMIHO_CONTROL_PLANE_API_URL Control plane URL https://kumiho.io
KUMIHO_AUTH_TOKEN_GRACE_SECONDS Token refresh grace period 300

Usage with SDKs

Python SDK

# Install kumiho with CLI tools
pip install kumiho[cli]

# Or install separately
pip install kumiho kumiho-cli
import kumiho

# Automatically uses credentials from kumiho-cli
kumiho.auto_configure_from_discovery()
projects = kumiho.get_projects()

C++ SDK

# One-time setup
pip install kumiho-cli
kumiho-cli login
#include <kumiho/kumiho.hpp>

// Automatically loads tokens from ~/.kumiho/
auto client = kumiho::Client::createFromEnv();

Commands

login

Interactive login with email and password.

kumiho-cli login [--api-key KEY] [--project-id ID]

Options:

  • --api-key: Override Firebase API key (default: uses built-in key)
  • --project-id: Specify Firebase project ID (optional)

refresh

Refresh the cached authentication token.

kumiho-cli refresh

whoami

Display current user information.

kumiho-cli whoami

Security Best Practices

  1. Never commit credentials: Add ~/.kumiho/ to your .gitignore
  2. Use environment variables in CI/CD: Set KUMIHO_AUTH_TOKEN instead of storing files
  3. Rotate tokens regularly: Use kumiho-cli refresh to get fresh tokens
  4. Protect credential files: The CLI automatically sets 0600 permissions

CI/CD Integration

For automated environments (GitHub Actions, Jenkins, etc.):

# Option 1: Use environment variable
export KUMIHO_AUTH_TOKEN="your-token-here"

# Option 2: Non-interactive login (if supported by your CI)
echo "password" | kumiho-cli login --email user@example.com

Development

Install from source

git clone https://github.com/kumihoclouds/kumiho-python.git
cd kumiho-python/kumiho-cli
pip install -e ".[dev]"

Run tests

pytest tests/

Troubleshooting

"No cached credentials found"

Run kumiho-cli login to authenticate.

"Token expired"

Run kumiho-cli refresh to get a fresh token.

"Permission denied" on credential file

chmod 600 ~/.kumiho/kumiho_authentication.json

Links

License

Apache License 2.0 - see LICENSE for details.

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

kumiho_cli-1.0.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

kumiho_cli-1.0.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file kumiho_cli-1.0.0.tar.gz.

File metadata

  • Download URL: kumiho_cli-1.0.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kumiho_cli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c279ab900d74a8a701b56f67ac9ba917733bab180e95c451f4b1b89a70236cb4
MD5 25dbb5286855de36f677c53ad172e08a
BLAKE2b-256 4b433a359bb8ed910b718c2476fe4bfa16a1d4f5c108b7df0af6898f150195bd

See more details on using hashes here.

File details

Details for the file kumiho_cli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: kumiho_cli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kumiho_cli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d915f7ec8c3810dbe28526f48efc22885c2460e64f56ff9d90f8e7542911fd48
MD5 a99df5bd59e0512ad9da4cd9cf71869d
BLAKE2b-256 a52d1fed44e7efedbe64be10a6aad990df309de036a856626944380aca0c5698

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