A Python CLI tool that bridges Playwright-based Google authentication with the gemini-webapi library
Project description
GemiTerm
A Python CLI tool that bridges Playwright-based Google authentication with the gemini-webapi library.
Installation
Windows (standalone - no Python required)
Open PowerShell and run:
irm https://raw.githubusercontent.com/expert-vision-software/GemiTerm/main/install.ps1 | iex
This downloads the latest GemiTerm.exe, installs Chromium browser, and adds GemiTerm to your PATH.
Uninstall:
irm https://raw.githubusercontent.com/expert-vision-software/GemiTerm/main/install.ps1 | iex -- -uninstall
Linux
Download the GemiTerm binary from the latest release.
chmod +x GemiTerm
./GemiTerm install-browser # install Chromium if needed
pip/pipx (requires Python)
pip install gemiterm # global install
pipx install gemiterm # global install (isolated)
pipx run gemiterm auth # temporary run (npx equivalent)
From Source
pip install -e .
playwright install chromium
Prerequisites
- Chromium Browser: GemiTerm will attempt to use your system Chrome if available, otherwise it installs Playwright's Chromium automatically.
- Google Account: A Google account with access to Gemini (https://gemini.google.com)
Usage
Authentication
Before using the CLI, you need to authenticate with your Google account:
gemiterm auth
This will open a browser window for you to log in with your Google account. Cookies will be saved for future use.
Check Status
Verify your authentication status:
gemiterm status
List Chats
Display all your Gemini chats in a table:
gemiterm list
Options:
-n, --limit N: Maximum number of chats to display (default: 10, max: 50)
Fetch Chat History
Fetch and display the message history of a specific conversation:
gemiterm fetch <conversation_id>
Options:
--format, -f: Output format -text(default) orjson
Continue a Chat
Send a message to an existing conversation:
gemiterm continue <conversation_id> <message>
Export Chat
Export a conversation to a Markdown file:
gemiterm export <conversation_id>
Options:
-o, --output PATH: Custom output file path-f, --format FORMAT: Export format -markdown(default) orjson--include-metadata: Include full metadata in export
Export All Chats
Export all conversations to a directory with an index file:
gemiterm export-all
Options:
-o, --output-dir PATH: Directory to export to (default:./exports)--since ISO_DATE: Export only conversations newer than this date--include-metadata: Include full metadata in each export
Verbose Logging
Enable detailed logging for debugging:
gemiterm -v <command>
Configuration
Configuration Directory
Default location: ~/.config/gemiterm/
Override with environment variable:
export GEMITERM_CONFIG_DIR=/custom/path
Storage File
The storage file (storage_state.json) contains your authentication cookies. It is located in the configuration directory.
Environment Variables
| Variable | Description | Default |
|---|---|---|
GEMITERM_CONFIG_DIR |
Configuration directory | ~/.config/gemiterm/ |
GEMITERM_VERBOSE |
Enable verbose logging | false |
Troubleshooting
Browser Automation Issues
If browser automation fails or is unavailable, you can manually extract cookies from your browser:
- Install the "EditThisCookie" extension or similar in your browser
- Go to https://gemini.google.com and log in
- Export the cookies in JSON format
- Save them to
~/.config/gemiterm/storage_state.jsonwith the following format:{ "cookies": [ {"name": "__Secure-1PSID", "value": "your_value_here", ...}, {"name": "__Secure-1PSIDTS", "value": "your_value_here", ...} ] }
Session Expired
If you see "Session expired" errors:
- Run
gemiterm authto re-authenticate - If the issue persists, delete
storage_state.jsonand rungemiterm authagain
API Errors
If you encounter API errors:
- Run
gemiterm statusto check your authentication state - Ensure you have a valid Google account with Gemini access
- Try re-authenticating with
gemiterm auth
Verbose Logging
Use the -v or --verbose flag to enable detailed logging for debugging:
gemiterm -v list
Future Enhancements
- Interactive CLI mode with menu-driven navigation
- REPL mode for conversational interaction
- Support for conversation creation and deletion
- Export to multiple formats (HTML, PDF)
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 gemiterm-1.1.1.tar.gz.
File metadata
- Download URL: gemiterm-1.1.1.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77cbc7fa77450f3e7e0b2f83f8777b96a43d5b37f203852119753ce1578bfba5
|
|
| MD5 |
4cc4c333976077fccb6401096ca6a613
|
|
| BLAKE2b-256 |
4bb9326ee50c0fd25d0fd1f4529e334f585dbaa577aa0e93b9ffdee4ab6c083b
|
Provenance
The following attestation bundles were made for gemiterm-1.1.1.tar.gz:
Publisher:
release.yml on Expert-Vision-Software/gemiterm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gemiterm-1.1.1.tar.gz -
Subject digest:
77cbc7fa77450f3e7e0b2f83f8777b96a43d5b37f203852119753ce1578bfba5 - Sigstore transparency entry: 1338964219
- Sigstore integration time:
-
Permalink:
Expert-Vision-Software/gemiterm@cc20a41538d2832eb60d8cdb02257b3196f85073 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Expert-Vision-Software
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc20a41538d2832eb60d8cdb02257b3196f85073 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file gemiterm-1.1.1-py3-none-any.whl.
File metadata
- Download URL: gemiterm-1.1.1-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef071db19614c79e60579b9e76cf20d6722f6de7e140586c133a0a2e471eefe8
|
|
| MD5 |
0c666c1d7d88e40211555f5a221574a5
|
|
| BLAKE2b-256 |
f08e06fa23857ae44517c2cd3f00022b0973bd3605f696db7befba45e6b8675a
|
Provenance
The following attestation bundles were made for gemiterm-1.1.1-py3-none-any.whl:
Publisher:
release.yml on Expert-Vision-Software/gemiterm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gemiterm-1.1.1-py3-none-any.whl -
Subject digest:
ef071db19614c79e60579b9e76cf20d6722f6de7e140586c133a0a2e471eefe8 - Sigstore transparency entry: 1338964220
- Sigstore integration time:
-
Permalink:
Expert-Vision-Software/gemiterm@cc20a41538d2832eb60d8cdb02257b3196f85073 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Expert-Vision-Software
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@cc20a41538d2832eb60d8cdb02257b3196f85073 -
Trigger Event:
workflow_dispatch
-
Statement type: