1 line
22 KiB
JavaScript
1 line
22 KiB
JavaScript
"use strict";(globalThis.webpackChunkproject_public_docs=globalThis.webpackChunkproject_public_docs||[]).push([[746],{7921(e,n,s){s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>i,default:()=>p,frontMatter:()=>l,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"reference/examples","title":"Example Tools","description":"CmdForge comes with 28 pre-built tools. This document shows their configurations and usage.","source":"@site/docs/reference/examples.md","sourceDirName":"reference","slug":"/reference/examples","permalink":"/rob/CmdForge/reference/examples","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":4,"frontMatter":{"sidebar_label":"Example Tools","sidebar_position":4,"format":"md"},"sidebar":"docs","previous":{"title":"Collections","permalink":"/rob/CmdForge/reference/collections"},"next":{"title":"Design Philosophy","permalink":"/rob/CmdForge/reference/design"}}');var r=s(4848),a=s(8453);const l={sidebar_label:"Example Tools",sidebar_position:4,format:"md"},i="Example Tools",o={},c=[{value:"Quick Install",id:"quick-install",level:2},{value:"Text Processing Tools",id:"text-processing-tools",level:2},{value:"summarize",id:"summarize",level:3},{value:"translate",id:"translate",level:3},{value:"fix-grammar",id:"fix-grammar",level:3},{value:"simplify",id:"simplify",level:3},{value:"tone-shift",id:"tone-shift",level:3},{value:"eli5",id:"eli5",level:3},{value:"tldr",id:"tldr",level:3},{value:"expand",id:"expand",level:3},{value:"Developer Tools",id:"developer-tools",level:2},{value:"explain-error",id:"explain-error",level:3},{value:"explain-code",id:"explain-code",level:3},{value:"review-code",id:"review-code",level:3},{value:"gen-tests",id:"gen-tests",level:3},{value:"docstring",id:"docstring",level:3},{value:"commit-msg",id:"commit-msg",level:3},{value:"Data Tools",id:"data-tools",level:2},{value:"json-extract",id:"json-extract",level:3},{value:"sql-from-text",id:"sql-from-text",level:3},{value:"Advanced Multi-Step Tools",id:"advanced-multi-step-tools",level:2},{value:"log-errors",id:"log-errors",level:3},{value:"diff-focus",id:"diff-focus",level:3},{value:"Pipeline Recipes",id:"pipeline-recipes",level:2},{value:"Development Workflows",id:"development-workflows",level:3},{value:"Data Processing",id:"data-processing",level:3},{value:"Text Processing Pipelines",id:"text-processing-pipelines",level:3},{value:"Shell Functions",id:"shell-functions",level:3}];function d(e){const n={code:"code",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,a.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"example-tools",children:"Example Tools"})}),"\n",(0,r.jsx)(n.p,{children:"CmdForge comes with 28 pre-built tools. This document shows their configurations and usage."}),"\n",(0,r.jsx)(n.h2,{id:"quick-install",children:"Quick Install"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"# Install all example tools (from the CmdForge directory)\npython examples/install.py\ncmdforge refresh\n\n# Or install from anywhere\ncurl -sSL https://gitea.brrd.tech/rob/cmdforge/raw/branch/main/examples/install.py | python3\n"})}),"\n",(0,r.jsx)(n.h2,{id:"text-processing-tools",children:"Text Processing Tools"}),"\n",(0,r.jsx)(n.h3,{id:"summarize",children:"summarize"}),"\n",(0,r.jsx)(n.p,{children:"Condense long documents to key points."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: summarize\ndescription: Condense long documents to key points\narguments:\n - flag: --length\n variable: length\n default: "3-5 bullet points"\nsteps:\n - type: prompt\n prompt: |\n Summarize the following text into {length}. Be concise and capture the key points:\n\n {input}\n provider: opencode-pickle\n output_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'cat article.txt | summarize\ncat book.txt | summarize --length "10 bullet points"\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"translate",children:"translate"}),"\n",(0,r.jsx)(n.p,{children:"Translate text to any language."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: translate\ndescription: Translate text to any language\narguments:\n - flag: --lang\n variable: lang\n default: Spanish\nsteps:\n - type: prompt\n prompt: |\n Translate the following text to {lang}. Only output the translation, nothing else:\n\n {input}\n provider: claude-haiku\n output_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'echo "Hello, world!" | translate --lang French\ncat readme.md | translate --lang Japanese\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"fix-grammar",children:"fix-grammar"}),"\n",(0,r.jsx)(n.p,{children:"Fix grammar and spelling errors."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: fix-grammar\ndescription: Fix grammar and spelling errors\narguments: []\nsteps:\n - type: prompt\n prompt: |\n Fix all grammar, spelling, and punctuation errors in the following text. Only output the corrected text, no explanations:\n\n {input}\n provider: opencode-deepseek\n output_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'echo "teh cat sat on teh mat" | fix-grammar\ncat draft.txt | fix-grammar > fixed.txt\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"simplify",children:"simplify"}),"\n",(0,r.jsx)(n.p,{children:"Rewrite text for easier understanding."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: simplify\ndescription: Rewrite text for easier understanding\narguments:\n - flag: --level\n variable: level\n default: "5th grade reading level"\nsteps:\n - type: prompt\n prompt: |\n Rewrite the following text for a {level}. Keep the meaning but use simpler words and shorter sentences:\n\n {input}\n provider: opencode-pickle\n output_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'cat legal_document.txt | simplify\ncat technical.md | simplify --level "non-technical reader"\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"tone-shift",children:"tone-shift"}),"\n",(0,r.jsx)(n.p,{children:"Change the tone of text."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: tone-shift\ndescription: Change the tone of text\narguments:\n - flag: --tone\n variable: tone\n default: professional\nsteps:\n - type: prompt\n prompt: |\n Rewrite the following text in a {tone} tone. Keep the core message but adjust the style:\n\n {input}\n provider: opencode-deepseek\n output_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'cat angry_email.txt | tone-shift --tone "calm and professional"\ncat casual_note.txt | tone-shift --tone formal\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"eli5",children:"eli5"}),"\n",(0,r.jsx)(n.p,{children:"Explain like I'm 5."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:"name: eli5\ndescription: Explain like I'm 5\narguments: []\nsteps:\n - type: prompt\n prompt: |\n Explain this like I'm 5 years old. Use simple words and fun analogies:\n\n {input}\n provider: opencode-pickle\n output_var: response\noutput: \"{response}\"\n"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'echo "What is quantum computing?" | eli5\ncat whitepaper.txt | eli5\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"tldr",children:"tldr"}),"\n",(0,r.jsx)(n.p,{children:"One-line summary."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: tldr\ndescription: One-line summary\narguments: []\nsteps:\n - type: prompt\n prompt: |\n Give a one-line TL;DR summary of this text:\n\n {input}\n provider: opencode-grok\n output_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"cat long_article.txt | tldr\ncurl -s https://example.com | tldr\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"expand",children:"expand"}),"\n",(0,r.jsx)(n.p,{children:"Expand bullet points to paragraphs."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: expand\ndescription: Expand bullet points to paragraphs\narguments: []\nsteps:\n - type: prompt\n prompt: |\n Expand these bullet points into well-written paragraphs:\n\n {input}\n provider: opencode-pickle\n output_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'cat notes.txt | expand\necho "- Fast\\n- Reliable\\n- Easy to use" | expand\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"developer-tools",children:"Developer Tools"}),"\n",(0,r.jsx)(n.h3,{id:"explain-error",children:"explain-error"}),"\n",(0,r.jsx)(n.p,{children:"Explain error messages and stack traces."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: explain-error\ndescription: Explain error messages and stack traces\narguments: []\nsteps:\n - type: prompt\n prompt: |\n Explain this error/stack trace in plain English. What went wrong and how to fix it:\n\n {input}\n provider: claude-haiku\n output_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"cat error.log | explain-error\npython script.py 2>&1 | explain-error\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"explain-code",children:"explain-code"}),"\n",(0,r.jsx)(n.p,{children:"Explain what code does."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:"name: explain-code\ndescription: Explain what code does\narguments:\n - flag: --detail\n variable: detail\n default: moderate\nsteps:\n - type: prompt\n prompt: |\n Explain what this code does at a {detail} level of detail:\n\n"})}),"\n",input,"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'provider: opencode-pickle\noutput_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'cat script.py | explain-code\ncat complex.js | explain-code --detail "very detailed"\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"review-code",children:"review-code"}),"\n",(0,r.jsx)(n.p,{children:"Quick code review with suggestions."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: review-code\ndescription: Quick code review with suggestions\narguments:\n - flag: --focus\n variable: focus\n default: "bugs, security, and improvements"\nsteps:\n - type: prompt\n prompt: |\n Review this code focusing on {focus}. Be concise and actionable:\n\n'})}),"\n",input,"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'provider: claude-sonnet\noutput_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'cat pull_request.diff | review-code\ncat auth.py | review-code --focus "security vulnerabilities"\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"gen-tests",children:"gen-tests"}),"\n",(0,r.jsx)(n.p,{children:"Generate unit tests for code."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:"name: gen-tests\ndescription: Generate unit tests for code\narguments:\n - flag: --framework\n variable: framework\n default: pytest\nsteps:\n - type: prompt\n prompt: |\n Generate comprehensive unit tests for this code using {framework}. Include edge cases:\n\n"})}),"\n",input,"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'provider: claude-haiku\noutput_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"cat utils.py | gen-tests\ncat api.js | gen-tests --framework jest\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"docstring",children:"docstring"}),"\n",(0,r.jsx)(n.p,{children:"Add docstrings to functions/classes."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:"name: docstring\ndescription: Add docstrings to functions/classes\narguments:\n - flag: --style\n variable: style\n default: Google style\nsteps:\n - type: prompt\n prompt: |\n Add {style} docstrings to all functions and classes in this code. Output the complete code with docstrings:\n\n"})}),"\n",input,"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:'provider: opencode-deepseek\noutput_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'cat module.py | docstring\ncat functions.py | docstring --style "NumPy style"\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"commit-msg",children:"commit-msg"}),"\n",(0,r.jsx)(n.p,{children:"Generate commit message from diff."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: commit-msg\ndescription: Generate commit message from diff\narguments:\n - flag: --style\n variable: style\n default: conventional commits\nsteps:\n - type: prompt\n prompt: |\n Generate a concise {style} commit message for this diff. Just the message, no explanation:\n\n {input}\n provider: opencode-pickle\n output_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'git diff --staged | commit-msg\ngit diff HEAD~1 | commit-msg --style "simple"\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"data-tools",children:"Data Tools"}),"\n",(0,r.jsx)(n.h3,{id:"json-extract",children:"json-extract"}),"\n",(0,r.jsx)(n.p,{children:"Extract structured data as validated JSON."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:"name: json-extract\ndescription: Extract structured data as validated JSON\narguments:\n - flag: --fields\n variable: fields\n default: any relevant fields\nsteps:\n - type: prompt\n prompt: |\n Extract {fields} from this text as a JSON object. Output ONLY valid JSON, no markdown, no explanation:\n\n {input}\n provider: opencode-deepseek\n output_var: raw_json\n - type: code\n code: |\n import json\n import re\n text = raw_json.strip()\n text = re.sub(r'^```json?\\s*', '', text)\n text = re.sub(r'\\s*```$', '', text)\n try:\n parsed = json.loads(text)\n validated = json.dumps(parsed, indent=2)\n except json.JSONDecodeError as e:\n validated = f\"ERROR: Invalid JSON - {e}\\nRaw output: {text[:500]}\"\n output_var: validated\noutput: \"{validated}\"\n"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'echo "Price $49.99, SKU ABC-123" | json-extract --fields "price, sku"\ncat invoice.txt | json-extract --fields "total, date, items"\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"sql-from-text",children:"sql-from-text"}),"\n",(0,r.jsx)(n.p,{children:"Generate SQL from natural language."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:'name: sql-from-text\ndescription: Generate SQL from natural language\narguments:\n - flag: --dialect\n variable: dialect\n default: PostgreSQL\nsteps:\n - type: prompt\n prompt: |\n Generate a {dialect} SQL query for this request. Output only the SQL, no explanation:\n\n {input}\n provider: claude-haiku\n output_var: response\noutput: "{response}"\n'})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'echo "get all users who signed up last month" | sql-from-text\necho "count orders by status" | sql-from-text --dialect MySQL\n'})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"advanced-multi-step-tools",children:"Advanced Multi-Step Tools"}),"\n",(0,r.jsx)(n.h3,{id:"log-errors",children:"log-errors"}),"\n",(0,r.jsx)(n.p,{children:"Extract and explain errors from large log files."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:"name: log-errors\ndescription: Extract and explain errors from large log files\narguments: []\nsteps:\n - type: code\n code: |\n import re\n lines = input.split('\\n')\n result = []\n for i, line in enumerate(lines):\n if re.search(r'\\b(ERROR|CRITICAL|FATAL|Exception|Traceback)\\b', line, re.I):\n result.extend(lines[i:i+5])\n extracted = '\\n'.join(result[:200])\n output_var: extracted\n - type: prompt\n prompt: |\n Analyze these error log entries. Group by error type, explain likely causes, and suggest fixes:\n\n {extracted}\n provider: claude-haiku\n output_var: response\noutput: \"{response}\"\n"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"cat huge_app.log | log-errors\nzcat archived.log.gz | log-errors\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h3,{id:"diff-focus",children:"diff-focus"}),"\n",(0,r.jsx)(n.p,{children:"Review only the added/changed code in a diff."}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:"name: diff-focus\ndescription: Review only the added/changed code in a diff\narguments: []\nsteps:\n - type: code\n code: |\n lines = input.split('\\n')\n result = []\n for i, line in enumerate(lines):\n if line.startswith('@@') or line.startswith('+++') or line.startswith('---'):\n result.append(line)\n elif line.startswith('+') and not line.startswith('+++'):\n result.append(line)\n extracted = '\\n'.join(result)\n output_var: extracted\n - type: prompt\n prompt: |\n Review these added lines of code. Focus on bugs, security issues, and improvements:\n\n {extracted}\n provider: claude-haiku\n output_var: response\noutput: \"{response}\"\n"})}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.strong,{children:"Usage:"})}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"git diff | diff-focus\ngit diff HEAD~5 | diff-focus\n"})}),"\n",(0,r.jsx)(n.hr,{}),"\n",(0,r.jsx)(n.h2,{id:"pipeline-recipes",children:"Pipeline Recipes"}),"\n",(0,r.jsx)(n.p,{children:"CmdForge tools chain together like Unix commands:"}),"\n",(0,r.jsx)(n.h3,{id:"development-workflows",children:"Development Workflows"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"# Quick PR review: extract changes, review, summarize\ngit diff main | diff-focus | review-code --focus \"bugs and security\" | tldr\n\n# Explain and fix an error in one pipeline\npython script.py 2>&1 | explain-error | tee error_analysis.txt\n\n# Generate tests for changed files only\ngit diff --name-only | grep '\\.py$' | xargs cat | gen-tests > new_tests.py\n\n# Create release notes from commits\ngit log v1.0..v1.1 --oneline | changelog | translate --lang French > RELEASE_FR.md\n"})}),"\n",(0,r.jsx)(n.h3,{id:"data-processing",children:"Data Processing"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'# Extract, transform, analyze\ncurl -s api.example.com/data | json-extract --fields "users, revenue" | json2csv | csv-insights\n\n# Process multiple files\nfor f in reports/*.txt; do\n cat "$f" | json-extract --fields "total, date"\ndone | json2csv > summary.csv\n'})}),"\n",(0,r.jsx)(n.h3,{id:"text-processing-pipelines",children:"Text Processing Pipelines"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'# Translate technical docs for international team\ncat API.md | simplify --level "non-technical" | translate --lang Spanish > API_ES.md\n\n# Process customer feedback\ncat feedback.txt | summarize --length "10 points" | tone-shift --tone analytical\n'})}),"\n",(0,r.jsx)(n.h3,{id:"shell-functions",children:"Shell Functions"}),"\n",(0,r.jsxs)(n.p,{children:["Add to ",(0,r.jsx)(n.code,{children:"~/.bashrc"})," for common workflows:"]}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:'# Review recent changes\nreview-recent() {\n git diff HEAD~"${1:-1}" | diff-focus | review-code | tldr\n}\n\n# Quick translate with summary\ntranslate-summary() {\n cat "$1" | summarize | translate --lang "${2:-Spanish}"\n}\n\n# Generate commit message and commit\nauto-commit() {\n msg=$(git diff --staged | commit-msg)\n echo "Commit message: $msg"\n read -p "Commit? [y/N] " confirm\n [[ $confirm == [yY] ]] && git commit -m "$msg"\n}\n'})})]})}function p(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},8453(e,n,s){s.d(n,{R:()=>l,x:()=>i});var t=s(6540);const r={},a=t.createContext(r);function l(e){const n=t.useContext(a);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),t.createElement(a.Provider,{value:n},e.children)}}}]); |