gformlib-cli is the official command-line interface for gformlib — manage Google Forms directly from your terminal.
- Create Google Forms from a JSON config file
- Update form title, description, and add questions
- Retrieve form metadata and structure
- List form responses with optional filtering
- Delete forms (with confirmation)
- Service account & OAuth 2.0 authentication
- Beautiful Rich terminal output
- Full type annotations (PEP 561 compliant)
pip install gformlib-cliPass a service account key file with every command:
gformcli form create form.json --service-account sa.jsonOr set the environment variable once:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa.json
gformcli form create form.jsongformcli form create form.json --service-account sa.jsonform.json:
{
"title": "Customer Survey",
"description": "Tell us how we're doing.",
"questions": [
{"title": "Your name", "type": "short_answer", "required": true},
{
"title": "Overall rating",
"type": "scale",
"low": 1,
"high": 5,
"low_label": "Poor",
"high_label": "Excellent"
}
]
}gformcli form update <FORM_ID> update.json --service-account sa.jsongformcli form get <FORM_ID> --service-account sa.jsongformcli form responses <FORM_ID> --service-account sa.jsongformcli form delete <FORM_ID> --yes --service-account sa.json| Method | Flag | Notes |
|---|---|---|
| Service Account | --service-account / -s |
Recommended for server/CI |
| OAuth 2.0 | --credentials / -c |
Browser consent on first run |
| Env var | GOOGLE_APPLICATION_CREDENTIALS |
Fallback, service account |
gformcli form create CONFIG_FILE [AUTH OPTIONS]
gformcli form update FORM_ID CONFIG_FILE [AUTH OPTIONS]
gformcli form get FORM_ID [AUTH OPTIONS]
gformcli form responses FORM_ID [--filter STR] [--page-size N] [AUTH OPTIONS]
gformcli form delete FORM_ID [--yes] [AUTH OPTIONS]
Run gformcli --help or gformcli form <command> --help for full option details.
git clone https://github.com/andhit-r/gformlib-cli
cd gformlib-cli
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytestMIT — see LICENSE.