Cargo CLI — Segmentation for Openclaw

Cargo CLI Segmentation lets you define, save, inspect, export, and monitor named audiences over Cargo models.

cargo-ai
v1.0.1
Sep 14, 2026
0
266
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install cargo-segmentation

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install cargo-segmentation using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Cargo CLI — Segmentation?

Cargo CLI Segmentation is an Openclaw Skills capability for creating named, reusable audiences from saved filters over a single Cargo model. These segments provide the audience layer for downstream batch runs, play triggers, exports, change feeds, monitoring, and go-to-market workflows.

The skill supports both quick, inline filter checks and durable segment objects with names, slugs, model references, record counts, selected columns, tracking columns, and membership history. It also provides delta feeds that identify added, updated, removed, and unchanged records, making Openclaw Skills useful for turning static data filters into actionable audience signals.

Cargo CLI — Segmentation Use Cases

  • Build a segment of companies, contacts, accounts, or other records matching specific criteria.
  • Preview and count matching records before saving an audience or starting a paid batch operation.
  • Save reusable filters for recurring workflows, play triggers, exports, and monitoring.
  • Identify records newly added to, removed from, or updated within a segment.
  • Track changes to important fields such as employee count or funding stage.
  • Fetch a small sample of records for validation without loading a large audience into the conversation.
  • Download a complete filtered dataset for handoff to analytics or another tool.
  • Re-read specific records identified by a segment change feed.
  • Support GTM motions such as job-change, funding, technology-intent, or account-targeting audiences.
  • Keep segment definitions discoverable through the Cargo CLI and, when needed, declare them as code in a project repository.

How Cargo CLI — Segmentation Works

  1. Authenticate with the Cargo CLI and confirm the active workspace using cargo-ai whoami.
  2. Discover existing segments, available models, and valid column slugs before creating or duplicating an audience.
  3. Build a filter JSON object using conjonction, nested groups, conditions, column slugs, operators, values, and supported condition kinds.
  4. Preview the filter with segment fetch and a small limit to validate the criteria and estimate the audience shape.
  5. Save a durable segment with segment create, assigning a name, model UUID, filter, output columns, and optional tracking columns.
  6. Inspect the saved segment with segment get and use its authoritative recordsCount before proposing downstream actions.
  7. Fetch a small page of matching records, download the full filtered dataset, or retrieve individual records by ID as needed.
  8. When the segment syncs, Cargo calculates a change delta containing added, updated, removed, and unchanged membership counts.
  9. Query the change feed with change list and change fetch to identify records entering or leaving the audience.
  10. Pass the saved segment to orchestration, plays, analytics, observability, GTM workflows, or project-as-code integrations. Use the appropriate Openclaw Skills capability for each downstream operation.

Cargo CLI — Segmentation Setup

Install the Cargo CLI, authenticate, and verify the workspace before making changes:

npm install -g @cargo-ai/cli
cargo-ai login --email [email protected]
cargo-ai whoami

For browser-based authentication, use cargo-ai login --oauth. For CI environments, authenticate with an API token:

cargo-ai login --token <api-token>

Discover the resources required to construct a valid segment:

cargo-ai segmentation segment list
cargo-ai storage model list
cargo-ai storage column list --model-uuid <model-uuid>

Create a segment with a valid filter. The key must be spelled conjonction, not conjunction:

cargo-ai segmentation segment create \
  --name "Mid-market accounts" \
  --model-uuid <model-uuid> \
  --filter '<filter-json>' \
  --column-slugs "name,domain,employee_count" \
  --tracking-column-slugs "employee_count,funding_stage"

Useful lifecycle commands include:

cargo-ai segmentation segment get <segment-uuid>
cargo-ai segmentation segment update --uuid <segment-uuid> --filter '<filter-json>'
cargo-ai segmentation segment fetch --model-uuid <model-uuid> --filter '<filter-json>' --limit 3
cargo-ai segmentation segment download --model-uuid <model-uuid> --filter '<filter-json>'
cargo-ai segmentation change list --segment-uuid <segment-uuid>
cargo-ai segmentation change fetch --uuid <change-uuid> --kinds added --limit 50

Commands emit JSON to stdout and return a non-zero exit code with an errorMessage object on failure. Asynchronous batch or run operations belong to the orchestration workflow; use --wait-until-finished or poll the relevant resource when applicable. Do not manually edit or remove segments marked fromPlay: true, because those are owned by their associated play.

Cargo CLI — Segmentation Data Schema & Taxonomy

Core segment entities

Entity Key fields Purpose
Filter conjonction, groups, conditions Ephemeral JSON criteria evaluated against one model.
Segment uuid, name, slug, modelUuid, recordsCount Saved, reusable audience definition.
Change uuid, createdAt, totalRecordsCount, membership counts Snapshot of how segment membership changed between syncs.
Record Model columns plus _kind, _id, _title, _time in change responses Individual model data returned by fetch and change operations.

Filter taxonomy

  • conjonction: Logical combination key at the root and group levels; supported values include and.
  • groups[].conditions[]: Individual criteria evaluated against model columns.
  • kind: Condition data type, including string, number, date, boolean, array, and relation.
  • columnSlug: The exact column identifier discovered through cargo-ai storage column list.
  • operator and value: Comparison behavior and the value used for matching.

Segment metadata and outputs

  • modelUuid binds each segment to exactly one Cargo model.
  • column-slugs controls the model columns returned with segment records.
  • tracking-column-slugs determines which value changes count as updated records.
  • recordsCount is the authoritative current audience size.
  • lastChange may be embedded in segment list and get responses.
  • Change kinds are added, updated, removed, and unchanged.
  • Play-generated segments use the name GENERATED_PLAY_SEGMENT and metadata such as fromPlay: true.
  • segment fetch returns paginated inline JSON; segment download returns a signed URL for the full dataset.

A match-everything filter is {"conjonction":"and","groups":[]}. Always validate the spelling of conjonction, because using conjunction can silently produce an empty result.

Cargo CLI — Segmentation Advanced Features

  • Delta-based audience monitoring through segment change records.
  • Tracking columns that distinguish updated records from simple additions and removals.
  • Inline segment previews with optional --sync refreshes and --enrich joined or derived values.
  • Separate lightweight fetch, full download, and targeted record-fetch workflows.
  • Reusable saved segments for batch enrollment, play triggers, exports, observability, and GTM automations.
  • Workspace and model discovery commands that reduce duplicate segments and invalid column references.
  • Machine-readable JSON output suitable for automation, CI pipelines, and other Openclaw Skills integrations.
  • Explicit handling of generated play segments to protect play-owned automation state.
  • Git-oriented segment definitions through the Cargo project defineSegment workflow.
  • Operational troubleshooting through workspaceManagement report create, including command history, verbatim errors, UUIDs, and expected-versus-actual behavior.
  • Guardrails for large audiences: preview a small sample, verify recordsCount, and avoid paging entire datasets into the agent conversation.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*