{"uid":"cap_PZxbbAKEPQOo-ArQrorO9","slug":"writerslogic-shell-quote-posix-powershell-cmd-exe-a173fac5","name":"WritersLogic Shell Quote (POSIX/PowerShell/cmd.exe)","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/shell-quote?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"values":{"type":"array","items":{"type":"string","maxLength":4096},"maxItems":50,"minItems":1,"description":"Literal argument values; at most 100000 characters in total."},"targets":{"type":"array","items":{"enum":["bash","powershell","cmd"],"type":"string"},"maxItems":3,"minItems":1,"description":"Shells to quote for; default all three. Status is unsupported when any requested target cannot carry a value."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_kMUTlfErKzt6ovHuJzPv2","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts up to 50 literal string values into safely shell-quoted arguments for bash, PowerShell, and cmd.exe, with round-trip verification to prove correctness","exampleAgentPrompt":"I need to safely pass these three user-provided strings as separate arguments in a bash and PowerShell command — can you shell-quote them for me: \"hello world\", \"it's a test\", and \"50% done\"?","exampleUseCases":[{"title":"Sanitizing user input for CI pipeline","prompt":"A user just submitted a build tag that might have special characters — can you quote this string safely for bash so I can pass it as an argument to our deploy script: \"release/2024-07 (beta)\"?"},{"title":"Cross-platform script argument escaping","prompt":"I'm building a command that needs to run on both PowerShell and bash — please quote these two argument values for both shells: \"C:\\Users\\Jane Doe\\My Documents\" and \"don't delete this\""},{"title":"Hardening agent-generated CLI commands","prompt":"My agent is constructing a cmd.exe command from user-supplied text and I need to know which of these strings are safe to quote for cmd.exe and what the quoted form looks like: \"hello\", \"50% off\", and \"line1\\nline2\""}],"resultDescription":"For each input string and each requested shell target, the endpoint returns the safely quoted argument string (or the status 'unsupported' if the string cannot be safely represented in that shell, e.g. cmd.exe with line breaks, percent signs, or double quotes). It also provides a round-trip parse result proving the quoted form decodes back to the original string, confirming correctness without executing any real shell.","failureModes":["Input exceeds 50 strings or 100,000 total characters — returns a validation error","An invalid shell target name is provided — returns a schema validation error","String contains characters cmd.exe cannot carry (line breaks, control characters, %, double quotes) — returns 'unsupported' status for that target rather than an error","Network or service unavailability — returns HTTP 5xx","Payment not provided or insufficient — returns HTTP 402"],"whenToPreferThis":"Use this endpoint when an AI agent is dynamically constructing shell command lines from untrusted, user-supplied, or free-form text and needs to safely quote individual argument values without risk of shell injection. It is especially valuable when targeting multiple shells (bash, PowerShell, cmd.exe) simultaneously and when round-trip verification matters. Prefer this over hand-coding quoting logic, which is error-prone for edge cases like embedded quotes, percent signs, and newlines. Do not use it to quote whole commands, choose a shell interpreter, or protect against programs that re-evaluate arguments internally.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T00:32:23.426Z","isFirstParty":false,"canonicalSlug":"writerslogic-shell-quote-posix-powershell-cmd-exe-a173fac5"}