Metadata-Version: 2.4
Name: gformlib-cli
Version: 0.1.0
Summary: Command-line interface for gformlib – manage Google Forms from the terminal.
Author-email: Andhitia Rama <andhitia.r@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Andhitia Rama
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/andhit-r/gformlib-cli
Project-URL: Documentation, https://gformlib-cli.readthedocs.io
Project-URL: Repository, https://github.com/andhit-r/gformlib-cli
Project-URL: Bug Tracker, https://github.com/andhit-r/gformlib-cli/issues
Project-URL: Changelog, https://github.com/andhit-r/gformlib-cli/blob/master/CHANGELOG.md
Keywords: google,forms,api,cli,survey,automation
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: gformlib>=0.2.0
Requires-Dist: typer[all]>=0.12.0
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: pytest-cov>=4.1; extra == "dev"
Requires-Dist: pytest-mock>=3.11; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: isort>=5.12; extra == "dev"
Requires-Dist: mypy>=1.5; extra == "dev"
Requires-Dist: flake8>=6.1; extra == "dev"
Requires-Dist: tox>=4.11; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7.1; extra == "docs"
Requires-Dist: sphinx-rtd-theme>=1.3; extra == "docs"
Requires-Dist: sphinxcontrib-httpdomain>=1.8; extra == "docs"
Requires-Dist: myst-parser>=2.0; extra == "docs"
Dynamic: license-file

# gformlib-cli

[![PyPI version](https://badge.fury.io/py/gformlib-cli.svg)](https://pypi.org/project/gformlib-cli/)
[![Python versions](https://img.shields.io/pypi/pyversions/gformlib-cli.svg)](https://pypi.org/project/gformlib-cli/)
[![CI](https://github.com/andhit-r/gformlib-cli/actions/workflows/test.yml/badge.svg)](https://github.com/andhit-r/gformlib-cli/actions/workflows/test.yml)
[![Documentation Status](https://readthedocs.org/projects/gformlib-cli/badge/?version=latest)](https://gformlib-cli.readthedocs.io/en/latest/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**gformlib-cli** is the official command-line interface for
[gformlib](https://github.com/andhit-r/gformlib) — manage Google Forms
directly from your terminal.

## Features

- 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)

## Installation

```bash
pip install gformlib-cli
```

## Quickstart

### Authenticate

Pass a service account key file with every command:

```bash
gformcli form create form.json --service-account sa.json
```

Or set the environment variable once:

```bash
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/sa.json
gformcli form create form.json
```

### Create a form

```bash
gformcli form create form.json --service-account sa.json
```

`form.json`:

```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"
    }
  ]
}
```

### Update a form

```bash
gformcli form update <FORM_ID> update.json --service-account sa.json
```

### Get form info

```bash
gformcli form get <FORM_ID> --service-account sa.json
```

### List responses

```bash
gformcli form responses <FORM_ID> --service-account sa.json
```

### Delete a form

```bash
gformcli form delete <FORM_ID> --yes --service-account sa.json
```

## Authentication

| 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 |

## Command reference

```
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.

## Development

```bash
git clone https://github.com/andhit-r/gformlib-cli
cd gformlib-cli
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest
```

## License

MIT — see [LICENSE](LICENSE).
