Operate HubSpot Like Code
Snapshot your portal, plan changes in YAML, apply with guardrails, and get before/after receipts. Automate HubSpot admin tasks with a deterministic CLI and built-in audit trail.
g-gremlin is the CLI. Claude Code is the planner. Together they automate the admin loop.
$ g-gremlin hubspot doctor
✓ Token valid · Portal: acme-corp · 12 scopes OK
$ g-gremlin hubspot snapshot --out snapshots/baseline
✓ Captured: 47 properties · 3 pipelines · 12 lists · 2 custom objects
$ g-gremlin hubspot pack plan ./packs/q1_cleanup
⟳ Plan: +4 properties · ~2 pipeline stages · +1 validation rule
$ g-gremlin hubspot pack apply ./packs/q1_cleanup --yes
✓ Applied. Snapshots: artifacts/20260127_143022/before · after
$ g-gremlin hubspot compare-snapshots snapshots/baseline artifacts/20260127_143022/after_snapshot
✓ Receipt: 4 added · 2 changed · 0 removed
What You Can Manage
Full HubSpot infrastructure management from the command line. Every capability uses the same plan → apply → receipt pattern.
Config-as-Code
Properties, custom objects, validation rules, lists, and association labels — all defined in YAML. Plan drift, then apply. Archive with safeguards.
Pipelines & Stages
Manage deal, ticket, and lead pipelines. Add, update, or remove stages with diffable plans. Deletions require explicit opt-in.
Data Operations
Bulk pull, upsert, associate, and dissociate records via CSV. Native imports and async exports. Engagement history. Batch pacing with auto-downshift.
Merge & Dedup
Find duplicates by any field across your entire portal. Generate merge plans with dry-run preview. Apply with plan-hash verification.
Audit & Drift
Snapshot your full portal config. Compare two snapshots to see exactly what changed. Detect drift across all components. Pull property change history.
Orchestration
Bundle config into packs — properties + pipelines + lists + validations in one change set with before/after receipts. Workflows supported in beta.
The Admin Automation Loop
Five commands. Full audit trail. Every change has a receipt.
# Validate $ g-gremlin hubspot doctor
# Baseline $ g-gremlin hubspot snapshot --out snapshots/baseline
# Plan $ g-gremlin hubspot pack plan <pack_dir>
# Apply $ g-gremlin hubspot pack apply <pack_dir> --yes
# Receipts $ g-gremlin hubspot compare-snapshots snapshots/baseline <after_snapshot_dir>
Safety by Default
Every mutating command is dry-run. You must opt in to changes.
Guardrails
- Dry-run by default —
--yesrequired for mutations - Incompatible changes blocked (property type changes, immutable fields)
- Destructive actions require explicit flags (
--allow-delete,--allow-archive) pack doctorvalidates scopes before any command runs
Audit Trail
- Automatic before/after snapshots on every
pack apply - Deterministic JSON plans — diffable, reviewable, git-trackable
- Batch outcomes: succeeded / failed / retryable tracked separately
- Idempotent: run twice, second run detects no drift
AI Planner + CLI Executor
Claude Code is the brain. g-gremlin is the hands. Describe what you want in English — get a reviewable plan with real commands.
Claude Code
Understands your intent. Writes YAML specs. Generates pack plans.
g-gremlin
Executes against HubSpot API. Captures snapshots. Produces receipts.
You
Review the plan. Say --yes. Check the receipt. Move on.
Common Questions
Is it safe to run g-gremlin against a production HubSpot portal?
Yes. Every mutating command is dry-run by default — nothing changes until you pass --yes. Incompatible changes (like property type changes) are blocked, not silently skipped. pack apply auto-captures before/after snapshots.
Do I need to be a developer to use this?
No. If you can run pipx install and edit a YAML file, you can use g-gremlin. Claude Code acts as the planner — describe what you want in English, get a ready-to-review plan. The CLI executes it.
What about HubSpot workflows?
Workflow support (HubSpot Automation v4) is available as a beta feature with revision guards. Set G_GREMLIN_HUBSPOT_AUTOMATION_BETA=1 to enable. Covers list, pull, diff, create, update, and delete. Full GA is on the roadmap.
Can I use g-gremlin across multiple HubSpot portals?
Yes. Named profiles store portal ID, domain, and token per portal. Use `hubspot auth list` to see all portals, `hubspot auth use <profile>` to switch. Packs are portable — apply the same YAML to any portal.
How does g-gremlin handle HubSpot API rate limits?
Built-in pacing with "safe" (default) and "turbo" profiles. Automatic backoff on 429 errors with exponential retry. Batch sizes stay within HubSpot limits (100 for upserts, 500 for associations).
The 5-command loop — the signature g-gremlin workflow:
g-gremlin hubspot doctor
g-gremlin hubspot snapshot --out snapshots/baseline
g-gremlin hubspot pack plan <pack_dir>
g-gremlin hubspot pack apply <pack_dir> --yes
g-gremlin hubspot compare-snapshots snapshots/baseline <after_snapshot_dir>
Ready to Operate HubSpot Like Code?
30 days free. No credit card required. Start with a read-only snapshot — zero risk.