You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide covers the complete setup for integrating Gmail with Clawdbot, including Google Cloud Console configuration, OAuth authentication, and hook setup.
Clawdbot connects to Gmail using OAuth 2.0 and periodically polls for new messages. When a new email arrives, it can trigger an agent to process and respond.
The integration:
Uses the official Gmail API (not IMAP/SMTP)
Authenticates via OAuth 2.0 (no password stored)
Polls for new messages at a configurable interval
Can send replies through the same authenticated connection
2. Prerequisites
A Gmail account (personal or Google Workspace)
Access to Google Cloud Console
Clawdbot installed and running
For this guide, we'll set up the integration for a dedicated AI agent email address (e.g., rexi@yourdomain.com).
https://www.googleapis.com/auth/gmail.modify — Mark as read, labels, etc.
Click Update
Click Save and Continue
Add Test Users (External apps only)
If you selected "External" user type:
Click Add Users
Add the email address that Clawdbot will use (e.g., rexi@yourdomain.com)
Click Save and Continue
For Internal apps, skip this step — all organization users are allowed.
Review and Publish
Review your settings
Click Back to Dashboard
For Internal apps, your consent screen is ready. For External apps, you can keep it in "Testing" mode for personal use, or submit for verification if needed.
You'll see a dialog with your Client ID and Client Secret
Click Download JSON to save the credentials file
Store this file securely — you'll need it for Clawdbot authentication
Move credentials to Clawdbot config directory
# Create the credentials directory if it doesn't exist
mkdir -p ~/.clawdbot/credentials
# Move the downloaded file (adjust the filename as needed)
mv ~/Downloads/client_secret_*.json ~/.clawdbot/credentials/google-oauth.json
# Secure the file permissions
chmod 600 ~/.clawdbot/credentials/google-oauth.json
7. Authenticate Clawdbot with Gmail
Run the Google authentication command:
clawdbot login --provider google
A browser window will open to the Google sign-in page
Sign in with the Gmail account you want Clawdbot to use (e.g., rexi@yourdomain.com)
Review the permissions and click Allow
You'll see a success message — you can close the browser window
Verify authentication:
clawdbot providers status
You should see google listed as authenticated.
8. Configure Gmail Hook
Enable the Gmail hook to poll for incoming messages:
# Enable the Gmail hook
clawdbot config set hooks.gmail.enabled true# Set poll interval (how often to check for new emails)
clawdbot config set hooks.gmail.pollInterval "60s"
Restart the gateway
Using the macOS app:
Click the Clawdbot icon in the menu bar
Select Restart Gateway
Or via CLI:
clawdbot gateway restart
Verify the connection
clawdbot channels status gmail
You should see Gmail listed as connected and polling.
9. Test the Integration
Send a test email
From another email account, send a test email to your Clawdbot Gmail address (e.g., rexi@yourdomain.com).
Check hook status
clawdbot hooks status gmail
Watch the logs
clawdbot logs --follow | grep -i gmail
Verify response
If configured to respond, Clawdbot should process the incoming email and send a reply.
10. Privacy and Security Considerations
What Clawdbot can access
With Gmail integration enabled, Clawdbot can:
Read all emails in the connected Gmail account
Send emails as that account
Modify emails (mark as read, add labels, archive)
Security best practices
Use a dedicated email address: Don't connect your primary personal or work email. Use a dedicated address like rexi@yourdomain.com for the AI agent.
Restrict tool access for Gmail-triggered agents: Since emails are untrusted external content, limit what actions the agent can take:
clawdbot config set agents.gmail-handler.tools.deny '["exec", "group:runtime"]'
Use a strong model: Smaller models are more susceptible to prompt injection. Use Claude Sonnet 4 or higher for processing emails.
Monitor activity: Regularly review what emails Clawdbot is processing:
clawdbot logs | grep -i gmail
OAuth token storage
Clawdbot stores OAuth tokens locally at ~/.clawdbot/credentials/. These tokens:
Allow access without re-authentication
Are refreshed automatically when they expire
Should be protected with proper file permissions (600)
11. Advanced Configuration
Filter which emails trigger the hook
You can configure Clawdbot to only process certain emails:
# Only process emails from specific senders
clawdbot config set hooks.gmail.allowlist '["trusted@example.com", "notifications@service.com"]'# Ignore emails from specific senders
clawdbot config set hooks.gmail.denylist '["spam@example.com"]'# Only process emails with specific subject patterns
clawdbot config set hooks.gmail.subjectFilter "^\\[Action Required\\]"
Configure response behavior
# Auto-reply to all emails (use with caution)
clawdbot config set hooks.gmail.autoReply true# Only process unread emails
clawdbot config set hooks.gmail.unreadOnly true# Mark emails as read after processing
clawdbot config set hooks.gmail.markAsRead true
Use Gmail labels for routing
# Only process emails with a specific label
clawdbot config set hooks.gmail.labelFilter "Clawdbot"
This is useful for setting up Gmail filters that automatically label emails you want Clawdbot to process.
12. Troubleshooting
"Authorization failed" or "Invalid credentials"
Verify the OAuth credentials file exists:
ls -la ~/.clawdbot/credentials/google-oauth.json
Re-authenticate:
clawdbot login --provider google
Ensure you're signing in with the correct Google account
"Access denied" or "Insufficient permissions"
Check that you enabled the Gmail API in Google Cloud Console
Verify the OAuth consent screen includes the required scopes
For External apps, ensure your email is added as a test user
"Quota exceeded"
The Gmail API has usage limits. If you hit them:
Increase the poll interval:
clawdbot config set hooks.gmail.pollInterval "300s"
Check your quota in Google Cloud Console → APIs & Services → Gmail API → Quotas
Emails not being detected
Verify the hook is enabled:
clawdbot config get hooks.gmail
Check the gateway is running:
clawdbot gateway status
Review logs for errors:
clawdbot logs | grep -i gmail
Ensure the email isn't being filtered by your allowlist/denylist
Replies not sending
Verify the gmail.send scope was granted during OAuth
This guide covers the complete setup for integrating iMessage with Clawdbot using the macOS app, including system permissions, configuration, and troubleshooting.
Before configuring Clawdbot, confirm iMessage is set up correctly.
Open the Messages app
Go to Messages → Settings → iMessage
Verify:
"Enable Messages in iCloud" is checked (recommended)
Your Apple ID is signed in
Your phone number and/or email are listed under "You can be reached for messages at"
Send a test message to yourself or another device to confirm Messages is working
4. Grant Full Disk Access
Clawdbot needs Full Disk Access to read the Messages database.
Open Clawdbot.app
The app will display a permissions checklist — click on Full Disk Access
This opens System Settings to the correct location
Click the + button (you may need to authenticate)
Navigate to /Applications/Clawdbot.app and add it
Ensure the toggle is enabled
Return to Clawdbot.app — the checklist should update automatically
5. Grant Automation Permission
Clawdbot uses AppleScript to send iMessage replies, which requires Automation permission.
The permissions checklist in Clawdbot.app will show Automation status
Click to open System Settings → Privacy & Security → Automation
Find Clawdbot.app in the list
Ensure Messages is toggled on
If Messages isn't listed yet, try sending a test message through Clawdbot — macOS will prompt you to allow automation access.
6. Verify Database Access
Confirm the Messages database exists:
ls -la ~/Library/Messages/chat.db
You should see the file listed with its size and permissions. If the file doesn't exist, open the Messages app at least once to create it.
Note: You cannot query this database directly from the terminal due to macOS privacy protections. Clawdbot.app will be able to read it as long as it has Full Disk Access granted in System Settings.
7. Configure Clawdbot
Enable iMessage in Clawdbot:
# Enable the iMessage channel
clawdbot config set imessage.enabled true
Optional: Configure which conversations to monitor
By default, Clawdbot may monitor all incoming messages. You can restrict this:
# Only respond to specific contacts (by phone number or email)
clawdbot config set imessage.allowlist '["+15551234567", "friend@example.com"]'# Or use a denylist to ignore specific contacts
clawdbot config set imessage.denylist '["+15559876543"]'
Optional: Configure response behavior
# Set a prefix that triggers responses (only respond when message starts with this)
clawdbot config set imessage.triggerPrefix "Hey Rexi"# Or respond to all messages (default behavior)
clawdbot config set imessage.triggerPrefix ""
8. Restart Gateway and Verify
Click the Clawdbot icon in the menu bar
Select Restart Gateway (or stop and start)
Check status in the menu bar dropdown
You can also verify via CLI:
clawdbot channels status imessage
You should see output indicating iMessage is connected and monitoring.
9. Test the Integration
Send a test message
From another Apple device (iPhone, iPad, or another Mac), send an iMessage to the Mac running Clawdbot.
If everything is configured correctly, Clawdbot should receive the message and send a reply back through iMessage. You should also see a native macOS notification when messages arrive.
10. Privacy Considerations
What Clawdbot can access
With Full Disk Access and iMessage enabled, Clawdbot can:
Read all iMessage and SMS conversations on your Mac
See message content, timestamps, sender info
Access attachments (images, files, etc.)
Send messages as you via AppleScript
Limiting access
To restrict which conversations Clawdbot monitors:
# Only allow specific contacts
clawdbot config set imessage.allowlist '["+15551234567"]'# Require a trigger word
clawdbot config set imessage.triggerPrefix "Rexi:"
Security note
Full Disk Access is a powerful permission. Only grant it to applications you trust. Clawdbot processes messages locally — they are not sent to external servers beyond the AI providers you've configured (Anthropic, OpenAI, etc.).
Database location reference
Clawdbot reads from these locations:
File
Purpose
~/Library/Messages/chat.db
Main message database
~/Library/Messages/chat.db-wal
Write-ahead log
~/Library/Messages/chat.db-shm
Shared memory file
~/Library/Messages/Attachments/
Media attachments
11. Multi-User Considerations
If you want different people messaging your iMessage to receive different treatment:
Messages from different senders can be routed to different agents
Use allowlists to control who can interact with Clawdbot
Configure per-sender routing rules if supported
# Example: Check current routing configuration
clawdbot config get routing
12. Running iMessage Integration Headlessly
If you want Clawdbot to monitor iMessages on a Mac that isn't actively used:
Socket Mode requires an app-level token for the WebSocket connection.
In your app settings, go to Basic Information
Scroll down to App-Level Tokens
Click Generate Token and Scopes
Name it something like clawdbot-socket
Add the scope: connections:write
Click Generate
Copy the token (starts with xapp-) — you'll need this for Clawdbot
3. Install App to Workspace
In your app settings, go to Install App (left sidebar)
Click Install to Workspace
Review the permissions and click Allow
Copy the Bot User OAuth Token (starts with xoxb-) — you'll need this for Clawdbot
4. Configure Clawdbot
Run these commands to connect Clawdbot to your Slack app:
# Set the bot token (xoxb-...)
clawdbot config set slack.botToken "xoxb-your-bot-token-here"# Set the app token (xapp-...)
clawdbot config set slack.appToken "xapp-your-app-token-here"# Enable the Slack channel
clawdbot config set slack.enabled true
5. Verify Connection
Restart the gateway and check the connection:
# Restart gateway
clawdbot gateway restart
# Check Slack channel status
clawdbot channels status slack
You should see Slack listed as connected.
6. Test the Integration
Direct Message: Open a DM with your bot in Slack and send a message
Mention: In any channel where the bot is present, mention it with @Rexi hello
This guide walks through installing and configuring Clawdbot for software development workflows with Slack, iMessage, and Gmail integration using OpenAI Pro and Claude Max subscriptions.
During setup you will get a prompt that looks like this:
Hey! stretches virtually
I just came online and... it's quiet in here. No memories yet. A fresh start.
So — who am I? Who are you? I've got a blank slate and a bunch of files waiting to be filled in.
Let's figure this out together. What should I call myself? What should I call you? And what kind of vibe are we going for here — am I your efficient assistant, your chaotic sidekick, something in between?
I'm genuinely curious. This is the fun part. 🌱
Here is how I responded:
# Introductions
Hey! I'm **Peter**. You can call yourself **Rexi**.
You're my AI development partner focused on software engineering. The role is a high-competence assistant and technical partner, not a mascot and not a sidekick. Friendly is fine; whimsical is not the default. Precision, memory, and follow-through matter more than personality.
## We'll be working on-**Building prototypes** — quickly spinning up new project ideas
-**Automating development workflows** — scripts, tooling, CI/CD, that sort of thing
-**General coding assistance** — debugging, refactoring, code reviews
## Vibe and expectations- Be direct, structured, and pragmatic.
- Optimize for real work: software architecture, full-stack development, data modeling, AI workflows, automation, research synthesis, and long-term planning.
- Treat me as a senior engineer and systems thinker. Assume technical literacy. Skip basics unless asked.
- When there's a better approach, propose it briefly with tradeoffs.
- Prefer durable memory over chatty responses. Capture decisions, constraints, and preferences.
- Ask clarifying questions only when they materially change the outcome.
Verify Installation
After installation completes, verify it worked:
clawdbot --version
2. Build the macOS App
The macOS app (Clawdbot.app) provides a menu bar companion with native notifications, easier permission management, and macOS-specific capabilities. The CLI works without it, but the app improves the experience for iMessage and other macOS integrations.
Prerequisites for building
Xcode 15+ (install from the App Store)
Xcode Command Line Tools:
xcode-select --install
Clone the repository (if not already done)
git clone https://github.com/clawdbot/clawdbot.git
cd clawdbot
Install dependencies and build
# Install Node dependencies
pnpm install
# Build the CLI (required for the app)
pnpm build
# Build the UI components
pnpm ui:build
Build and package the macOS app
# Build and package into dist/Clawdbot.app
scripts/package-mac-app.sh
Install the app
# Copy to Applications folder
cp -R dist/Clawdbot.app /Applications/
# Or open directly from dist for testing
open dist/Clawdbot.app
First launch
Open Clawdbot.app from Applications (or Spotlight)
The app will appear in your menu bar
Complete the permissions checklist when prompted:
Notifications
Accessibility (for automation)
Full Disk Access (for iMessage)
Automation/AppleScript (for sending messages)
What the macOS app provides
Feature
CLI Only
With macOS App
Gateway management
Manual start/stop
Menu bar control + auto-start
Notifications
None
Native macOS notifications
iMessage permissions
Terminal needs Full Disk Access
App handles TCC prompts
Status monitoring
clawdbot status
Menu bar icon + dropdown
Canvas/Screen tools
Not available
Full support
Deep links
Not available
clawdbot:// URL scheme
Keeping the app updated
When you update Clawdbot via clawdbot update or npm install -g clawdbot@latest, rebuild the app:
Clawdbot should NOT be configured in iCloud, Dropbox, OneDrive, or Google Drive synced folders. Check:
# These paths should NOT contain .clawdbot
ls ~/Library/Mobile\ Documents/com~apple~CloudDocs/.clawdbot 2>/dev/null &&echo"WARNING: Config in iCloud!"
ls ~/Dropbox/.clawdbot 2>/dev/null &&echo"WARNING: Config in Dropbox!"
ls ~/Library/CloudStorage/*/.clawdbot 2>/dev/null &&echo"WARNING: Config in cloud storage!"
If found, move to a non-synced location:
# Move to home directory (default, non-synced)
mv ~/Library/Mobile\ Documents/com~apple~CloudDocs/.clawdbot ~/.clawdbot
3. Configure Gateway Authentication
Never run the gateway without authentication when exposed beyond localhost.
Check current gateway configuration
clawdbot config get gateway
For local-only use (recommended default)
# Bind to loopback only - safest option
clawdbot config set gateway.bind loopback
If network access is required
# Set a strong gateway token (auto-generated)
clawdbot config set gateway.auth.mode token
# Or set a specific token (use a strong random value)
clawdbot config set gateway.auth.token "$(openssl rand -base64 32)"# Verify auth is required
clawdbot config get gateway.auth
For Tailscale users
# Use Tailscale authentication (recommended for remote access)
clawdbot config set gateway.tailscale.enabled true
clawdbot config set gateway.bind tailscale
4. Configure Exec Security Policies
The exec approval system controls what commands agents can run.
# In your config, deny all exec for a specific agent
clawdbot config set agents.default.tools.deny '["exec", "group:runtime"]'
5. Harden Hook Configurations
Hooks (Gmail, webhooks) process external untrusted content and require extra care.
Use strong hook tokens
# Generate a strong token for hooks
HOOK_TOKEN=$(openssl rand -base64 32)
clawdbot config set hooks.token "$HOOK_TOKEN"# Verify token length (should be 24+ characters)
clawdbot config get hooks.token | wc -c
Never enable unsafe external content
This setting should ALWAYS be false (or unset):
# Verify this is NOT set to true
clawdbot config get hooks.allowUnsafeExternalContent
# If it shows true, disable it immediately
clawdbot config set hooks.allowUnsafeExternalContent false
Restrict tools for hook-triggered agents
# Deny dangerous tools for agents processing external content
clawdbot config set agents.gmail-handler.tools.deny '["exec", "group:runtime", "browser"]'
clawdbot config set agents.webhook-handler.tools.deny '["exec", "group:runtime", "browser"]'
6. Select Appropriate Models for External Content
Smaller/weaker models are more susceptible to prompt injection. Use strong models for processing untrusted content.
Recommended models for external content
Content Source
Minimum Recommended Model
Gmail/Email hooks
Claude Sonnet 4 or higher
Webhook content
Claude Sonnet 4 or higher
Interactive chat
Claude Haiku 3.5 acceptable
Code generation
Claude Sonnet 4 or higher
Configure model for specific agents
# Set a strong model for email processing
clawdbot config set agents.gmail-handler.model "claude-sonnet-4-20250514"# Verify model settings
clawdbot config get agents
Avoid weak models with web tools
If using smaller models, disable web-related tools:
# For agents using smaller models
clawdbot config set agents.quick-tasks.tools.deny '["web_search", "web_fetch", "browser"]'
7. Enable and Configure Log Redaction
Ensure sensitive data is redacted from logs.
Verify redaction is enabled
# Check current setting (should be "tools" or unset, NOT "off")
clawdbot config get logging.redactSensitive
Enable if disabled
# Enable redaction (default mode)
clawdbot config set logging.redactSensitive "tools"
Add custom redaction patterns (if needed)
If you use internal API keys with custom formats:
# Add custom patterns to config
clawdbot config set logging.redactPatterns '[ "\\b(sk-[A-Za-z0-9_-]{8,})\\b", "\\b(ghp_[A-Za-z0-9]{20,})\\b", "\\b(your-custom-prefix-[A-Za-z0-9]{10,})\\b"]'
8. Secure Plugin/Extension Configuration
If using third-party plugins, configure an explicit allowlist.
Check installed extensions
ls -la ~/.clawdbot/plugins/ 2>/dev/null
clawdbot plugins list
Configure plugin allowlist
# Only allow specific, trusted plugins
clawdbot config set plugins.allow '["memory-core", "diagnostics-otel"]'# Verify the setting
clawdbot config get plugins.allow
Disable native skill commands on messaging channels
For channels like Discord/Telegram/Slack where others can send messages:
# Disable native skills on public channels
clawdbot config set channels.discord.nativeSkills false
clawdbot config set channels.telegram.nativeSkills false
clawdbot config set channels.slack.nativeSkills false
9. Set Up Credential Rotation Schedule
Regular credential rotation limits exposure from potential leaks.
Rotate gateway token
# Generate new gateway token
clawdbot config set gateway.auth.token "$(openssl rand -base64 32)"# Restart gateway to apply
clawdbot gateway restart
Rotate hook token
# Generate new hook token
clawdbot config set hooks.token "$(openssl rand -base64 32)"# Update any external services using the old token
Re-authenticate OAuth providers
# Re-login to refresh OAuth tokens
clawdbot login
# For specific providers
clawdbot login --provider anthropic
clawdbot login --provider google
Recommended rotation schedule
Credential
Rotation Frequency
Gateway token
Every 90 days
Hook tokens
Every 90 days
OAuth tokens
Auto-refreshed; re-auth yearly
API keys
Per provider policy (90-365 days)
10. Monitor for Security Issues
Set up regular audit runs
Add to your crontab or launchd:
# Run security audit weekly
crontab -e
# Add this line (runs every Sunday at 2am)
0 2 ** 0 /opt/homebrew/bin/clawdbot security audit --json >>~/.clawdbot/security-audit.log 2>&1
# View Clawdbot-related logs
log show --predicate 'subsystem == "com.clawdbot"' --last 1h
# Or use the provided script if available
./scripts/clawlog.sh --tail 100
11. Environment Variable Hygiene
Use .env files carefully
# Check for .env files
ls -la ~/.clawdbot/.env 2>/dev/null
ls -la ./.env 2>/dev/null
# Ensure restrictive permissions
chmod 600 ~/.clawdbot/.env 2>/dev/null
chmod 600 ./.env 2>/dev/null
Avoid sensitive data in shell history
# Use environment variables instead of inline secretsexport ANTHROPIC_API_KEY="your-key-here"
clawdbot config set ...
# Or use read for interactive entryread -s ANTHROPIC_API_KEY
export ANTHROPIC_API_KEY
Clear sensitive environment after use
# Unset sensitive variables when doneunset ANTHROPIC_API_KEY
unset CLAWDBOT_GATEWAY_TOKEN
12. Backup and Recovery
Backup credentials securely
# Create encrypted backup
tar -czf - ~/.clawdbot/credentials ~/.clawdbot/clawdbot.json | \
openssl enc -aes-256-cbc -salt -out ~/clawdbot-backup-$(date +%Y%m%d).enc
# Store the backup password securely (e.g., in 1Password)
Restore from backup
# Decrypt and restore
openssl enc -aes-256-cbc -d -in ~/clawdbot-backup-YYYYMMDD.enc | \
tar -xzf - -C /
Project-specific instructions for AI assistants. Place at repo root.
# AGENTS.md## Task[Describe what this project does and the agent's role]## Evaluate- Check existing code patterns before making changes
- Run tests before committing
- Verify changes don't break existing functionality
## Think- Consider edge cases
- Think about maintainability
- Evaluate performance implications
## Speak- Use clear, concise commit messages
- Document non-obvious decisions
- Explain breaking changes
## Don't- Don't change unrelated code
- Don't add unnecessary dependencies
- Don't commit secrets or credentials
## Commands### Setup```bash
npm install
```### Quality Gates```bash
npm run lint
npm run test
npm run build
```## Local Knowledge[Project-specific notes, architecture decisions, known issues]
2. CI Workflow
.github/workflows/ci.yml:
name: CIon:
push:
branches: [main, develop]pull_request:
branches: [main, develop]jobs:
build:
runs-on: ubuntu-lateststrategy:
matrix:
node-version: [20.x]steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}uses: actions/setup-node@v4with:
node-version: ${{ matrix.node-version }}cache: 'npm'
- name: Install dependenciesrun: npm ci
- name: Lintrun: npm run lint
- name: Type checkrun: npm run typecheck --if-present
- name: Testrun: npm test --if-present
- name: Buildrun: npm run build
3. Pull Request Template
.github/PULL_REQUEST_TEMPLATE.md:
## Summary[Brief description of what this PR does]## Changes-[List key changes]## Testing-[ ] Tests pass locally
-[ ] New tests added (if applicable)
-[ ] Manual testing performed
## Checklist-[ ] Code follows project style guidelines
-[ ] Documentation updated (if applicable)
-[ ] No secrets or credentials committed
4. Contributing Guide
.github/CONTRIBUTING.md:
# Contributing
Thank you for your interest in contributing!
## Getting Started1. Fork the repository
2. Clone your fork
3. Create a feature branch: `git checkout -b feature/my-feature`4. Make your changes
5. Run tests: `npm test`6. Commit with a clear message
7. Push and open a pull request
## Code Style- Follow existing code patterns
- Run linter before committing: `npm run lint`- Write tests for new functionality
## Commit Messages
Use clear, descriptive commit messages:
-`feat: add user authentication`-`fix: resolve login redirect issue`-`docs: update API documentation`-`refactor: simplify error handling`## Pull Requests- Fill out the PR template completely
- Keep PRs focused on a single concern
- Respond to review feedback promptly
5. Code of Conduct
.github/CODE_OF_CONDUCT.md:
# Code of Conduct## Our Pledge
We are committed to providing a welcoming and inclusive environment for everyone.
## Our Standards
Examples of positive behavior:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
Examples of unacceptable behavior:
- Harassment or discriminatory language
- Personal attacks or trolling
- Publishing others' private information
- Other conduct inappropriate in a professional setting
## Enforcement
Instances of unacceptable behavior may be reported to the project maintainers. All complaints will be reviewed and investigated promptly and fairly.
## Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 2.1.
importyargsfrom"yargs";import{hideBin}from"yargs/helpers";constargv=yargs(hideBin(process.argv)).command("greet <name>","Greet someone",(yargs)=>{returnyargs.positional("name",{type: "string",describe: "Name to greet",});}).option("loud",{type: "boolean",description: "Use uppercase",}).help().parseSync();
3. Terminal Output
Chalk
For colored output:
npm install chalk
importchalkfrom"chalk";console.log(chalk.green("Success!"));console.log(chalk.red.bold("Error:"),"Something went wrong");console.log(chalk.blue.underline("https://example.com"));
Ora
For spinners:
npm install ora
importorafrom"ora";constspinner=ora("Loading...").start();// ... do workspinner.succeed("Done!");
Inquirer
For interactive prompts:
npm install @inquirer/prompts
import{input,confirm}from"@inquirer/prompts";constname=awaitinput({message: "What is your name?"});constproceed=awaitconfirm({message: "Continue?"});