A CLI utility to manage Google Cloud Platform resource hierarchy paths.
Project description
gcpath
gcpath is a CLI utility to manage Google Cloud Platform resource hierarchy paths.
It helps you translate between GCP resource names (e.g., folders/12345) and human-readable paths (e.g., //example.com/department/team).
Features
- Recursive Listing: List all folders in your organization as paths.
- Path Resolution: Get the resource name (ID) for a given path.
- Reverse Lookup: Get the path for a given resource name (ID).
- Tree Visualization: View your hierarchy as a tree with depth limits.
- Dual Mode:
- Cloud Asset API (Default): Fast, bulk loading using GCP Cloud Asset Inventory.
- Resource Manager API: Iterative loading using standard Resource Manager API (slower, but different permissions).
Quick Start
After installation, ensure you are authenticated with Google Cloud and have the necessary permissions.
# List all resources
gcpath ls
# List children of a specific folder
gcpath ls folders/123456789
# Find ID of a specific path
gcpath name //example.com/engineering
# Find path of a specific resource ID
gcpath path folders/123456789
# View tree rooted at organization
gcpath tree
# View tree rooted at folder
gcpath tree folders/123456789
Usage
List Resources (ls)
List folders and projects. Defaults to the organization root.
gcpath ls [RESOURCE_NAME]
Options:
-l, --long: Show resource IDs and numbers (for projects).-R, --recursive: List resources recursively.
Examples:
# List all organizations and their top-level children
gcpath ls
# List all contents of an organization recursively
gcpath ls -R
# List children of a specific folder
gcpath ls folders/123456789
Tree View (tree)
Visualize the resource hierarchy in a tree format.
gcpath tree [RESOURCE_NAME]
Options:
-L, --level N: Limit depth of the tree (max 3).-i, --ids: Include resource IDs in the output.
Get Resource Name (name)
Get the GCP resource name (e.g., folders/123) from a path:
gcpath name //example.com/engineering/backend
To get just the ID:
gcpath name --id //example.com/engineering/backend
Get Path (path)
Get the path from a resource name:
gcpath path folders/987654321
Authentication
gcpath uses Google Cloud Application Default Credentials (ADC).
- Install gcloud CLI.
- Authenticate:
gcloud auth application-default login
Permissions
- Cloud Asset API:
cloudasset.assets.searchAllResourceson the Organization. - Resource Manager API:
resourcemanager.folders.listandresourcemanager.projects.get.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gcpath-0.2.0.tar.gz.
File metadata
- Download URL: gcpath-0.2.0.tar.gz
- Upload date:
- Size: 53.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1ddec2d77dcbab5b101f3debc927707f188f65ddad0f3adc14e253ed8ad16a8
|
|
| MD5 |
4cc06f3a5be9963a1220939356c5c167
|
|
| BLAKE2b-256 |
35259cbb5b1b1864b655daf36419006391a3c1bb0cf12d653c1d9b05d4655cd4
|
Provenance
The following attestation bundles were made for gcpath-0.2.0.tar.gz:
Publisher:
release.yml on tardigrde/gcpath
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gcpath-0.2.0.tar.gz -
Subject digest:
a1ddec2d77dcbab5b101f3debc927707f188f65ddad0f3adc14e253ed8ad16a8 - Sigstore transparency entry: 774489175
- Sigstore integration time:
-
Permalink:
tardigrde/gcpath@7178489d4351a9d5d7dc201f4624d096f58bb146 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tardigrde
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7178489d4351a9d5d7dc201f4624d096f58bb146 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gcpath-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gcpath-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12cdc4c2daa5100b99ac3581a426ae595aab7867b591b3940cca7d187477910a
|
|
| MD5 |
e01cc5e2311188827a0e21eedf5a3d16
|
|
| BLAKE2b-256 |
be6f6b0beb8953bb92457d4880120cccb13342c10bfe4223b8d9a8a5a66be11e
|
Provenance
The following attestation bundles were made for gcpath-0.2.0-py3-none-any.whl:
Publisher:
release.yml on tardigrde/gcpath
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gcpath-0.2.0-py3-none-any.whl -
Subject digest:
12cdc4c2daa5100b99ac3581a426ae595aab7867b591b3940cca7d187477910a - Sigstore transparency entry: 774489176
- Sigstore integration time:
-
Permalink:
tardigrde/gcpath@7178489d4351a9d5d7dc201f4624d096f58bb146 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tardigrde
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7178489d4351a9d5d7dc201f4624d096f58bb146 -
Trigger Event:
push
-
Statement type: