Install and use Soku CLI to give AI agents secure command-line access to marketing data, ad platforms, GA4, PostHog, and growth automation.
triggers
["install soku cli","query google ads data","access ga4 analytics","automate marketing tasks","publish seo content with soku","manage ad campaigns through soku","connect to posthog with soku","use soku for growth stack"]
Soku CLI is a command-line interface that provides secure, typed access to your entire growth stack—Google Ads, Meta Ads, GA4, PostHog, SEO hosting, and more—without exposing API keys in prompts or requiring MCP hosts. Commands are self-documenting and return stable JSON envelopes that AI agents can parse reliably. All delivery-changing writes (like creating campaigns) go through a human review gate.
Key capabilities:
Query normalized reporting across ad platforms (Google, Meta, TikTok, ChatGPT Ads)
Access GA4 and PostHog analytics
Create and manage ad campaigns with human approval
Publish SEO content
Schedule recurring automations
Manage workspace context files
Installation
Prerequisites
Node.js 20 or newer
npm or npx
Global installation
npm install -g @soku-ai/cli
Without global install
npx @soku-ai/cli --help
Verify installation
soku --version
Authentication & Workspace Setup
Sign in with browser-based device flow
soku auth login
This opens a browser for OAuth authentication. The CLI stores credentials securely (using keytar when available, or encrypted file storage as fallback).
Check authentication status
soku auth status
Find and select a workspace
# Search for your brand workspace
soku workspace resolve <brand-name>
# Use the brand workspace
soku workspace use-brand <brand-name>
# Verify active workspace
soku workspace status
# Google Ads
soku ads list-ad-accounts --platform google
# Meta Ads
soku ads list-ad-accounts --platform meta
# All platforms
soku ads list-ad-accounts
soku ads google gaql \
--account-id 123-456-7890 \
--query "SELECT campaign.name, metrics.impressions, metrics.clicks FROM campaign WHERE segments.date DURING LAST_30_DAYS"
Create a Meta campaign (with review)
soku ads meta campaign create \
--account-id act_123456789 \
--name "Q3 Product Launch" \
--objective OUTCOME_TRAFFIC \
--summary "Create paused Meta traffic campaign for Q3 launch"
This returns a review ID instead of executing immediately:
# View the pending change
soku review show rev_abc123
# Approve it
soku review approve rev_abc123
# Or reject it
soku review reject rev_abc123 --reason "Budget needs adjustment"# List all pending reviews
soku review list --status pending
Analytics Integration
Google Analytics 4
# List properties
soku ga4 list-properties
# Get property overview
soku ga4 get-property-overview --property-id 123456789
# List traffic sources
soku ga4 list-traffic-sources \
--property-id 123456789 \
--start-date 2026-06-01 \
--end-date 2026-06-30
# Get conversion events
soku ga4 list-conversion-events --property-id 123456789
PostHog
# List projects
soku posthog list-projects
# Execute SQL query
soku posthog query \
--project-id 12345 \
--tool execute-sql \
--arguments '{"query":"SELECT event, count() as count FROM events WHERE timestamp >= now() - INTERVAL 7 DAY GROUP BY event ORDER BY count DESC LIMIT 10"}'# Get insights
soku posthog query \
--project-id 12345 \
--tool get-insights \
--arguments '{"filters":{"date_from":"-7d"}}'
SEO Hosting
Create and publish a page
# Stage a page
soku seo-hosting pages put \
--section blog \
--slug product-launch-2026 \
--title "Product Launch Notes" \
--html-file ./content/launch.html
# Publish it live
soku seo-hosting pages publish \
--section blog \
--slug product-launch-2026
# List all pages
soku seo-hosting pages list --section blog
# Get page details
soku seo-hosting pages get \
--section blog \
--slug product-launch-2026
Manage domains
# List domains
soku seo-hosting domains list
# Add a domain
soku seo-hosting domains add \
--domain blog.example.com \
--section blog
Automations
Create scheduled tasks
# Weekly performance review
soku automation create \
--name "Weekly ad account health check" \
--prompt "Review all active ad accounts, identify campaigns with declining performance, and flag anomalies for human review" \
--cron "0 9 * * 1" \
--timezone America/Los_Angeles
# Daily budget monitor
soku automation create \
--name "Daily budget utilization" \
--prompt "Check yesterday's spend across all platforms and alert if any account spent >110% or <70% of daily budget" \
--cron "0 8 * * *" \
--timezone America/New_York
Manage automations
# List all automations
soku automation list
# Get automation details
soku automation get --id auto_abc123
# Pause an automation
soku automation pause --id auto_abc123
# Resume an automation
soku automation resume --id auto_abc123
# Delete an automation
soku automation delete --id auto_abc123
Context Hub
Manage files that agents can use as context:
# Upload a file
soku context upload ./campaign-brief.pdf --dir research
# Upload multiple files
soku context upload ./docs/*.md --dir documentation
# List files
soku context list
# List files in specific directory
soku context list --dir research
# Download a file
soku context download campaign-brief.pdf --output ./local-copy.pdf
# Delete a file
soku context delete campaign-brief.pdf --dir research
Agent Skills
Install workflow skills to give agents structured knowledge:
# Install all available skills globally
soku skill install --all --global
# Install specific skill
soku skill install soku-ads-reporting --global
# List installed skills
soku skill list
# Check skill status
soku skill status
# Update skills
soku skill update --all
The meta skill is available at skills/soku/SKILL.md in the installation directory.
JSON Output & Parsing
In non-interactive environments, all commands return structured JSON:
# Sign out and back in
soku auth logout
soku auth login
# Verify status
soku auth status
Problem: Browser doesn't open during login
# The CLI will display a URL to visit manually# Copy the URL from the terminal and open it in your browser
Workspace context issues
Problem:No workspace selected
# Check current workspace
soku workspace status
# List available workspaces
soku workspace list
# Select a workspace
soku workspace use-brand <brand-name>
Command not found
Problem: Typed command doesn't exist yet for new capability
# Use direct capability call instead
soku call <namespace> <action> --help
soku call <namespace> <action> -p key=value
Review workflow issues
Problem: Review ID returned but want to skip review (for testing)
# Reviews are intentional for delivery-changing operations# Always approve/reject properly to maintain audit trail
soku review approve <review_id>
JSON parsing issues
Problem: Malformed JSON output
# Ensure you're in non-interactive mode# Interactive prompts can interfere with JSON output# Set CI environment or redirect stderr
soku ads list-ad-accounts 2>/dev/null
Permission issues
Problem:FORBIDDEN or missing capabilities
# Check workspace permissions
soku workspace status
# Ensure you're using correct workspace
soku workspace use-brand <correct-brand>
# Some capabilities require specific Soku plan features# Contact workspace admin to verify feature availability