@gext/cli
v1.1.0
Published
CLI for Gext by ixigo - Google Docs/Slides template engine. Create templates, generate documents, manage forms, and more.
Downloads
22
Maintainers
Readme
Gext CLI
Command-line interface for Gext -- the Google Docs/Slides template engine.
Built by ixigo
Website | Documentation | AI Agents (MCP)
Installation
npm install -g @gext/cliOr run locally from the project:
npm linkQuick Start
# Sign in with Google
gext login
# Check who you are
gext whoami
# Search your Drive for documents
gext drive search "Invoice Template"
# Create a template from a Google Doc
gext templates create --file 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgVE2upms
# List your templates
gext templates list
# View template schema (variables)
gext templates schema <template-id>
# Generate a document with inline JSON
gext generate <template-id> --json '{"name": "John Doe", "amount": "1500"}'
# Generate interactively
gext generate <template-id> --interactiveCommands
Authentication
# Sign in (opens browser for Google OAuth)
gext login
gext login --full-access # Request full Drive/Docs/Slides permissions
# Show current user
gext whoami
# Sign out
gext logoutTemplates
# List all templates
gext templates list
gext templates list --json
# Get template details
gext templates get <id>
gext templates get <id> --json
# Create from a Google Doc/Slides file
gext templates create --file <google-doc-id>
gext templates create --file <google-doc-id> --name "My Template"
# Show variable schema
gext templates schema <id>
gext templates schema <id> --json
# Generate AI sample data for variables
gext templates sample-data <id>
gext templates sample-data <id> --context "US healthcare"
# Delete a template
gext templates delete <id>Document Generation
# Generate with inline JSON
gext generate <id> --json '{"name": "Alice", "date": "2026-03-05"}'
# Generate from a JSON file
gext generate <id> --file data.json
# Interactive mode (prompts for each variable)
gext generate <id> --interactive
# Pipe JSON from stdin
echo '{"name": "Bob"}' | gext generate <id>
# Use API key instead of session (for automation)
gext generate <id> --json '{"name": "Bot"}' --api-key gext_sk_xxx
# Get structured JSON output
gext generate <id> --json '{"name": "Alice"}' --output-jsonGoogle Drive
# Search for documents and slides
gext drive search "quarterly report"
# Search for folders
gext drive search "invoices" --type folder
# JSON output (pipe to jq)
gext drive search "template" --json | jq '.[].name'Public Forms
# Enable/disable public form for a template
gext form enable <template-id>
gext form disable <template-id>
# Get the public form URL
gext form link <template-id>
# Fetch form schema (no auth required)
gext form get <form-token>
gext form get <form-token> --json
# Submit a form (no auth required)
gext form submit <form-token> --json '{"name": "Jane", "email": "[email protected]"}'
gext form submit <form-token> --file submission.json
cat data.json | gext form submit <form-token>
# JSON output
gext form submit <form-token> --json '{"name": "Jane"}' --output-jsonAPI Keys
# Show the API key for a template
gext api-key show <template-id>
# Regenerate (rotate) the API key
gext api-key regenerate <template-id>Configuration
# List all settings
gext config list
# Point to a different server (e.g., local dev)
gext config set serverUrl http://localhost:5173
# Reset to production
gext config set serverUrl https://gext.ixigo.com
# Get a specific value
gext config get serverUrlRecipes
Batch generate documents from a CSV
# Convert CSV to JSON lines, then generate for each row
cat contacts.csv | python3 -c "
import csv, json, sys
reader = csv.DictReader(sys.stdin)
for row in reader:
print(json.dumps(row))
" | while read -r line; do
gext generate <template-id> --json "$line" --output-json
doneIntegrate with CI/CD
# Use API key auth (no browser login needed)
gext generate <template-id> \
--api-key "$GEXT_API_KEY" \
--json '{"version": "'$VERSION'", "date": "'$(date +%Y-%m-%d)'"}' \
--output-jsonSearch Drive and create template in one go
# Find the doc ID, then create a template
DOC_ID=$(gext drive search "Invoice" --json | jq -r '.[0].id')
gext templates create --file "$DOC_ID" --name "Invoice Template"Generate sample data and use it to generate a document
gext templates sample-data <id> | gext generate <id>Agent/automation workflow
# 1. List templates to find the right one
gext templates list --json | jq '.[] | {id, name}'
# 2. Get schema to know what variables are needed
gext templates schema <id> --json
# 3. Generate document
gext generate <id> --json '{"field1": "value1", "field2": "value2"}' --output-json
# 4. Extract the PDF URL from output
PDF_URL=$(gext generate <id> --json '...' --output-json | jq -r '.pdf_url')Output Formats
Most commands support --json for machine-readable output. This makes it easy to pipe results through jq or use in scripts.
# Pretty-print template list
gext templates list --json | jq '.[] | {id, name, created_at}'
# Get just template IDs
gext templates list --json | jq -r '.[].id'Configuration Storage
Credentials and configuration are stored at:
- macOS:
~/Library/Preferences/gext-nodejs/config.json - Linux:
~/.config/gext-nodejs/config.json - Windows:
%APPDATA%/gext-nodejs/config.json
The session token is a JWT with a 30-day expiry. Run gext login to refresh it.
Related
- Gext Web App -- Create and manage templates in the browser
- Gext MCP Server -- Connect AI agents (Claude, Cursor, Gemini, ChatGPT) via Model Context Protocol
- ixigo -- Built with care by the ixigo team
License
MIT
