OpenClaw Tutorials

Comprehensive tutorial series for OpenClaw AI agent gateway

View the Project on GitHub wowsuchbot/openclaw-tutorials

Posting Casts

Learn to post casts, build threads, embed content, and reply to conversations.

Basic Posting

Simple Text Cast

./skills/farcaster-skill/scripts/fc_cast.sh --text "Hello Farcaster!"

Constraints:

Post to a Channel

./skills/farcaster-skill/scripts/fc_cast.sh \
  --text "Exploring onchain generative art" \
  --channel "cryptoart"

Popular channels: base, cryptoart, dev, frames, memes

Embeds

./skills/farcaster-skill/scripts/fc_cast.sh \
  --text "Check out this project" \
  --embed "https://example.com/cool-thing"

The URL automatically generates an OpenGraph preview card.

Image Embed

URLs ending in image extensions auto-display as images:

./skills/farcaster-skill/scripts/fc_cast.sh \
  --text "New artwork" \
  --embed "https://example.com/art.png"

Quote-Casts

A quote-cast embeds another cast with your commentary. Different from a recast (which just re-shares without comment).

When to Quote-Cast

Do quote-cast:

Don’t quote-cast:

How to Quote-Cast

./skills/farcaster-skill/scripts/fc_cast.sh \
  --text "This thread on FIP-8 is worth reading" \
  --embed-cast "0xabc123..." \
  --embed-cast-fid 3

Required parameters:

Quote-Cast Wrapper

For convenience, use the wrapper script:

./skills/farcaster-skill/scripts/quote_cast.sh "Great analysis here" "0xabc123..."

This handles the FID lookup automatically.

Replies

Replies are casts with a --parent reference.

Basic Reply

./skills/farcaster-skill/scripts/fc_cast.sh \
  --text "Great point! I'd add that..." \
  --parent "0xabc123..."

Critical Reply Rules

  1. No username prefix - Just write the reply text
    • WRONG: "@alice: Here's what I think..."
    • CORRECT: "Here's what I think..."
  2. Get context first - Always fetch the conversation before replying
    ./scripts/fc_get_conversation.sh "0xabc123..." --parent-casts
    
  3. One at a time - Process replies sequentially, not in batch

  4. Complete text - Generate full reply before posting (no truncation)

Reply Workflow

# 1. Get conversation context
CONTEXT=$(./scripts/fc_get_conversation.sh "$CAST_HASH" --parent-casts)

# 2. Analyze context, formulate response
# (your agent logic here)

# 3. Post reply
./scripts/fc_cast.sh --text "$REPLY_TEXT" --parent "$CAST_HASH"

Threads

Build multi-cast threads with fc_thread.sh.

Simple Thread

./skills/farcaster-skill/scripts/fc_thread.sh \
  "Good morning! Some thoughts:" \
  --text "First, the market is showing interesting patterns" \
  --text "Second, new art dropped that's worth checking out" \
  --text "Third, a reminder to touch grass today"

Thread in a Channel

./skills/farcaster-skill/scripts/fc_thread.sh \
  --channel cryptoart \
  "A thread on generative art techniques:" \
  --text "Let's talk about noise functions..." \
  --text "And how they create organic patterns..."

Thread with Embeds

./scripts/fc_thread.sh \
  "Artworks I'm watching today:" \
  --listing "@artist — Sunset https://example.com/auction"

Deleting Casts

Remove a cast you’ve posted:

./skills/farcaster-skill/scripts/fc_delete.sh --hash "0xabc123..."

Only works for casts from your signer’s FID.

Style Guidelines

Based on Farcaster culture:

  1. No hashtags - They’re discouraged on Farcaster
  2. Write naturally - Conversational, not marketing-speak
  3. Tease, don’t summarize - Create curiosity
  4. No keyword stuffing - Quality over SEO
  5. Share links after posting - Let others find your cast

Rate Limiting

Scripts include built-in safeguards:

If you see “Safeguard abort”, wait before retrying or vary your content.

Common Mistakes

Mistake Consequence Fix
Username prefix in reply Looks spammy Just write reply text
Batch posting replies Rate limits, looks bot-like One at a time
Truncated text Incomplete thoughts Generate full text first
Wrong script path Command not found Use full workspace path

Example: Agent Posting Workflow

#!/bin/bash
# Example: Agent curates and shares content

SKILL_PATH="./skills/farcaster-skill/scripts"

# 1. Find interesting content
RESULTS=$($SKILL_PATH/fc_search.sh --query "generative art" --limit 5)

# 2. Select best cast to highlight
# (agent analysis here)
CAST_HASH="0x..."
CAST_FID="12345"

# 3. Post quote-cast with commentary
$SKILL_PATH/fc_cast.sh \
  --text "This approach to noise functions is fascinating" \
  --embed-cast "$CAST_HASH" \
  --embed-cast-fid "$CAST_FID" \
  --channel "cryptoart"

Next Steps

Learn to read feeds and search content in 03-reading-feeds.md.