marketo-cli

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2026 License: MIT

README

marketo-cli

marketo-cli is a Marketo CLI and Marketo REST API CLI for humans and agents. The installed command is mrkto.

This GitHub repository is the canonical home of marketo-cli: source code, installation, releases, and issue tracking all live here.

If you searched for marketo-cli, this repo is the project. Search term: marketo-cli. Installed command: mrkto.

The current implementation is Go and ships native release archives for macOS and Linux.

The older Python package distribution has been retired. GitHub Releases and source builds from this repository are the supported install paths now.

The CLI uses explicit resource names, structured JSON output, dry-run defaults for writes, and a raw api escape hatch for unsupported endpoints.

marketo-cli And mrkto

The project name is marketo-cli.

The command you run after installing it is mrkto.

That split is intentional:

  • search for marketo-cli when you want the project, docs, repo, or releases
  • run mrkto when you want to use the installed CLI on your machine

What It Is For

marketo-cli is a command-line wrapper around common Marketo REST API workflows. You run it as mrkto.

It is built for:

  • looking up leads, activities, companies, programs, and campaigns quickly
  • making a few safe operational changes like adding leads to a static list or triggering a smart campaign
  • scripting Marketo tasks in shells, automations, and AI agents
  • falling back to raw API calls when a higher-level command does not exist yet

If you already know the Marketo API but want a cleaner daily interface, marketo-cli is the abstraction layer. If you are using agents, the CLI keeps the contract stable with structured JSON output and predictable exit behavior.

Installation

Primary install path for macOS and Linux:

The supported install and upgrade instructions are maintained in this repository.

curl -fsSL https://raw.githubusercontent.com/itodca/marketo-cli/main/install.sh | bash

The installer:

  • downloads the matching native release archive from GitHub Releases
  • installs mrkto into ~/.local/bin by default
  • adds that directory to your shell PATH if needed

Useful options:

# Install a specific release tag
curl -fsSL https://raw.githubusercontent.com/itodca/marketo-cli/main/install.sh | bash -s -- --version vX.Y.Z

# Install somewhere else and leave PATH alone
curl -fsSL https://raw.githubusercontent.com/itodca/marketo-cli/main/install.sh | bash -s -- --install-dir "$HOME/bin" --no-modify-path

# Uninstall the installed command and remove the legacy app bundle if present
curl -fsSL https://raw.githubusercontent.com/itodca/marketo-cli/main/install.sh | bash -s -- --uninstall

Other install options:

  • download the release artifact directly from GitHub Releases
  • build from source with go build ./cmd/mrkto

Upgrade And Uninstall

To upgrade, rerun the installer:

curl -fsSL https://raw.githubusercontent.com/itodca/marketo-cli/main/install.sh | bash

Or use the CLI wrapper around the same installer:

mrkto update
mrkto update --execute
mrkto update --version vX.Y.Z
mrkto update --version vX.Y.Z --execute

If you want a clean transition from an older Python/PyInstaller install, uninstall first:

curl -fsSL https://raw.githubusercontent.com/itodca/marketo-cli/main/install.sh | bash -s -- --uninstall
curl -fsSL https://raw.githubusercontent.com/itodca/marketo-cli/main/install.sh | bash

The uninstall path removes the installed mrkto binary and also removes the old legacy bundle at ~/.local/share/mrkto if it still exists.

Quick Start

# First-time setup
mrkto setup

# Or configure a profile explicitly
mrkto auth setup --profile production

# Check auth
mrkto auth check

# Look up a lead
mrkto lead list --email user@example.com

# Browse smart campaigns
mrkto smart-campaign list --active --limit 10

# Dry-run a campaign trigger
mrkto smart-campaign trigger 1234 --lead 1001 --lead 1002

# Raw API request
mrkto api get /v1/leads.json --query filterType=email --query filterValues=user@example.com

For mrkto api post, marketo-cli follows Marketo's API families:

  • /v1/... requests keep JSON request bodies
  • /asset/... requests send --body fields as application/x-www-form-urlencoded

Verified Marketo implementation notes and API gotchas are bundled with the skill in skills/mrkto/references/api-notes.md.

When npx is available, the interactive mrkto setup flow can also offer to install the mrkto agent skill as an optional final step.

Profiles

A profile is a saved Marketo connection.

Most users only need the default profile.

Use additional profiles when:

  • the same company has multiple Marketo instances
  • a production and sandbox instance
  • different clients or business units
  • project folders that should automatically use different credentials

Examples:

  • default for your main Marketo instance
  • sandbox for testing
  • marketing-prod and marketing-sandbox for separate environments
  • na and emea if one company operates multiple instances
  • acme and globex if you work across clients

Think of the profile name as a label you choose for the Marketo connection you want to use.

Credentials are stored in ~/.config/mrkto/:

  • Default profile: ~/.config/mrkto/config
  • Named profiles: ~/.config/mrkto/profiles/<name>

Create them with:

mrkto auth setup
mrkto auth setup --profile sandbox
mrkto auth setup --profile acme

Use them with:

mrkto lead list --email user@example.com --profile sandbox
MRKTO_PROFILE=acme mrkto stats usage

If you keep a .mrkto-profile file in a project directory, mrkto will automatically use that profile when you run commands from that directory tree.

Example:

echo "sandbox" > .mrkto-profile
mrkto auth check

Profile resolution order:

  1. --profile
  2. MRKTO_PROFILE
  3. .mrkto-profile in the current directory tree
  4. default

In practice, this lets one project folder point at one Marketo instance while another folder points at a different instance, without changing environment variables every time.

Environment variables override file-based config:

Variable Required Description
MARKETO_MUNCHKIN_ID Yes Marketo munchkin id
MARKETO_CLIENT_ID Yes LaunchPoint client id
MARKETO_CLIENT_SECRET Yes LaunchPoint client secret
MARKETO_REST_URL No Override REST endpoint
MARKETO_IDENTITY_URL No Override identity endpoint

Command Shape

The CLI uses singular top-level resource nouns and explicit Marketo concepts:

  • lead, activity, company, email, folder, program
  • smart-campaign, static-list, smart-list
  • auth, stats, api

The pattern is:

mrkto <resource> <action> [flags]

Examples:

mrkto lead get 12345
mrkto lead list --email user@example.com
mrkto static-list add 456 --lead 1001 --lead 1002 --execute
mrkto api get /v1/leads.json --query filterType=email --query filterValues=user@example.com

The CLI uses explicit resource nouns instead of mirroring Marketo API casing, so you get shell-friendly names like smart-campaign instead of smartCampaign.

Full command shape:

mrkto auth setup
mrkto auth list
mrkto auth check

mrkto lead get
mrkto lead list
mrkto lead describe
mrkto lead static-lists
mrkto lead programs
mrkto lead smart-campaigns

mrkto activity list
mrkto activity types
mrkto activity changes

mrkto email create
mrkto email list
mrkto email get
mrkto email update
mrkto email approve
mrkto email discard-draft
mrkto email content get

mrkto folder create

mrkto smart-campaign list
mrkto smart-campaign get
mrkto smart-campaign schedule
mrkto smart-campaign trigger

mrkto static-list list
mrkto static-list get
mrkto static-list members
mrkto static-list add
mrkto static-list remove
mrkto static-list check

mrkto smart-list list
mrkto smart-list get

mrkto company list
mrkto company describe

mrkto program list
mrkto program get

mrkto stats usage
mrkto stats errors

mrkto update
mrkto api get
mrkto api post
mrkto api delete

Output

The default output is pretty JSON.

Other output modes:

  • --compact for one JSON object per line
  • --raw for single-line JSON of the full returned payload
  • --fields to limit displayed fields on structured results

The CLI writes result data to stdout and errors to stderr, which means file output works naturally with shell redirection.

Examples:

mrkto lead list --email user@example.com > lead.json
mrkto activity list 12345 --compact > activities.ndjson
mrkto lead list --email user@example.com --raw | jq .

There is no special file-output flag because normal shell redirection already gives you predictable machine output.

Write Safety

Commands that modify data default to dry-run mode and require --execute to actually make changes:

  • mrkto email create
  • mrkto email update
  • mrkto email approve
  • mrkto email discard-draft
  • mrkto folder create
  • mrkto smart-campaign schedule
  • mrkto smart-campaign trigger
  • mrkto static-list add
  • mrkto static-list remove
  • mrkto update

Agent Skill

The repo still ships with a skills-based installer for supported coding agents:

mrkto skill install
mrkto skill install --global
mrkto skill uninstall

More Docs

Release Automation

  • CI runs tests, compile checks, and package builds on pushes and pull requests
  • GitHub Releases build macOS and Linux binaries on v* tags

Source Contracts

The CLI is implemented against Adobe's published Marketo OpenAPI specs:

Binary Releases

Build a release artifact locally with Go:

go test ./...
./scripts/build-binary.sh

This creates assets under dist/releases/ using the installer's expected naming scheme. Each archive contains the native mrkto binary:

  • mrkto-darwin-arm64.tar.gz
  • mrkto-darwin-x64.tar.gz
  • mrkto-linux-arm64.tar.gz
  • mrkto-linux-x64.tar.gz

Checksums are written to checksums.txt.

License

MIT

Directories

Path Synopsis
cmd
mrkto command
internal
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL