| Name | gcphcp JSON |
| Version |
0.1.2
JSON |
| download |
| home_page | None |
| Summary | A command-line interface for Google Cloud Platform Hosted Control Planes |
| upload_time | 2025-10-28 15:07:47 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.8 |
| license | None |
| keywords |
cli
clusters
gcp
hcp
kubernetes
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# GCP HCP CLI
A command-line interface for Google Cloud Platform Hosted Control Planes, providing gcloud-style commands for managing clusters and nodepools.
[](https://badge.fury.io/py/gcphcp)
[](https://pypi.org/project/gcphcp/)
[](https://opensource.org/licenses/Apache-2.0)
## Features
- **gcloud-style interface**: Familiar command structure and output formatting
- **Multiple output formats**: Table, JSON, YAML, CSV, and value formats
- **Google Cloud authentication**: Integrated OAuth 2.0 flow with credential management
- **Comprehensive cluster management**: Create, list, describe, update, and delete clusters
- **NodePool operations**: Full CRUD operations for cluster nodepools
- **Rich status information**: Detailed cluster and nodepool status with conditions
- **Configuration management**: Flexible configuration with profiles and defaults
- **Extensive testing**: Comprehensive unit and integration test coverage
## Installation
### From PyPI (Recommended)
```bash
pip install gcphcp
```
### From Source
```bash
git clone https://github.com/gcp-hcp/gcp-hcp-cli.git
cd gcp-hcp-cli
pip install -e .
```
### Development Installation
```bash
git clone https://github.com/gcp-hcp/gcp-hcp-cli.git
cd gcp-hcp-cli
make install-dev
```
## Quick Start
### 1. Initialize Configuration
```bash
gcphcp config init
# Follow the prompts to set API endpoint and default project
```
### 2. Authenticate
```bash
gcphcp auth login
# Opens browser for OAuth 2.0 authentication
```
### 3. List Clusters
```bash
gcphcp clusters list
```
### 4. Create a Cluster
```bash
gcphcp clusters create my-cluster --project my-gcp-project
```
## Usage
### Authentication
```bash
# Login with Google Cloud Platform
gcphcp auth login
# Check authentication status
gcphcp auth status
# Get current access token
gcphcp auth token
# Logout (remove stored credentials)
gcphcp auth logout
```
### Configuration
```bash
# Initialize configuration interactively
gcphcp config init
# Set configuration values
gcphcp config set api_endpoint https://api.example.com
gcphcp config set default_project my-project-id
# Get configuration values
gcphcp config get api_endpoint
gcphcp config list
# Show configuration file location
gcphcp config path
```
### Cluster Management
```bash
# List all clusters
gcphcp clusters list
# List clusters with filtering
gcphcp clusters list --status Ready --limit 20
# Create a new cluster
gcphcp clusters create my-cluster --project my-project
# Describe a cluster
gcphcp clusters describe abc123def456
# Get detailed cluster status
gcphcp clusters status abc123def456
# Delete a cluster
gcphcp clusters delete abc123def456
```
### NodePool Management
```bash
# List nodepools for a cluster
gcphcp nodepools list --cluster abc123def456
# Create a new nodepool
gcphcp nodepools create workers --cluster abc123def456 \
--machine-type n1-standard-4 --node-count 3
# Describe a nodepool
gcphcp nodepools describe nodepool-id
# Update a nodepool
gcphcp nodepools update nodepool-id --node-count 5
# Delete a nodepool
gcphcp nodepools delete nodepool-id
```
### Output Formatting
The CLI supports multiple output formats, similar to gcloud:
```bash
# Table format (default)
gcphcp clusters list
# JSON format
gcphcp clusters list --format json
# YAML format
gcphcp clusters list --format yaml
# CSV format
gcphcp clusters list --format csv
# Value format (for scripting)
gcphcp clusters list --format value
```
### Global Options
All commands support these global options:
- `--config`: Path to configuration file
- `--api-endpoint`: Override API endpoint URL
- `--project`: Override default project
- `--format`: Output format (table, json, yaml, csv, value)
- `--verbose` / `-v`: Increase verbosity (can be repeated)
- `--quiet` / `-q`: Suppress non-essential output
## Configuration
The CLI uses a YAML configuration file located at `~/.gcphcp/config.yaml` by default.
### Example Configuration
```yaml
api_endpoint: https://api.gcphcp.example.com
default_project: my-gcp-project
credentials_path: ~/.gcphcp/credentials.json
# Optional: OAuth client secrets for custom authentication
client_secrets_path: ~/.gcphcp/client_secrets.json
```
### Configuration Options
| Setting | Description | Default |
|---------|-------------|---------|
| `api_endpoint` | GCP HCP API endpoint URL | Required |
| `default_project` | Default GCP project ID | None |
| `credentials_path` | Path to stored credentials | `~/.gcphcp/credentials.json` |
| `client_secrets_path` | Path to OAuth client secrets | None |
## Authentication
The CLI uses Google Cloud Platform OAuth 2.0 authentication with the following scopes:
- `openid`: OpenID Connect
- `email`: User email address
- `profile`: User profile information
- `https://www.googleapis.com/auth/cloud-platform`: Cloud Platform access
### Authentication Flow
1. Run `gcphcp auth login`
2. Browser opens to Google OAuth consent screen
3. Grant permissions to the application
4. Credentials are stored securely for future use
5. The user's email is automatically included in API requests
## Development
### Setup Development Environment
```bash
git clone https://github.com/gcp-hcp/gcp-hcp-cli.git
cd gcp-hcp-cli
make setup-dev
```
### Running Tests
```bash
# Run all tests
make test
# Run unit tests only
make test-unit
# Run integration tests only
make test-integration
# Run with coverage
pytest --cov=gcphcp
```
### Code Quality
```bash
# Format code
make format
# Run linting
make lint
# Type checking
mypy src
```
### Building and Publishing
```bash
# Build package
make build
# Publish to PyPI (requires credentials)
make publish
```
## API Compatibility
This CLI is designed to work with GCP HCP API v1. The following endpoints are supported:
- `GET /health` - Health check
- `GET /api/v1/clusters` - List clusters
- `POST /api/v1/clusters` - Create cluster
- `GET /api/v1/clusters/{id}` - Get cluster
- `PUT /api/v1/clusters/{id}` - Update cluster
- `DELETE /api/v1/clusters/{id}` - Delete cluster
- `GET /api/v1/clusters/{id}/status` - Get cluster status
- `GET /api/v1/nodepools` - List nodepools
- `POST /api/v1/nodepools` - Create nodepool
- `GET /api/v1/nodepools/{id}` - Get nodepool
- `PUT /api/v1/nodepools/{id}` - Update nodepool
- `DELETE /api/v1/nodepools/{id}` - Delete nodepool
## Contributing
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
### Reporting Issues
Please report issues on the [GitHub issue tracker](https://github.com/gcp-hcp/gcp-hcp-cli/issues).
### Development Guidelines
1. Follow PEP 8 style guidelines
2. Write comprehensive tests for new features
3. Update documentation for user-facing changes
4. Use type hints for all new code
5. Follow semantic versioning for releases
## License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
## Support
- Documentation: [https://gcp-hcp-cli.readthedocs.io](https://gcp-hcp-cli.readthedocs.io)
- Issue tracker: [https://github.com/gcp-hcp/gcp-hcp-cli/issues](https://github.com/gcp-hcp/gcp-hcp-cli/issues)
- PyPI package: [https://pypi.org/project/gcphcp/](https://pypi.org/project/gcphcp/)
## Changelog
See [CHANGELOG.md](CHANGELOG.md) for a history of changes to this project.
Raw data
{
"_id": null,
"home_page": null,
"name": "gcphcp",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "cli, clusters, gcp, hcp, kubernetes",
"author": null,
"author_email": "Red Hat GCP HCP Team <hcm-gcp-hcp@redhat.com>",
"download_url": "https://files.pythonhosted.org/packages/05/dd/57f010a34443da240e3398214eb7d35e8278d7dab8005a846fb4d1d10808/gcphcp-0.1.2.tar.gz",
"platform": null,
"description": "# GCP HCP CLI\n\nA command-line interface for Google Cloud Platform Hosted Control Planes, providing gcloud-style commands for managing clusters and nodepools.\n\n[](https://badge.fury.io/py/gcphcp)\n[](https://pypi.org/project/gcphcp/)\n[](https://opensource.org/licenses/Apache-2.0)\n\n## Features\n\n- **gcloud-style interface**: Familiar command structure and output formatting\n- **Multiple output formats**: Table, JSON, YAML, CSV, and value formats\n- **Google Cloud authentication**: Integrated OAuth 2.0 flow with credential management\n- **Comprehensive cluster management**: Create, list, describe, update, and delete clusters\n- **NodePool operations**: Full CRUD operations for cluster nodepools\n- **Rich status information**: Detailed cluster and nodepool status with conditions\n- **Configuration management**: Flexible configuration with profiles and defaults\n- **Extensive testing**: Comprehensive unit and integration test coverage\n\n## Installation\n\n### From PyPI (Recommended)\n\n```bash\npip install gcphcp\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/gcp-hcp/gcp-hcp-cli.git\ncd gcp-hcp-cli\npip install -e .\n```\n\n### Development Installation\n\n```bash\ngit clone https://github.com/gcp-hcp/gcp-hcp-cli.git\ncd gcp-hcp-cli\nmake install-dev\n```\n\n## Quick Start\n\n### 1. Initialize Configuration\n\n```bash\ngcphcp config init\n# Follow the prompts to set API endpoint and default project\n```\n\n### 2. Authenticate\n\n```bash\ngcphcp auth login\n# Opens browser for OAuth 2.0 authentication\n```\n\n### 3. List Clusters\n\n```bash\ngcphcp clusters list\n```\n\n### 4. Create a Cluster\n\n```bash\ngcphcp clusters create my-cluster --project my-gcp-project\n```\n\n## Usage\n\n### Authentication\n\n```bash\n# Login with Google Cloud Platform\ngcphcp auth login\n\n# Check authentication status\ngcphcp auth status\n\n# Get current access token\ngcphcp auth token\n\n# Logout (remove stored credentials)\ngcphcp auth logout\n```\n\n### Configuration\n\n```bash\n# Initialize configuration interactively\ngcphcp config init\n\n# Set configuration values\ngcphcp config set api_endpoint https://api.example.com\ngcphcp config set default_project my-project-id\n\n# Get configuration values\ngcphcp config get api_endpoint\ngcphcp config list\n\n# Show configuration file location\ngcphcp config path\n```\n\n### Cluster Management\n\n```bash\n# List all clusters\ngcphcp clusters list\n\n# List clusters with filtering\ngcphcp clusters list --status Ready --limit 20\n\n# Create a new cluster\ngcphcp clusters create my-cluster --project my-project\n\n# Describe a cluster\ngcphcp clusters describe abc123def456\n\n# Get detailed cluster status\ngcphcp clusters status abc123def456\n\n# Delete a cluster\ngcphcp clusters delete abc123def456\n```\n\n### NodePool Management\n\n```bash\n# List nodepools for a cluster\ngcphcp nodepools list --cluster abc123def456\n\n# Create a new nodepool\ngcphcp nodepools create workers --cluster abc123def456 \\\n --machine-type n1-standard-4 --node-count 3\n\n# Describe a nodepool\ngcphcp nodepools describe nodepool-id\n\n# Update a nodepool\ngcphcp nodepools update nodepool-id --node-count 5\n\n# Delete a nodepool\ngcphcp nodepools delete nodepool-id\n```\n\n### Output Formatting\n\nThe CLI supports multiple output formats, similar to gcloud:\n\n```bash\n# Table format (default)\ngcphcp clusters list\n\n# JSON format\ngcphcp clusters list --format json\n\n# YAML format\ngcphcp clusters list --format yaml\n\n# CSV format\ngcphcp clusters list --format csv\n\n# Value format (for scripting)\ngcphcp clusters list --format value\n```\n\n### Global Options\n\nAll commands support these global options:\n\n- `--config`: Path to configuration file\n- `--api-endpoint`: Override API endpoint URL\n- `--project`: Override default project\n- `--format`: Output format (table, json, yaml, csv, value)\n- `--verbose` / `-v`: Increase verbosity (can be repeated)\n- `--quiet` / `-q`: Suppress non-essential output\n\n## Configuration\n\nThe CLI uses a YAML configuration file located at `~/.gcphcp/config.yaml` by default.\n\n### Example Configuration\n\n```yaml\napi_endpoint: https://api.gcphcp.example.com\ndefault_project: my-gcp-project\ncredentials_path: ~/.gcphcp/credentials.json\n\n# Optional: OAuth client secrets for custom authentication\nclient_secrets_path: ~/.gcphcp/client_secrets.json\n```\n\n### Configuration Options\n\n| Setting | Description | Default |\n|---------|-------------|---------|\n| `api_endpoint` | GCP HCP API endpoint URL | Required |\n| `default_project` | Default GCP project ID | None |\n| `credentials_path` | Path to stored credentials | `~/.gcphcp/credentials.json` |\n| `client_secrets_path` | Path to OAuth client secrets | None |\n\n## Authentication\n\nThe CLI uses Google Cloud Platform OAuth 2.0 authentication with the following scopes:\n\n- `openid`: OpenID Connect\n- `email`: User email address\n- `profile`: User profile information\n- `https://www.googleapis.com/auth/cloud-platform`: Cloud Platform access\n\n### Authentication Flow\n\n1. Run `gcphcp auth login`\n2. Browser opens to Google OAuth consent screen\n3. Grant permissions to the application\n4. Credentials are stored securely for future use\n5. The user's email is automatically included in API requests\n\n## Development\n\n### Setup Development Environment\n\n```bash\ngit clone https://github.com/gcp-hcp/gcp-hcp-cli.git\ncd gcp-hcp-cli\nmake setup-dev\n```\n\n### Running Tests\n\n```bash\n# Run all tests\nmake test\n\n# Run unit tests only\nmake test-unit\n\n# Run integration tests only\nmake test-integration\n\n# Run with coverage\npytest --cov=gcphcp\n```\n\n### Code Quality\n\n```bash\n# Format code\nmake format\n\n# Run linting\nmake lint\n\n# Type checking\nmypy src\n```\n\n### Building and Publishing\n\n```bash\n# Build package\nmake build\n\n# Publish to PyPI (requires credentials)\nmake publish\n```\n\n## API Compatibility\n\nThis CLI is designed to work with GCP HCP API v1. The following endpoints are supported:\n\n- `GET /health` - Health check\n- `GET /api/v1/clusters` - List clusters\n- `POST /api/v1/clusters` - Create cluster\n- `GET /api/v1/clusters/{id}` - Get cluster\n- `PUT /api/v1/clusters/{id}` - Update cluster\n- `DELETE /api/v1/clusters/{id}` - Delete cluster\n- `GET /api/v1/clusters/{id}/status` - Get cluster status\n- `GET /api/v1/nodepools` - List nodepools\n- `POST /api/v1/nodepools` - Create nodepool\n- `GET /api/v1/nodepools/{id}` - Get nodepool\n- `PUT /api/v1/nodepools/{id}` - Update nodepool\n- `DELETE /api/v1/nodepools/{id}` - Delete nodepool\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n### Reporting Issues\n\nPlease report issues on the [GitHub issue tracker](https://github.com/gcp-hcp/gcp-hcp-cli/issues).\n\n### Development Guidelines\n\n1. Follow PEP 8 style guidelines\n2. Write comprehensive tests for new features\n3. Update documentation for user-facing changes\n4. Use type hints for all new code\n5. Follow semantic versioning for releases\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- Documentation: [https://gcp-hcp-cli.readthedocs.io](https://gcp-hcp-cli.readthedocs.io)\n- Issue tracker: [https://github.com/gcp-hcp/gcp-hcp-cli/issues](https://github.com/gcp-hcp/gcp-hcp-cli/issues)\n- PyPI package: [https://pypi.org/project/gcphcp/](https://pypi.org/project/gcphcp/)\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a history of changes to this project.",
"bugtrack_url": null,
"license": null,
"summary": "A command-line interface for Google Cloud Platform Hosted Control Planes",
"version": "0.1.2",
"project_urls": {
"Bug Tracker": "https://github.com/gcp-hcp/gcp-hcp-cli/issues",
"Documentation": "https://gcp-hcp-cli.readthedocs.io",
"Homepage": "https://github.com/gcp-hcp/gcp-hcp-cli",
"Repository": "https://github.com/gcp-hcp/gcp-hcp-cli.git"
},
"split_keywords": [
"cli",
" clusters",
" gcp",
" hcp",
" kubernetes"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "cf7b8bf0ea0f7509591b371fdb6af3d98821689d86d33fb14079e8ea4188a678",
"md5": "092f5e99d8499bd2db4b91c9da14525c",
"sha256": "84a475c898384af8c546012c855d51b351f60a59a0f419d0e175312ac387ce43"
},
"downloads": -1,
"filename": "gcphcp-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "092f5e99d8499bd2db4b91c9da14525c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 37736,
"upload_time": "2025-10-28T15:07:46",
"upload_time_iso_8601": "2025-10-28T15:07:46.812040Z",
"url": "https://files.pythonhosted.org/packages/cf/7b/8bf0ea0f7509591b371fdb6af3d98821689d86d33fb14079e8ea4188a678/gcphcp-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "05dd57f010a34443da240e3398214eb7d35e8278d7dab8005a846fb4d1d10808",
"md5": "8e763d76ccd5151a7996868d27e84067",
"sha256": "a843c0ce08e69bb718ecf42d45c1749b13a22540c1384abc2963e60e48338ed3"
},
"downloads": -1,
"filename": "gcphcp-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "8e763d76ccd5151a7996868d27e84067",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 40162,
"upload_time": "2025-10-28T15:07:47",
"upload_time_iso_8601": "2025-10-28T15:07:47.799658Z",
"url": "https://files.pythonhosted.org/packages/05/dd/57f010a34443da240e3398214eb7d35e8278d7dab8005a846fb4d1d10808/gcphcp-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-28 15:07:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gcp-hcp",
"github_project": "gcp-hcp-cli",
"github_not_found": true,
"lcname": "gcphcp"
}