Skip to main content
Airstore tools follow the Unix philosophy: they read from stdin, write to stdout, and can be piped together.

Basic piping

Read a file and pass it to a tool:
cat ~/airstore/sources/gmail/support/001-bug-report.eml | \
  ~/airstore/tools/linear create-issue --project="Support"
The tool reads the email content and creates a Linear issue with it.

Chaining tools

Pipe the output of one tool into another:
# Get PR details, then post to Slack
~/airstore/tools/github get-pr --repo=acme/api --number=147 | \
  ~/airstore/tools/slack post --channel="#releases" --stdin

Processing multiple files

Use standard Unix tools to process batches:
# Create issues from all support emails
for email in ~/airstore/sources/gmail/support/*.eml; do
  cat "$email" | ~/airstore/tools/linear create-issue --project="Support"
done
Or with xargs:
ls ~/airstore/sources/gmail/support/*.eml | \
  xargs -I {} sh -c 'cat {} | ~/airstore/tools/linear create-issue'

Filtering with jq

Parse JSON output and filter:
# Get open issues and post count to Slack
COUNT=$(~/airstore/tools/github list-issues --repo=acme/api --state=open | jq length)
~/airstore/tools/slack post --channel="#engineering" --message="Open issues: $COUNT"

Real-world examples

Support ticket pipeline

Turn support emails into Linear issues and notify Slack:
for email in ~/airstore/sources/gmail/support/*.eml; do
  # Create Linear issue
  ISSUE=$(cat "$email" | ~/airstore/tools/linear create-issue --project="Support")
  
  # Extract issue URL
  URL=$(echo "$ISSUE" | jq -r '.url')
  
  # Notify Slack
  ~/airstore/tools/slack post \
    --channel="#support" \
    --message="New ticket created: $URL"
done

PR merge notification

When a PR is merged, notify the team:
# Merge the PR
~/airstore/tools/github merge-pr --repo=acme/api --number=147

# Get PR details
PR=$(~/airstore/tools/github get-pr --repo=acme/api --number=147)
TITLE=$(echo "$PR" | jq -r '.title')
AUTHOR=$(echo "$PR" | jq -r '.user.login')

# Post to Slack
~/airstore/tools/slack post \
  --channel="#releases" \
  --message="πŸš€ Merged: $TITLE by @$AUTHOR"

Daily digest

Aggregate data from multiple sources:
#!/bin/bash

# Gather metrics
OPEN_PRS=$(~/airstore/tools/github list-prs --repo=acme/api --state=open | jq length)
OPEN_ISSUES=$(~/airstore/tools/linear list-issues --status="Todo" | jq length)
IN_PROGRESS=$(~/airstore/tools/linear list-issues --status="In Progress" | jq length)

# Format message
MESSAGE="πŸ“Š Daily Digest
- Open PRs: $OPEN_PRS
- Todo: $OPEN_ISSUES
- In Progress: $IN_PROGRESS"

# Post to Slack
~/airstore/tools/slack post --channel="#engineering" --message="$MESSAGE"

stdin flag

Some tools accept --stdin to read input:
echo "Deploy complete!" | ~/airstore/tools/slack post --channel="#releases" --stdin
Others automatically detect stdin:
cat email.eml | ~/airstore/tools/linear create-issue
Check --help for each tool’s stdin behavior.

Error handling in pipelines

Use set -e to stop on errors:
#!/bin/bash
set -e

# Pipeline stops if any command fails
~/airstore/tools/github merge-pr --repo=acme/api --number=147
~/airstore/tools/slack post --channel="#releases" --message="Merged!"
Or handle errors explicitly:
if ! ~/airstore/tools/github merge-pr --repo=acme/api --number=147; then
  ~/airstore/tools/slack post --channel="#releases" --message="Merge failed!"
  exit 1
fi

Next steps