CLI for Google Drive
Project description
google-drive-cli-for-agents
CLI for Google Drive using the official Google API Python client.
Features
- OAuth login without mandatory
gcloud pipx-friendly install (gdriveavailable globally)- List folder contents via folder ID or folder link
- Upload local files to a folder via folder ID or folder link
- Download files via file ID or file link
- Move files to trash via file ID or file link
- Diagnostics with
gdrive doctor
Install (Recommended)
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install google-drive-cli-for-agents
Verify:
gdrive --version
Upgrade:
pipx upgrade google-drive-cli-for-agents
Install From Source
Local development:
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
Install via pipx from local clone:
pipx install -e /absolute/path/to/google-drive-cli
OAuth Setup
Create a Google OAuth client of type Desktop app, then run:
gdrive auth login --client-secret /absolute/path/to/client_secret.json
Readonly token:
gdrive auth login --readonly --client-secret /absolute/path/to/client_secret.json
Inspect local credentials:
gdrive auth whoami
gdrive doctor
Usage
List a folder (or root if omitted):
gdrive ls --folder https://drive.google.com/drive/folders/<folder-id>
gdrive ls --folder <folder-id>
gdrive ls
Upload a file:
gdrive upload ./report.csv --folder <folder-id>
gdrive upload ./report.csv --folder https://drive.google.com/drive/folders/<folder-id>
Download a file:
gdrive download --file <file-id>
gdrive download --file https://drive.google.com/file/d/<file-id>/view --output-path ./report.csv
Move a file to trash:
gdrive trash --file <file-id>
gdrive trash --file https://drive.google.com/file/d/<file-id>/view
Output Formats
gdrive ls supports:
--output table(default)--output json--output csv --csv-path ./files.csv
gdrive upload supports:
--output table(default)--output json
Credentials Path
By default credentials are stored at:
~/.config/gdrive-cli/credentials.json
Override with env vars:
GDRIVE_CONFIG_DIRGDRIVE_CREDENTIALS_FILE
ADC Fallback (Optional)
If preferred, ADC via gcloud still works:
gcloud auth application-default login \
--client-id-file=/absolute/path/to/client_secret.json \
--scopes=https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/drive
Publishing
Build artifacts:
python -m build
Upload manually:
python -m twine upload dist/*
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 google_drive_cli_for_agents-0.1.1.tar.gz.
File metadata
- Download URL: google_drive_cli_for_agents-0.1.1.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
824b230844c003fbed5681b15d365cd62740289be135c5473bff8185afb2a276
|
|
| MD5 |
81681a6ab5cf064b08bfa12e1656c316
|
|
| BLAKE2b-256 |
856507c03561d74948ccf7fbce443ed0e063913425fe5a286e4ca951788f8e5d
|
Provenance
The following attestation bundles were made for google_drive_cli_for_agents-0.1.1.tar.gz:
Publisher:
publish.yml on NmadeleiDev/google-drive-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
google_drive_cli_for_agents-0.1.1.tar.gz -
Subject digest:
824b230844c003fbed5681b15d365cd62740289be135c5473bff8185afb2a276 - Sigstore transparency entry: 973284221
- Sigstore integration time:
-
Permalink:
NmadeleiDev/google-drive-cli@854f9cfcfcd5f5fc696443e02ea3802e946d376c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/NmadeleiDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@854f9cfcfcd5f5fc696443e02ea3802e946d376c -
Trigger Event:
push
-
Statement type:
File details
Details for the file google_drive_cli_for_agents-0.1.1-py3-none-any.whl.
File metadata
- Download URL: google_drive_cli_for_agents-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.1 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 |
815b07cc70c57871f0744c68c295454ceff7d317e9319ba4e432f58cc7566b0a
|
|
| MD5 |
07080795d1c200796bcc16d9dfccd0c2
|
|
| BLAKE2b-256 |
ab95489ee38578eae9d9a5eae48874051d0e060d26e8912734dedcaa7d0f2a9d
|
Provenance
The following attestation bundles were made for google_drive_cli_for_agents-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on NmadeleiDev/google-drive-cli
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
google_drive_cli_for_agents-0.1.1-py3-none-any.whl -
Subject digest:
815b07cc70c57871f0744c68c295454ceff7d317e9319ba4e432f58cc7566b0a - Sigstore transparency entry: 973284230
- Sigstore integration time:
-
Permalink:
NmadeleiDev/google-drive-cli@854f9cfcfcd5f5fc696443e02ea3802e946d376c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/NmadeleiDev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@854f9cfcfcd5f5fc696443e02ea3802e946d376c -
Trigger Event:
push
-
Statement type: