@redbison/cli 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +197 -2
  2. package/dist/index.js +610 -0
  3. package/package.json +42 -4
package/README.md CHANGED
@@ -1,3 +1,198 @@
1
- # Temporary Holding Version
1
+ # redbison
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 100 developer tools in your terminal. 65 of them never touch the network.
4
+
5
+ ```console
6
+ $ echo '{"b":1,"a":2}' | redbison json-format
7
+ {
8
+ "b": 1,
9
+ "a": 2
10
+ }
11
+ ```
12
+
13
+ The same tools as [redbison.dev](https://redbison.dev) and the [VS Code and JetBrains
14
+ plugins](https://redbison.dev/plugins), reading standard input and writing standard output so
15
+ they compose with everything else you already use.
16
+
17
+ ## Install
18
+
19
+ ```sh
20
+ npm install -g @redbison/cli
21
+ ```
22
+
23
+ Then check it works:
24
+
25
+ ```sh
26
+ redbison --version
27
+ ```
28
+
29
+ No account, no key, no config file. `rb` is installed as a shorter alias for the same thing.
30
+
31
+ <details>
32
+ <summary>Other ways</summary>
33
+
34
+ Run it once without installing:
35
+
36
+ ```sh
37
+ npx @redbison/cli json-format package.json
38
+ ```
39
+
40
+ With pnpm or yarn:
41
+
42
+ ```sh
43
+ pnpm add -g @redbison/cli
44
+ yarn global add @redbison/cli
45
+ ```
46
+
47
+ Node 18 or newer is required. That is the only dependency.
48
+
49
+ </details>
50
+
51
+ ## Use
52
+
53
+ A tool takes its input from an argument, a file, or a pipe — whichever you give it.
54
+
55
+ ```sh
56
+ redbison rot13 "hello" # an argument
57
+ redbison json-format --file data.json # a file
58
+ cat data.json | redbison json-format # a pipe
59
+ redbison json-format @data.json # @path is shorthand for --file
60
+ ```
61
+
62
+ The answer goes to standard output and nothing else does, so this works the way you would hope:
63
+
64
+ ```sh
65
+ redbison hash --algorithm sha256 --file build.tar.gz | pbcopy
66
+ curl -s https://api.example.com/thing | redbison json-format > thing.json
67
+ ```
68
+
69
+ ### Finding a tool
70
+
71
+ ```sh
72
+ redbison --help # all 100, grouped
73
+ redbison --list # one per line, for grep
74
+ redbison --list | grep -i base64
75
+ redbison base64-decode --help
76
+ ```
77
+
78
+ Every tool's help page shows what it does, every option it takes with its values and default,
79
+ a worked example, and whether it uses the network:
80
+
81
+ ```console
82
+ $ redbison hash --help
83
+ redbison hash: Hash the selection
84
+
85
+ MD5, SHA-1, SHA-256 and SHA-512 of the selection.
86
+
87
+ Usage:
88
+ redbison hash [options] [text]
89
+ cat file | redbison hash [options]
90
+ redbison hash [options] --file path
91
+
92
+ Options:
93
+ --algorithm <value> digest algorithm; one of: sha256, sha512, sha384, sha1, md5; default "sha256"
94
+ sha256 the usual choice
95
+ sha1 broken for signatures, fine for checksums
96
+ md5 broken for signatures, fine for checksums
97
+ --encoding <value> how to print the digest; one of: hex, base64; default "hex"
98
+
99
+ Example:
100
+ $ redbison hash --algorithm sha256 RedBison
101
+ 548590114f517e1198b39913e4bb9b0f0cde7ebafc76cf853b5b9597bb9bf902
102
+
103
+ Runs on your machine. No network.
104
+ Online: https://redbison.dev/hash-generator
105
+ ```
106
+
107
+ ### Options
108
+
109
+ Options are flags, and a wrong one is refused rather than ignored:
110
+
111
+ ```console
112
+ $ redbison hash --algoritm sha512 abc
113
+ Unknown option --algoritm. hash takes --algorithm, --encoding. Did you mean --algorithm?
114
+ ```
115
+
116
+ That matters more here than it looks: a digest produced with the wrong algorithm looks exactly
117
+ like one produced with the right algorithm.
118
+
119
+ A few options take a second body of text, and those accept a file too:
120
+
121
+ ```sh
122
+ redbison list-compare --b @yesterday.txt --file today.txt
123
+ redbison hash-compare --b 900150983cd24fb0d6963f7d28e17f72 --file notes.md
124
+ ```
125
+
126
+ If your input starts with a hyphen, put `--` first:
127
+
128
+ ```sh
129
+ redbison number-to-words -- -42
130
+ ```
131
+
132
+ ## What runs where
133
+
134
+ 65 of the 100 run entirely on your machine: JSON, base64, hashes, JWT decoding, case
135
+ conversion, sorting, hex, URLs, UUIDs, subnets, chmod, IEEE 754 and the rest. They are
136
+ arithmetic and string work, and your input never leaves the process.
137
+
138
+ The other 35 need a real parser or a data set that changes without us — YAML, SQL, HTML, XML,
139
+ JavaScript and CSS formatting, bcrypt, ASCII-art fonts, schema validation, user-agent tables —
140
+ so they send the input to `mcp.redbison.dev` and send nothing else: no account, no identifier,
141
+ nothing stored.
142
+
143
+ To be certain, pass `--offline`. It refuses rather than sending:
144
+
145
+ ```console
146
+ $ redbison yaml-to-json --offline "a: 1"
147
+ yaml-to-json runs on the server, and --offline was given, so nothing was sent.
148
+ Tools that work without a network: redbison --list | grep local
149
+ ```
150
+
151
+ ```sh
152
+ redbison --list | grep local | wc -l # 65
153
+ ```
154
+
155
+ ## Exit codes
156
+
157
+ | Code | Meaning |
158
+ | --- | --- |
159
+ | `0` | it worked |
160
+ | `1` | the tool refused the input, or the server could not be reached |
161
+ | `2` | the command line was wrong: unknown tool, unknown option, missing input |
162
+
163
+ Diagnostics go to standard error, so a pipe only ever carries the answer.
164
+
165
+ ```sh
166
+ redbison json-validate --file config.json || echo "config.json is not valid JSON"
167
+ ```
168
+
169
+ ## Recipes
170
+
171
+ ```sh
172
+ # Pretty-print every JSON file in a directory, in place
173
+ for f in *.json; do redbison json-format --file "$f" > "$f.tmp" && mv "$f.tmp" "$f"; done
174
+
175
+ # What is in this JWT?
176
+ redbison jwt-decode "$TOKEN"
177
+
178
+ # A password for a new service
179
+ redbison password --length 32 --charset alphanumeric
180
+
181
+ # Sort an import list the way a human would
182
+ redbison sort-lines --order natural --file imports.txt
183
+
184
+ # Which of yesterday's URLs are gone today?
185
+ redbison list-compare --b @today.txt --file yesterday.txt
186
+
187
+ # Checksum a release and copy it
188
+ redbison hash --algorithm sha512 --file release.tar.gz | pbcopy
189
+ ```
190
+
191
+ ## Everything else
192
+
193
+ - The tools online: [redbison.dev](https://redbison.dev)
194
+ - In your editor: [redbison.dev/plugins](https://redbison.dev/plugins)
195
+ - For AI assistants over MCP: [redbison.dev/ai](https://redbison.dev/ai)
196
+ - Source: [github.com/redbison-dev/redbison-tools](https://github.com/redbison-dev/redbison-tools)
197
+
198
+ MIT licensed.
package/dist/index.js ADDED
@@ -0,0 +1,610 @@
1
+ #!/usr/bin/env node
2
+ "use strict";var A=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var te=(o,n)=>{for(var c in n)A(o,c,{get:n[c],enumerable:!0})},ne=(o,n,c,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of K(n))!ee.call(o,t)&&t!==c&&A(o,t,{get:()=>n[t],enumerable:!(i=Q(n,t))||i.enumerable});return o};var re=o=>ne(A({},"__esModule",{value:!0}),o);var Te={};te(Te,{main:()=>Y});module.exports=re(Te);var M=require("node:fs");var ae={"json-format":[{key:"indent",describe:"spaces per level",type:"number",defaultValue:2}],"base64-encode":[{key:"variant",describe:"which alphabet",defaultValue:"standard",values:[{value:"standard",describe:"+ and /, padded"},{value:"url",describe:"- and _, unpadded, safe in a URL"}]}],"url-encode":[{key:"variant",describe:"how much to escape",defaultValue:"component",values:[{value:"component",describe:"escape separators too, for one parameter"},{value:"uri",describe:"keep the URL structure intact"}]}],uuid:[{key:"variant",describe:"which kind of UUID",defaultValue:"v4",values:[{value:"v4",describe:"random, the usual choice"},{value:"v7",describe:"time-ordered, sorts by creation, good as a database key"},{value:"v4-upper",describe:"uppercase"},{value:"v4-compact",describe:"32 hex characters, no hyphens"},{value:"nil",describe:"all zeroes"}]}],hash:[{key:"algorithm",describe:"digest algorithm",defaultValue:"sha256",values:[{value:"sha256",describe:"the usual choice"},{value:"sha512"},{value:"sha384"},{value:"sha1",describe:"broken for signatures, fine for checksums"},{value:"md5",describe:"broken for signatures, fine for checksums"}]},{key:"encoding",describe:"how to print the digest",defaultValue:"hex",values:[{value:"hex"},{value:"base64"}]}],hmac:[{key:"key",describe:"the secret key",required:!0},{key:"algorithm",describe:"digest algorithm",defaultValue:"sha256",values:[{value:"sha256",describe:"the usual choice"},{value:"sha512"},{value:"sha384"},{value:"sha1",describe:"broken for signatures, fine for checksums"},{value:"md5",describe:"broken for signatures, fine for checksums"}]},{key:"encoding",describe:"how to print the digest",defaultValue:"hex",values:[{value:"hex"},{value:"base64"}]}],"case-convert":[{key:"style",describe:"which case",defaultValue:"camel",values:[{value:"camel",describe:"helloWorld"},{value:"pascal",describe:"HelloWorld"},{value:"snake",describe:"hello_world"},{value:"kebab",describe:"hello-world"},{value:"constant",describe:"HELLO_WORLD"},{value:"title",describe:"Hello World"},{value:"upper"},{value:"lower"}]}],"html-beautify":[{key:"indent",describe:"indent size",type:"number"}],"xml-beautify":[{key:"indent",describe:"indent size",type:"number"}],"js-beautify":[{key:"mode",describe:"beautify = pretty-print, minify = strip comments and whitespace",values:[{value:"beautify"},{value:"minify"}],defaultValue:"beautify"},{key:"language",describe:"language of the code",values:[{value:"javascript"},{value:"typescript"},{value:"jsx"}],defaultValue:"javascript"},{key:"indent",describe:"spaces per indent level when beautifying",type:"number",defaultValue:2},{key:"brace_style",describe:"brace placement when beautifying",values:[{value:"collapse"},{value:"expand"},{value:"end-expand"},{value:"collapse,preserve-inline"}],defaultValue:"collapse"},{key:"keep_license",describe:"when minifying, keep /*!",type:"boolean",defaultValue:!0}],"css-beautify":[{key:"mode",describe:"beautify = one declaration per line, minify = smallest output",values:[{value:"beautify"},{value:"minify"}],defaultValue:"beautify"},{key:"syntax",describe:"input syntax; scss and less also accept // line comments",values:[{value:"css"},{value:"scss"},{value:"less"}],defaultValue:"css"},{key:"sort",describe:"sort declarations inside each rule alphabetically",type:"boolean",defaultValue:!1},{key:"indent",describe:"spaces per indent level when beautifying",type:"number",defaultValue:2}],"dedupe-lines":[{key:"compare",describe:"how to decide two lines are the same",defaultValue:"exact",values:[{value:"exact"},{value:"ignore-case"}]}],"lines-to-comma":[{key:"quote",describe:"how to quote each item",defaultValue:"none",values:[{value:"none"},{value:"double"},{value:"single"}]},{key:"separator",describe:"what to join with",defaultValue:", "}],"regex-test":[{key:"pattern",describe:"the regular expression",required:!0},{key:"flags",describe:"regular expression flags",defaultValue:"g"}],"number-base":[{key:"from",describe:"base of the input when it carries no prefix",defaultValue:"10"}],gitignore:[{key:"templates",describe:"comma-separated templates, such as node,macos",required:!0},{key:"extra",describe:"extra lines to append, one pattern per line"},{key:"testPaths",describe:"repository-relative paths to check (comma separated)"}],lorem:[{key:"count",describe:"how many to produce",type:"number",defaultValue:2},{key:"unit",describe:"what to count",defaultValue:"paragraphs",values:[{value:"paragraphs"},{value:"sentences"},{value:"words"}]}],password:[{key:"length",describe:"how many characters",type:"number",defaultValue:20},{key:"charset",describe:"which characters to draw from",defaultValue:"full",values:[{value:"full",describe:"letters, digits and symbols"},{value:"alphanumeric",describe:"letters and digits"},{value:"letters"}]}],"escape-characters":[{key:"format",describe:"what to escape for",defaultValue:"json",values:[{value:"json"},{value:"html"},{value:"xml"}]}],"comma-to-lines":[{key:"separator",describe:"what to split on",defaultValue:","}],"hash-compare":[{key:"b",describe:"the hash to compare against",required:!0,isText:!0}],"bcrypt-hash":[{key:"cost",describe:"bcrypt cost factor",type:"number"}],"bcrypt-verify":[{key:"hash",describe:"bcrypt hash to verify against",required:!0}],"timezone-convert":[{key:"to",describe:"target IANA timezone",required:!0}],"date-diff":[{key:"to",describe:"the second date",required:!0}],"text-diff":[{key:"b",describe:"modified text",required:!0}],"list-compare":[{key:"b",describe:"the second list",required:!0,isText:!0}],"contrast-check":[{key:"background",describe:"background color, hex",required:!0}],"css-gradient":[{key:"type",describe:"gradient type",values:[{value:"linear"},{value:"radial"}],required:!0},{key:"angle",describe:"angle in degrees for linear gradients",type:"number"},{key:"stops",describe:"color stops (comma separated)",required:!0}],"random-name":[{key:"count",describe:"number of names to generate",type:"number"}],"random-email":[{key:"count",describe:"number of emails",type:"number"},{key:"domain",describe:"fixed domain for all emails"}],"random-number":[{key:"min",describe:"minimum value",type:"number",required:!0},{key:"max",describe:"maximum value",type:"number",required:!0},{key:"count",describe:"number of values",type:"number"},{key:"mode",describe:"result type",values:[{value:"integer"},{value:"float"}]}],"ascii-art":[{key:"font",describe:"figlet font",defaultValue:"Standard"},{key:"layout",describe:"horizontal letter spacing",values:[{value:"default"},{value:"full"},{value:"fitted"},{value:"controlled smushing"},{value:"universal smushing"}],defaultValue:"default"},{key:"width",describe:"wrap at this many columns",type:"number",defaultValue:80},{key:"comment",describe:"wrap the banner in // , # , /* */ , <!-- --> or -- comment",values:[{value:"none"},{value:"slash"},{value:"hash"},{value:"block"},{value:"html"},{value:"dash"}],defaultValue:"none"}],"barcode-check":[{key:"mode",describe:"which barcode",defaultValue:"ean13",values:[{value:"ean13"},{value:"ean8"},{value:"upca"}]}],"color-palette":[{key:"rule",describe:"harmony rule",defaultValue:"analogous"},{key:"name",describe:"a name for the palette"},{key:"wheel",describe:"color wheel for hue rotation",values:[{value:"rgb"},{value:"ryb"},{value:"oklch"}]}],"cron-build":[{key:"frequency",describe:"how often to run",values:[{value:"minutes"},{value:"hourly"},{value:"daily"},{value:"weekly"},{value:"monthly"},{value:"yearly"}]},{key:"interval",describe:"for minutes: every N minutes",type:"number"},{key:"minute",describe:"minute past the hour, 0-59",type:"number"},{key:"daysOfWeek",describe:"for weekly: days as names (comma separated)"},{key:"expression",describe:"an existing five-field cron expression to explain and translate"},{key:"timezone",describe:"IANA time zone for the next run times"},{key:"count",describe:"how many upcoming runs to list",type:"number"}],"curl-to-code":[{key:"target",describe:"which language",defaultValue:"fetch",values:[{value:"fetch",describe:"JavaScript fetch"},{value:"python"},{value:"go"},{value:"php"}]}],"docker-to-compose":[{key:"direction",describe:"default run_to_compose",values:[{value:"run_to_compose"},{value:"compose_to_run"}]},{key:"project",describe:"compose project name used to prefix volume and network names in"}],"json-schema-validate":[{key:"schema",describe:"the JSON Schema as text",defaultValue:""},{key:"draft",describe:"draft for validation; auto reads $schema and defaults to 2020-12",values:[{value:"auto"},{value:"draft-06"},{value:"draft-07"},{value:"2019-09"},{value:"2020-12"}],defaultValue:"auto"},{key:"infer_draft",describe:"draft of the generated schema when inferring",values:[{value:"2020-12"},{value:"draft-07"}],defaultValue:"2020-12"},{key:"infer_required",describe:"when inferring",values:[{value:"all"},{value:"none"}],defaultValue:"all"}],morse:[{key:"direction",describe:"auto decodes when the input contains only dots, dashes, slashes",values:[{value:"auto"},{value:"encode"},{value:"decode"}],defaultValue:"auto"},{key:"wpm",describe:"character speed in words per minute",type:"number",defaultValue:20},{key:"effectiveWpm",describe:"farnsworth overall speed in wpm, lower than wpm",type:"number"}],nato:[{key:"direction",describe:"spell turns text into code words; decode turns code words back",values:[{value:"spell"},{value:"decode"}],defaultValue:"spell"},{key:"spelling",describe:"icao prints Alfa and Juliett as published; common prints Alpha",values:[{value:"icao"},{value:"common"}],defaultValue:"icao"},{key:"digits",describe:"icao says Tree, Fower, Fife, Niner; plain says Three, Four",values:[{value:"icao"},{value:"plain"}],defaultValue:"icao"},{key:"markCase",describe:"prefix each letter with Capital or Lowercase",type:"boolean",defaultValue:!1}],"password-strength":[{key:"user_inputs",describe:"optional personal words (comma separated)"}],readability:[{key:"lineBreaksEndSentences",describe:"treat each line break as a sentence end",type:"boolean",defaultValue:!0},{key:"maxSentences",describe:"how many hard sentences to list, hardest first",type:"number",defaultValue:20}],"redirect-rules":[{key:"platform",describe:"target server or host",values:[{value:"apache"},{value:"nginx"},{value:"netlify"},{value:"vercel"}],required:!0},{key:"defaultCode",describe:"status code for lines without one"},{key:"keepQuery",describe:"keep the incoming query string",type:"boolean"},{key:"forceHttps",describe:"add an HTTP to HTTPS redirect",type:"boolean"},{key:"canonicalHost",describe:"redirect the other host variant to www or to the bare domain",values:[{value:"none"},{value:"www"},{value:"apex"}]},{key:"domain",describe:"apex domain for host rules"}],"toml-convert":[{key:"from",describe:"input format",values:[{value:"toml"},{value:"json"},{value:"yaml"}],defaultValue:"toml"},{key:"to",describe:"output format",values:[{value:"toml"},{value:"json"},{value:"yaml"}],defaultValue:"json"},{key:"indent",describe:"indent for JSON and YAML output",type:"number",defaultValue:2},{key:"detect_dates",describe:"when writing TOML, turn RFC 3339 date/date-time strings into",type:"boolean",defaultValue:!1},{key:"sort_keys",describe:"sort keys alphabetically",type:"boolean",defaultValue:!1}],"utm-build":[{key:"source",describe:"utm_source"},{key:"medium",describe:"utm_medium"},{key:"campaign",describe:"utm_campaign"},{key:"term",describe:"utm_term"},{key:"content",describe:"utm_content"}],"sort-lines":[{key:"order",describe:"how to order the lines",defaultValue:"asc",values:[{value:"asc",describe:"A to Z"},{value:"desc",describe:"Z to A"},{value:"natural",describe:"file9 before file10"},{value:"length",describe:"shortest first"}]}],"number-lines":[{key:"separator",describe:"what to put after the number",defaultValue:". "}],"to-hex":[{key:"separator",describe:"what to put between bytes",defaultValue:" "}],"wrap-lines":[{key:"width",describe:"column to wrap at (minimum 20)",type:"number",defaultValue:72}]};function k(o){return ae[o]??[]}var w=class extends Error{},se=["help","version","list","json","offline"];function oe(o,n){let c=Array.from({length:o.length+1},(i,t)=>[t,...Array(n.length).fill(0)]);for(let i=0;i<=n.length;i+=1)c[0][i]=i;for(let i=1;i<=o.length;i+=1)for(let t=1;t<=n.length;t+=1)c[i][t]=Math.min(c[i-1][t]+1,c[i][t-1]+1,c[i-1][t-1]+(o[i-1]===n[t-1]?0:1));return c[o.length][n.length]}function ie(o,n){let c=n.map(i=>({c:i,d:oe(o.toLowerCase(),i.toLowerCase())})).sort((i,t)=>i.d-t.d)[0];return c&&c.d<=3?` Did you mean --${c.c}?`:""}function le(o,n){if(o.type==="boolean"){if(["true","yes","1","on"].includes(n.toLowerCase()))return!0;if(["false","no","0","off"].includes(n.toLowerCase()))return!1;throw new w(`--${o.key} takes true or false, not ${JSON.stringify(n)}.`)}if(o.type==="number"){let c=Number(n);if(!Number.isFinite(c))throw new w(`--${o.key} takes a number, not ${JSON.stringify(n)}.`);return c}if(o.values&&!o.values.some(c=>c.value===n)){let c=o.values.map(i=>i.value).join(", ");throw new w(`--${o.key} takes one of: ${c}. Got ${JSON.stringify(n)}.`)}return n}function q(o){let n={options:{},help:!1,version:!1,list:!1,json:!1,offline:!1},c=[];for(let i=0;i<o.length;i+=1){let t=o[i];if(t==="--"){c.push(...o.slice(i+1));break}if(t==="-h"){n.help=!0;continue}if(t==="-v"){n.version=!0;continue}if(t.startsWith("--")){let[r,a]=t.slice(2).split(/=(.*)/s);if(r.startsWith("no-")&&n.tool){let m=r.slice(3);if(k(n.tool).find(f=>f.key===m&&f.type==="boolean")){n.options[m]=!1;continue}}if(se.includes(r)){n[r]=!0;continue}if(r==="file"){if(n.file=a??o[++i],!n.file)throw new w("--file needs a path.");continue}if(!n.tool)throw new w(`--${r} is an option of a tool, so it comes after the tool name.`);let s=k(n.tool).find(m=>m.key===r);if(!s){let m=k(n.tool),p=m.length?`${n.tool} takes ${m.map(f=>`--${f.key}`).join(", ")}.`:`${n.tool} takes no options.`;throw new w(`Unknown option --${r}. ${p}${ie(r,m.map(f=>f.key))}`)}if(s.type==="boolean"&&a===void 0){n.options[r]=!0;continue}let u=a??o[++i];if(u===void 0)throw new w(`--${r} needs a value.`);n.options[r]=le(s,u);continue}if(t.startsWith("-")&&t.length>1&&!/^-\d/.test(t))throw new w(`Unknown flag ${t}. Options are spelled --like-this.`);n.tool?c.push(t):n.tool=t}if(c.length){let i=c.join(" ");i.startsWith("@")?n.file=i.slice(1):n.input=i}return n}function P(o,n){return k(o).filter(c=>c.required&&n[c.key]===void 0)}var x=[{id:"binary-text",title:"Binary and text",summary:"Convert the selection to or from binary.",kind:"transform",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/binary-text-converter",mcp:{name:"binary_text_convert",input:"input"}},{id:"csv-to-json",title:"CSV to JSON",summary:"Convert the selected CSV to an array of objects.",kind:"transform",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/csv-json",mcp:{name:"csv_to_json",input:"text"}},{id:"curl-to-code",title:"Convert curl to code",summary:"Turn a curl command into code.",kind:"transform",group:"Data and JSON",offline:!1,native:!1,url:"https://redbison.dev/curl-converter",mcp:{name:"curl_to_code",input:"command",args:{target:"fetch"}}},{id:"from-hex",title:"Hex to text",summary:"Read hex bytes back as text.",kind:"transform",group:"Data and JSON",offline:!0,native:!0,url:"https://redbison.dev/binary-text-converter",mcp:null},{id:"ieee754",title:"IEEE 754 float",summary:"How the selected number is stored.",kind:"inspect",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/ieee-754-float-converter",mcp:{name:"ieee754_float",input:"value"}},{id:"json-format",title:"Format JSON",summary:"Pretty-print the selected JSON with two-space indent.",kind:"transform",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/json-beautify-validate-query",mcp:{name:"json_format",input:"text",args:{indent:2}}},{id:"json-minify",title:"Minify JSON",summary:"Strip whitespace from the selected JSON.",kind:"transform",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/json-beautify-validate-query",mcp:{name:"json_format",input:"text",args:{indent:2}}},{id:"json-schema-validate",title:"Validate against JSON Schema",summary:"Check the selection against a schema.",kind:"inspect",group:"Data and JSON",offline:!1,native:!1,url:"https://redbison.dev/json-schema-validator",mcp:{name:"json_schema_validate",input:"data"}},{id:"json-to-csv",title:"JSON to CSV",summary:"Convert the selected array of objects to CSV.",kind:"transform",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/csv-json",mcp:{name:"json_to_csv",input:"json"}},{id:"json-to-query",title:"JSON to query string",summary:"Turn an object into a query string.",kind:"transform",group:"Data and JSON",offline:!0,native:!0,url:"https://redbison.dev/json-beautify-validate-query",mcp:null},{id:"json-to-yaml",title:"JSON to YAML",summary:"Convert the selected JSON to YAML.",kind:"transform",group:"Data and JSON",offline:!1,native:!1,url:"https://redbison.dev/json-yaml",mcp:{name:"json_to_yaml",input:"json"}},{id:"json-validate",title:"Validate JSON",summary:"Check the selected JSON and report the first fault.",kind:"inspect",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/json-beautify-validate-query",mcp:{name:"json_validate",input:"text"}},{id:"markdown-table",title:"Format Markdown table",summary:"Align the columns of the selected Markdown table.",kind:"transform",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/markdown-table-generator",mcp:{name:"markdown_table",input:"text"}},{id:"military-time",title:"Convert 24-hour time",summary:"Convert between 12 and 24 hour time.",kind:"inspect",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/military-time-converter",mcp:{name:"military_time_convert",input:"time"}},{id:"number-base",title:"Convert number base",summary:"Read the selected number in binary, octal, decimal and hex.",kind:"inspect",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/number-base-converter",mcp:{name:"number_base_convert",input:"value"}},{id:"query-to-json",title:"Query string to JSON",summary:"Turn a query string into an object.",kind:"transform",group:"Data and JSON",offline:!0,native:!0,url:"https://redbison.dev/json-beautify-validate-query",mcp:null},{id:"sort-json-keys",title:"Sort JSON keys",summary:"Reorder the keys of the selected JSON.",kind:"transform",group:"Data and JSON",offline:!0,native:!0,url:"https://redbison.dev/json-beautify-validate-query",mcp:null},{id:"strip-html",title:"Strip HTML tags",summary:"Remove the tags, keep the text.",kind:"transform",group:"Data and JSON",offline:!0,native:!0,url:"https://redbison.dev/html-to-markdown-converter",mcp:null},{id:"to-hex",title:"Text to hex",summary:"Show the selection as hex bytes.",kind:"transform",group:"Data and JSON",offline:!0,native:!0,url:"https://redbison.dev/binary-text-converter",mcp:null},{id:"toml-convert",title:"Convert TOML",summary:"TOML to and from JSON or YAML.",kind:"transform",group:"Data and JSON",offline:!1,native:!1,url:"https://redbison.dev/toml-converter",mcp:{name:"toml_convert",input:"text"}},{id:"tsv-parse",title:"Parse TSV",summary:"Turn the selected tab-separated text into JSON.",kind:"transform",group:"Data and JSON",offline:!0,native:!1,url:"https://redbison.dev/tsv-parser",mcp:{name:"tsv_parse",input:"text"}},{id:"yaml-to-json",title:"YAML to JSON",summary:"Convert the selected YAML to JSON.",kind:"transform",group:"Data and JSON",offline:!1,native:!1,url:"https://redbison.dev/json-yaml",mcp:{name:"yaml_to_json",input:"yaml"}},{id:"ascii-art",title:"ASCII art banner",summary:"Turn the selection into an ASCII banner.",kind:"transform",group:"Text",offline:!1,native:!1,url:"https://redbison.dev/ascii-art-text-generator",mcp:{name:"ascii_art_text",input:"text",args:{font:"Standard"}}},{id:"case-convert",title:"Convert case",summary:"camelCase, snake_case, kebab-case, PascalCase and more.",kind:"transform",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/case-converter",mcp:{name:"case_convert",input:"text",args:{style:"snake"}}},{id:"char-frequency",title:"Character frequency",summary:"Count each character in the selection.",kind:"inspect",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/word-counter",mcp:null},{id:"comma-to-lines",title:"Comma-separated to lines",summary:"Split the selection on commas, one item per line.",kind:"transform",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/comma-to-lines",mcp:{name:"comma_to_lines",input:"text"}},{id:"dedupe-lines",title:"Remove duplicate lines",summary:"Drop repeated lines from the selection.",kind:"transform",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/remove-duplicate-lines",mcp:{name:"remove_duplicate_lines",input:"text"}},{id:"escape-characters",title:"Escape characters",summary:"Escape the selection for a string literal.",kind:"transform",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/escape-characters",mcp:{name:"escape_characters",input:"text",args:{mode:"escape",format:"json"}}},{id:"extract-emails",title:"Extract email addresses",summary:"Pull every address out of the selection.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/online-text-processor",mcp:null},{id:"extract-numbers",title:"Extract numbers",summary:"Pull every number out of the selection.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/online-text-processor",mcp:null},{id:"extract-urls",title:"Extract URLs",summary:"Pull every URL out of the selection.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/online-text-processor",mcp:null},{id:"find-duplicates",title:"Find duplicate lines",summary:"List the lines that appear more than once.",kind:"inspect",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/find-duplicate-entries",mcp:{name:"find_duplicate_entries",input:"text"}},{id:"html-escape",title:"Escape for HTML",summary:"Make the selection safe inside HTML.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/escape-characters",mcp:null},{id:"html-unescape",title:"Unescape HTML entities",summary:"Turn entities back into characters.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/escape-characters",mcp:null},{id:"lines-to-comma",title:"Lines to comma-separated",summary:"Join the selected lines with commas.",kind:"transform",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/lines-to-comma",mcp:{name:"lines_to_comma",input:"text"}},{id:"morse",title:"Morse code",summary:"Convert the selection to or from Morse.",kind:"transform",group:"Text",offline:!1,native:!1,url:"https://redbison.dev/morse-code-translator",mcp:{name:"morse_code",input:"input"}},{id:"nato",title:"NATO phonetic",summary:"Spell the selection in the NATO alphabet.",kind:"transform",group:"Text",offline:!1,native:!1,url:"https://redbison.dev/nato-phonetic-alphabet",mcp:{name:"nato_phonetic",input:"text"}},{id:"number-lines",title:"Number the lines",summary:"Prefix each line with its number.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/online-text-processor",mcp:null},{id:"readability",title:"Check readability",summary:"Reading grade and sentence length.",kind:"inspect",group:"Text",offline:!1,native:!1,url:"https://redbison.dev/readability-checker",mcp:{name:"readability",input:"text"}},{id:"regex-test",title:"Test regular expression",summary:"Run a pattern you are prompted for against the selection.",kind:"inspect",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/regex-tester",mcp:{name:"regex_test",input:"text"}},{id:"remove-empty-lines",title:"Remove empty lines",summary:"Drop blank lines from the selection.",kind:"transform",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/remove-empty-lines",mcp:{name:"remove_empty_lines",input:"text"}},{id:"remove-extra-spaces",title:"Collapse extra spaces",summary:"Reduce runs of whitespace to one space.",kind:"transform",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/remove-extra-spaces",mcp:{name:"remove_extra_spaces",input:"text"}},{id:"reverse-lines",title:"Reverse line order",summary:"Put the selected lines in reverse order.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/online-text-processor",mcp:null},{id:"reverse-text",title:"Reverse the text",summary:"Reverse the selection character by character.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/online-text-processor",mcp:null},{id:"rot13",title:"ROT13",summary:"Rotate the letters by thirteen.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/escape-characters",mcp:null},{id:"shuffle-lines",title:"Shuffle lines",summary:"Put the selected lines in random order.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/online-text-processor",mcp:null},{id:"sort-lines",title:"Sort lines",summary:"Sort the selected lines.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/online-text-processor",mcp:null},{id:"trim-lines",title:"Trim each line",summary:"Remove leading and trailing whitespace.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/remove-extra-spaces",mcp:null},{id:"unique-words",title:"List unique words",summary:"Every distinct word, with counts.",kind:"inspect",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/word-counter",mcp:null},{id:"url-decode",title:"URL decode",summary:"Decode percent-escapes in the selection.",kind:"transform",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/escape-characters",mcp:{name:"url_decode",input:"text"}},{id:"url-encode",title:"URL encode",summary:"Percent-encode the selection.",kind:"transform",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/escape-characters",mcp:{name:"url_encode",input:"text"}},{id:"word-count",title:"Count words",summary:"Words, characters, lines and reading time for the selection.",kind:"inspect",group:"Text",offline:!0,native:!1,url:"https://redbison.dev/word-counter",mcp:{name:"word_count",input:"text"}},{id:"wrap-lines",title:"Wrap lines",summary:"Wrap the selection at a width.",kind:"transform",group:"Text",offline:!0,native:!0,url:"https://redbison.dev/online-text-processor",mcp:null},{id:"base64-decode",title:"Base64 decode",summary:"Decode the selected Base64.",kind:"transform",group:"Encoding and hashing",offline:!0,native:!1,url:"https://redbison.dev/base64",mcp:{name:"base64_decode",input:"text"}},{id:"base64-encode",title:"Base64 encode",summary:"Encode the selection as Base64.",kind:"transform",group:"Encoding and hashing",offline:!0,native:!1,url:"https://redbison.dev/base64",mcp:{name:"base64_encode",input:"text"}},{id:"bcrypt-hash",title:"bcrypt hash",summary:"Hash the selection with bcrypt.",kind:"inspect",group:"Encoding and hashing",offline:!1,native:!1,url:"https://redbison.dev/bcrypt-hash-generator",mcp:{name:"bcrypt_hash",input:"password"}},{id:"bcrypt-verify",title:"Verify a bcrypt hash",summary:"Check a password against a bcrypt hash.",kind:"inspect",group:"Encoding and hashing",offline:!1,native:!1,url:"https://redbison.dev/bcrypt-hash-generator",mcp:{name:"bcrypt_verify",input:"password"}},{id:"hash",title:"Hash the selection",summary:"MD5, SHA-1, SHA-256 and SHA-512 of the selection.",kind:"inspect",group:"Encoding and hashing",offline:!0,native:!1,url:"https://redbison.dev/hash-generator",mcp:{name:"hash",input:"text",args:{algorithm:"sha256"}}},{id:"hash-compare",title:"Compare two hashes",summary:"Check whether two hashes match.",kind:"inspect",group:"Encoding and hashing",offline:!0,native:!1,url:"https://redbison.dev/hash-file-verifier",mcp:{name:"hash_compare",input:"a"}},{id:"hmac",title:"HMAC signature",summary:"Sign the selection with a key you are prompted for.",kind:"inspect",group:"Encoding and hashing",offline:!0,native:!1,url:"https://redbison.dev/hmac-generator",mcp:{name:"hmac",input:"message"}},{id:"jwt-decode",title:"Decode JWT",summary:"Show the header and claims of the selected token.",kind:"inspect",group:"Encoding and hashing",offline:!0,native:!1,url:"https://redbison.dev/jwt-decoder",mcp:{name:"jwt_decode",input:"token"}},{id:"password",title:"Insert password",summary:"Insert a strong random password at the cursor.",kind:"insert",group:"Encoding and hashing",offline:!0,native:!1,url:"https://redbison.dev/password-generator",mcp:{name:"password_generate",args:{length:20}}},{id:"password-strength",title:"Check password strength",summary:"How strong is the selected password?",kind:"inspect",group:"Encoding and hashing",offline:!1,native:!1,url:"https://redbison.dev/password-strength-checker",mcp:{name:"password_strength",input:"password"}},{id:"css-beautify",title:"Format CSS",summary:"Indent the selected CSS.",kind:"transform",group:"Formatters",offline:!1,native:!1,url:"https://redbison.dev/css-beautifier",mcp:{name:"css_beautify",input:"css"}},{id:"html-beautify",title:"Format HTML",summary:"Indent the selected HTML.",kind:"transform",group:"Formatters",offline:!1,native:!1,url:"https://redbison.dev/html-beautify",mcp:{name:"html_beautify",input:"html"}},{id:"js-beautify",title:"Format JavaScript",summary:"Indent the selected JavaScript.",kind:"transform",group:"Formatters",offline:!1,native:!1,url:"https://redbison.dev/javascript-beautifier",mcp:{name:"js_beautify",input:"code"}},{id:"sql-beautify",title:"Format SQL",summary:"Indent and align the selected SQL.",kind:"transform",group:"Formatters",offline:!1,native:!1,url:"https://redbison.dev/sql-beautify",mcp:{name:"sql_beautify",input:"sql"}},{id:"xml-beautify",title:"Format XML",summary:"Indent the selected XML.",kind:"transform",group:"Formatters",offline:!1,native:!1,url:"https://redbison.dev/xml-beautify",mcp:{name:"xml_beautify",input:"xml"}},{id:"yaml-beautify",title:"Format YAML",summary:"Re-indent the selected YAML.",kind:"transform",group:"Formatters",offline:!1,native:!1,url:"https://redbison.dev/yaml-beautify",mcp:{name:"yaml_beautify",input:"yaml"}},{id:"chmod",title:"Convert a chmod mode",summary:"Read the selected mode both ways.",kind:"inspect",group:"Web and network",offline:!0,native:!1,url:"https://redbison.dev/chmod-calculator",mcp:{name:"chmod_convert",input:"mode"}},{id:"cron",title:"Explain cron expression",summary:"Describe the selected cron expression in words.",kind:"inspect",group:"Web and network",offline:!1,native:!1,url:"https://redbison.dev/cron-expression-generator",mcp:{name:"cron_validate",input:"expression"}},{id:"cron-build",title:"Build a cron expression",summary:"Write a cron expression from plain choices.",kind:"insert",group:"Web and network",offline:!1,native:!1,url:"https://redbison.dev/cron-expression-generator",mcp:{name:"cron_build"}},{id:"docker-to-compose",title:"docker run to Compose",summary:"Turn a docker run command into Compose.",kind:"transform",group:"Web and network",offline:!1,native:!1,url:"https://redbison.dev/docker-run-to-compose",mcp:{name:"docker_run_to_compose",input:"input"}},{id:"gitignore",title:"Insert .gitignore",summary:"Insert a .gitignore for the stacks you pick.",kind:"insert",group:"Web and network",offline:!1,native:!1,url:"https://redbison.dev/gitignore-generator",mcp:{name:"gitignore_generate",args:{templates:["node"]}}},{id:"http-status",title:"Look up HTTP status",summary:"What the selected status code means.",kind:"inspect",group:"Web and network",offline:!0,native:!1,url:"https://redbison.dev/http-status-codes",mcp:{name:"http_status",input:"query"}},{id:"ip-convert",title:"Convert an IP address",summary:"Read the selected address in every notation.",kind:"inspect",group:"Web and network",offline:!0,native:!1,url:"https://redbison.dev/ip-converter",mcp:{name:"ip_convert",input:"value"}},{id:"mime-lookup",title:"Look up MIME type",summary:"The media type for the selected extension or filename.",kind:"inspect",group:"Web and network",offline:!0,native:!1,url:"https://redbison.dev/mime-type-lookup",mcp:{name:"mime_lookup",input:"query"}},{id:"redirect-rules",title:"Generate redirect rules",summary:"Write redirects for your platform.",kind:"transform",group:"Web and network",offline:!1,native:!1,url:"https://redbison.dev/redirect-generator",mcp:{name:"redirect_rules",input:"rules"}},{id:"subnet",title:"Subnet calculator",summary:"Work out the range for the selected CIDR.",kind:"inspect",group:"Web and network",offline:!0,native:!1,url:"https://redbison.dev/subnet-calculator",mcp:{name:"subnet_calculator",input:"cidr"}},{id:"user-agent",title:"Parse a user agent",summary:"What the selected user agent string means.",kind:"inspect",group:"Web and network",offline:!1,native:!1,url:"https://redbison.dev/user-agent-parser",mcp:{name:"user_agent_parse",input:"userAgent"}},{id:"utm-build",title:"Build a UTM link",summary:"Add campaign parameters to a URL.",kind:"transform",group:"Web and network",offline:!0,native:!1,url:"https://redbison.dev/utm-builder",mcp:{name:"utm_build",input:"url"}},{id:"barcode-check",title:"Barcode check digit",summary:"Work out or verify a check digit.",kind:"inspect",group:"Generators",offline:!1,native:!1,url:"https://redbison.dev/barcode-generator",mcp:{name:"barcode_check_digit",input:"code",args:{mode:"auto"}}},{id:"lorem",title:"Insert placeholder text",summary:"Insert lorem ipsum at the cursor.",kind:"insert",group:"Generators",offline:!0,native:!1,url:"https://redbison.dev/lorem-generator",mcp:{name:"lorem_ipsum",args:{count:2,unit:"paragraphs"}}},{id:"random-email",title:"Insert random emails",summary:"Insert test email addresses.",kind:"insert",group:"Generators",offline:!1,native:!1,url:"https://redbison.dev/random-email-generator",mcp:{name:"random_email"}},{id:"random-name",title:"Insert random names",summary:"Insert plausible names for test data.",kind:"insert",group:"Generators",offline:!1,native:!1,url:"https://redbison.dev/random-name-generator",mcp:{name:"random_name"}},{id:"random-number",title:"Insert random numbers",summary:"Insert numbers in a range.",kind:"insert",group:"Generators",offline:!1,native:!1,url:"https://redbison.dev/random-number-generator",mcp:{name:"random_number"}},{id:"remove-accents",title:"Remove accents",summary:"Fold accented letters to plain ASCII.",kind:"transform",group:"Generators",offline:!0,native:!0,url:"https://redbison.dev/url-slug-generator",mcp:null},{id:"slugify",title:"Slugify",summary:"Turn the selection into a URL slug.",kind:"transform",group:"Generators",offline:!0,native:!1,url:"https://redbison.dev/url-slug-generator",mcp:{name:"slugify",input:"text"}},{id:"url-parse",title:"Parse a URL",summary:"Break the selected URL into its parts.",kind:"inspect",group:"Generators",offline:!0,native:!0,url:"https://redbison.dev/url-slug-generator",mcp:null},{id:"uuid",title:"Insert UUID",summary:"Insert a random v4 UUID at the cursor.",kind:"insert",group:"Generators",offline:!0,native:!1,url:"https://redbison.dev/uuid-generator",mcp:{name:"uuid_generate",args:{count:1}}},{id:"date-diff",title:"Difference between dates",summary:"How far apart the selected dates are.",kind:"inspect",group:"Time and numbers",offline:!0,native:!1,url:"https://redbison.dev/date-diff",mcp:{name:"date_diff",input:"from"}},{id:"epoch",title:"Convert timestamp",summary:"Read the selected epoch or date in every common form.",kind:"inspect",group:"Time and numbers",offline:!0,native:!1,url:"https://redbison.dev/epoch-converter",mcp:{name:"epoch_convert",input:"value"}},{id:"number-to-words",title:"Number to words",summary:"Write the selected number out in words.",kind:"transform",group:"Time and numbers",offline:!1,native:!1,url:"https://redbison.dev/number-to-words-converter",mcp:{name:"number_to_words",input:"value"}},{id:"timezone-convert",title:"Convert a timezone",summary:"Move the selected timestamp to another zone.",kind:"inspect",group:"Time and numbers",offline:!1,native:!1,url:"https://redbison.dev/timezone-converter",mcp:{name:"timezone_convert",input:"timestamp"}},{id:"list-compare",title:"Compare two lists",summary:"What is in one list and not the other.",kind:"inspect",group:"Comparing",offline:!0,native:!1,url:"https://redbison.dev/list-comparison",mcp:{name:"list_compare",input:"a"}},{id:"text-diff",title:"Diff against the clipboard",summary:"Compare the selection with your clipboard.",kind:"inspect",group:"Comparing",offline:!1,native:!1,url:"https://redbison.dev/online-diff-tool",mcp:{name:"text_diff",input:"a"}},{id:"color-convert",title:"Convert a colour",summary:"Read the selected colour in every format.",kind:"inspect",group:"Colour and design",offline:!1,native:!1,url:"https://redbison.dev/hex-to-rgb-converter",mcp:{name:"color_convert",input:"color"}},{id:"color-palette",title:"Build a colour palette",summary:"Generate a palette from one colour.",kind:"inspect",group:"Colour and design",offline:!1,native:!1,url:"https://redbison.dev/color-palette-generator",mcp:{name:"color_palette",input:"base",args:{rule:"complementary",wheel:"oklch",name:"palette"}}},{id:"contrast-check",title:"Check colour contrast",summary:"Does this pair meet WCAG contrast?",kind:"inspect",group:"Colour and design",offline:!1,native:!1,url:"https://redbison.dev/contrast-checker",mcp:{name:"contrast_check",input:"foreground"}},{id:"css-gradient",title:"Build a CSS gradient",summary:"Generate a gradient from colour stops.",kind:"insert",group:"Colour and design",offline:!1,native:!1,url:"https://redbison.dev/css-gradient-generator",mcp:{name:"css_gradient"}}],$=o=>x.find(n=>n.id===o);var E={"binary-text":{input:"Hi",output:"01001000 01101001",args:{}},"csv-to-json":{input:`name,role
3
+ Jane,dev
4
+ Sam,ops`,output:`[
5
+ {
6
+ "name": "Jane",
7
+ "role": "dev"
8
+ },
9
+ {
10
+ "name": "Sam",
11
+ "role": "ops"
12
+ }
13
+ ]`,args:{}},"curl-to-code":{input:`curl -X POST https://api.example.com/v1/items -H 'Content-Type: application/json' -d '{"a":1}'`,output:`const response = await fetch("https://api.example.com/v1/items", {
14
+ method: "POST",
15
+ headers: {
16
+ "Content-Type": "application/json"
17
+ },
18
+ body: JSON.stringify({
19
+ "a": 1
20
+ })
21
+ });
22
+ const data = await response.text();
23
+ console.log(response.status, data);
24
+
25
+ Notes:
26
+ - fetch follows redirects by default; curl only does with -L. Add redirect: "manual" if that
27
+ \u2026`,args:{}},"from-hex":{input:"52 65 64",output:"Red",args:{}},ieee754:{input:"0.1",output:`{
28
+ "format": "binary32",
29
+ "bits": "00111101110011001100110011001101",
30
+ "hex": "3DCCCCCD",
31
+ "bytesBigEndian": "3D CC CC CD",
32
+ "bytesLittleEndian": "CD CC CC 3D",
33
+ "sign": 0,
34
+ "exponentBits": "01111011",
35
+ "fractionBits": "10011001100110011001101",
36
+ "biasedExponent": 123,
37
+ "exponent": -4,
38
+ "class": "normal",
39
+ "formula": "(-1)^0 x 1.10011001100110011
40
+ \u2026`,args:{}},"json-format":{input:'{"name":"RedBison","tools":35,"offline":true}',output:`{
41
+ "name": "RedBison",
42
+ "tools": 35,
43
+ "offline": true
44
+ }`,args:{}},"json-minify":{input:`{
45
+ "name": "RedBison",
46
+ "tools": 35
47
+ }`,output:'{"name":"RedBison","tools":35}',args:{}},"json-schema-validate":{input:'{"a":1}',output:"Valid.",args:{schema:'{"type":"object","required":["a"]}'}},"json-to-csv":{input:'[{"name":"Jane","role":"dev"},{"name":"Sam","role":"ops"}]',output:`name,role
48
+ Jane,dev
49
+ Sam,ops`,args:{}},"json-to-query":{input:'{"page":2,"q":"red bison"}',output:"page=2&q=red+bison",args:{}},"json-to-yaml":{input:'{"service":"api","ports":[80,443]}',output:`service: api
50
+ ports:
51
+ - 80
52
+ - 443`,args:{}},"json-validate":{input:'{"name":"RedBison","tools":35}',output:'{"valid":true}',args:{}},"markdown-table":{input:`name,role
53
+ Jane,dev
54
+ Sam,ops`,output:`| name | role |
55
+ | ---- | ---- |
56
+ | Jane | dev |
57
+ | Sam | ops |`,args:{}},"military-time":{input:"14:30",output:'1430 = 2:30 PM ("fourteen thirty")',args:{}},"number-base":{input:"255",output:`{
58
+ "fromBase": 10,
59
+ "fraction": "255",
60
+ "binary": "11111111",
61
+ "octal": "377",
62
+ "decimal": "255",
63
+ "hex": "FF",
64
+ "target": null,
65
+ "bitLength": 8,
66
+ "twosComplement": null,
67
+ "warnings": []
68
+ }`,args:{}},"query-to-json":{input:"?page=2&q=red+bison&tag=a&tag=b",output:`{
69
+ "page": "2",
70
+ "q": "red bison",
71
+ "tag": [
72
+ "a",
73
+ "b"
74
+ ]
75
+ }`,args:{}},"sort-json-keys":{input:'{"name":"RedBison","id":1,"active":true}',output:`{
76
+ "active": true,
77
+ "id": 1,
78
+ "name": "RedBison"
79
+ }`,args:{}},"strip-html":{input:"<p>Hello <b>world</b></p>",output:"Hello world",args:{}},"to-hex":{input:"RedBison",output:"52 65 64 42 69 73 6f 6e",args:{}},"toml-convert":{input:`title = "demo"
80
+ [owner]
81
+ name = "Jane"`,output:`{
82
+ "title": "demo",
83
+ "owner": {
84
+ "name": "Jane"
85
+ }
86
+ }`,args:{from:"toml",to:"json"}},"tsv-parse":{input:`name role
87
+ Jane dev`,output:`[
88
+ {
89
+ "name": "Jane",
90
+ "role": "dev"
91
+ }
92
+ ]`,args:{}},"yaml-to-json":{input:`service: api
93
+ ports:
94
+ - 80
95
+ - 443`,output:`{
96
+ "service": "api",
97
+ "ports": [
98
+ 80,
99
+ 443
100
+ ]
101
+ }`,args:{}},"ascii-art":{input:"RB",output:` ____ ____
102
+ | _ \\| __ )
103
+ | |_) | _ \\
104
+ | _ <| |_) |
105
+ |_| \\_\\____/`,args:{}},"case-convert":{input:"red bison tools",output:"redBisonTools",args:{style:"camel"}},"char-frequency":{input:"hello",output:` 2 l
106
+ 1 h
107
+ 1 e
108
+ 1 o`,args:{}},"comma-to-lines":{input:"alpha, beta, gamma",output:`alpha
109
+ beta
110
+ gamma`,args:{}},"dedupe-lines":{input:`alpha
111
+ beta
112
+ alpha
113
+ gamma
114
+ beta`,output:`alpha
115
+ beta
116
+ gamma`,args:{}},"escape-characters":{input:`He said "hi"
117
+ and left`,output:'He said \\"hi\\"\\nand left',args:{}},"extract-emails":{input:"contact a@b.com or c@d.org",output:`a@b.com
118
+ c@d.org`,args:{}},"extract-numbers":{input:"cost 42 and -3.5 units",output:`42
119
+ -3.5`,args:{}},"extract-urls":{input:"see https://redbison.dev and https://example.com today",output:`https://redbison.dev
120
+ https://example.com`,args:{}},"find-duplicates":{input:`a
121
+ b
122
+ a
123
+ c
124
+ b`,output:`{
125
+ "duplicateCount": 2,
126
+ "entries": [
127
+ {
128
+ "value": "a",
129
+ "count": 2
130
+ },
131
+ {
132
+ "value": "b",
133
+ "count": 2
134
+ }
135
+ ]
136
+ }`,args:{}},"html-escape":{input:'<a href="x">Tom & Jerry</a>',output:"&lt;a href=&quot;x&quot;&gt;Tom &amp; Jerry&lt;/a&gt;",args:{}},"html-unescape":{input:"&lt;b&gt;bold&lt;/b&gt; &amp; more",output:"<b>bold</b> & more",args:{}},"lines-to-comma":{input:`alpha
137
+ beta
138
+ gamma`,output:"alpha, beta, gamma",args:{}},morse:{input:"SOS",output:"... --- ...",args:{}},nato:{input:"RB7",output:"Romeo Bravo Seven",args:{}},"number-lines":{input:`alpha
139
+ beta
140
+ gamma`,output:`1. alpha
141
+ 2. beta
142
+ 3. gamma`,args:{}},readability:{input:"The cat sat on the mat. It was a very short sentence.",output:`{
143
+ "counts": {
144
+ "sentences": 2,
145
+ "words": 12,
146
+ "syllables": 14,
147
+ "polysyllables": 0,
148
+ "complexWords": 0
149
+ },
150
+ "wordsPerSentence": 6,
151
+ "syllablesPerWord": 1.17,
152
+ "fleschReadingEase": 102,
153
+ "fleschBand": "Very easy (5th grade)",
154
+ "fleschKincaidGrade": 0.5,
155
+ "gunningFog": 2.4,
156
+ "smog": 3.1,
157
+ "smogShortSample": true,
158
+ "colemanLiau": -1.1
159
+ \u2026`,args:{}},"regex-test":{input:"order-123 and order-456",output:`{
160
+ "pattern": "order-(\\\\d+)",
161
+ "flags": "g",
162
+ "count": 2,
163
+ "matches": [
164
+ {
165
+ "match": "order-123",
166
+ "index": 0,
167
+ "groups": [
168
+ "123"
169
+ ]
170
+ },
171
+ {
172
+ "match": "order-456",
173
+ "index": 14,
174
+ "groups": [
175
+ "456"
176
+ ]
177
+ }
178
+ ]
179
+ }`,args:{pattern:"order-(\\d+)"}},"remove-empty-lines":{input:`a
180
+
181
+
182
+ b
183
+
184
+ c`,output:`a
185
+ b
186
+ c`,args:{}},"remove-extra-spaces":{input:"too many spaces",output:"too many spaces",args:{}},"reverse-lines":{input:`first
187
+ second
188
+ third`,output:`third
189
+ second
190
+ first`,args:{}},"reverse-text":{input:"RedBison",output:"nosiBdeR",args:{}},rot13:{input:"Hello, World!",output:"Uryyb, Jbeyq!",args:{}},"shuffle-lines":{input:`a
191
+ b
192
+ c
193
+ d`,output:`d
194
+ c
195
+ b
196
+ a`,args:{}},"sort-lines":{input:`cherry
197
+ apple
198
+ banana`,output:`apple
199
+ banana
200
+ cherry`,args:{order:"asc"}},"trim-lines":{input:` padded
201
+ lines `,output:`padded
202
+ lines`,args:{}},"unique-words":{input:"the cat and the hat and the bat",output:` 3 the
203
+ 2 and
204
+ 1 bat
205
+ 1 cat
206
+ 1 hat`,args:{}},"url-decode":{input:"q=red%20bison%26page%3D2",output:"q=red bison&page=2",args:{}},"url-encode":{input:"q=red bison&page=2",output:"q%3Dred%20bison%26page%3D2",args:{}},"word-count":{input:"The quick brown fox jumps over the lazy dog.",output:`{
207
+ "words": 9,
208
+ "characters": 44,
209
+ "charactersNoSpaces": 36,
210
+ "sentences": 1,
211
+ "paragraphs": 1,
212
+ "lines": 1,
213
+ "uniqueWords": 8,
214
+ "utf8Bytes": 44,
215
+ "averageWordLength": 3.89,
216
+ "averageSentenceLength": 9,
217
+ "readingTime": "2 s",
218
+ "readingSeconds": 2,
219
+ "speakingTime": "4 s",
220
+ "speakingSeconds": 4,
221
+ "topWords": [
222
+ {
223
+ "word": "brown",
224
+ "count": 1,
225
+ "percent": 11.11
226
+ }
227
+ \u2026`,args:{}},"wrap-lines":{input:"the quick brown fox jumps over the lazy dog",output:`the quick brown fox
228
+ jumps over the lazy
229
+ dog`,args:{width:20}},"base64-decode":{input:"UmVkQmlzb24gVG9vbHM=",output:"RedBison Tools",args:{}},"base64-encode":{input:"RedBison Tools",output:"UmVkQmlzb24gVG9vbHM=",args:{}},"bcrypt-hash":{input:"hunter2",output:"$2b$10$A9yLyXs.D0r4DEJ9ZjB7u.z5EqxFRhxNDPnVU32.FUEZE4ZHLL6n6",args:{cost:10}},"bcrypt-verify":{input:"hunter2",output:'{"match":false}',args:{hash:"$2b$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy"}},hash:{input:"RedBison",output:"548590114f517e1198b39913e4bb9b0f0cde7ebafc76cf853b5b9597bb9bf902",args:{algorithm:"sha256"}},"hash-compare":{input:"abc123",output:`{
230
+ "algorithm": "sha256",
231
+ "hashA": "6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090",
232
+ "hashB": "6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090",
233
+ "match": true
234
+ }`,args:{b:"abc123",algorithm:"sha256"}},hmac:{input:'{"event":"ping"}',output:`HMAC-SHA-256 (hex): 8c44ed640fe88fac4c6d49ce441374f60a2e8d573cca27e78d375b332b7cf587
235
+ Base64: jETtZA/oj6xMbUnORBN09goujVc8yifnjTdbMyt89Yc=`,args:{key:"whsec_example"}},"jwt-decode":{input:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkphbmUgRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.abc",output:`{
236
+ "header": {
237
+ "alg": "HS256",
238
+ "typ": "JWT"
239
+ },
240
+ "payload": {
241
+ "sub": "1234567890",
242
+ "name": "Jane Doe",
243
+ "iat": 1516239022
244
+ },
245
+ "signature": "abc",
246
+ "note": "Signature is NOT verified. This tool only decodes JWT contents."
247
+ }`,args:{}},password:{input:"",output:"wwNe4lRxtWSRLsGkqteY",args:{}},"password-strength":{input:"correct horse battery staple",output:"Very strong (score 4/4), about 10^20.2 guesses (67.0 bits). Offline fast-hash attack: 5 centuries.",args:{}},"css-beautify":{input:".btn{color:red;padding:4px 8px}",output:`.btn {
248
+ color: red;
249
+ padding: 4px 8px
250
+ }
251
+ `,args:{}},"html-beautify":{input:"<div><p>Hello</p><span>World</span></div>",output:`<div>
252
+ <p>
253
+ Hello
254
+ </p>
255
+ <span>
256
+ World
257
+ </span>
258
+ </div>`,args:{}},"js-beautify":{input:"function add(a,b){return a+b}",output:`function add(a, b) {
259
+ return a + b
260
+ }
261
+ `,args:{}},"sql-beautify":{input:"select id,name from users where active=1 order by name",output:`SELECT id,name
262
+ FROM users
263
+ WHERE active=1
264
+ ORDER BY name`,args:{}},"xml-beautify":{input:'<config><item id="1"/><item id="2"/></config>',output:`<config>
265
+ <item id="1"/>
266
+ <item id="2"/>
267
+ </config>`,args:{}},"yaml-beautify":{input:`a: 1
268
+ b: [1,2]`,output:`a: 1
269
+ b: [1,2]`,args:{}},chmod:{input:"755",output:`{
270
+ "octal": "755",
271
+ "symbolic": "rwxr-xr-x",
272
+ "ls": "-rwxr-xr-x",
273
+ "description": [
274
+ "Owner: read, write, execute",
275
+ "Group: read, execute",
276
+ "Others: read, execute"
277
+ ],
278
+ "warnings": [],
279
+ "command": "chmod 755 file",
280
+ "symbolicArg": "u=rwx,g=rx,o=rx",
281
+ "umaskDefaults": {
282
+ "umask": "022",
283
+ "newFile": "644",
284
+ "newDirectory": "755"
285
+ \u2026`,args:{}},cron:{input:"0 9 * * 1-5",output:`{
286
+ "valid": true,
287
+ "expression": "0 9 * * 1-5",
288
+ "summary": "minute=0, hour=9, day-of-month=*, month=*, day-of-week=1-5"
289
+ }`,args:{}},"cron-build":{input:"",output:`{
290
+ "expression": "0 9 * * 1",
291
+ "description": "At 09:00, only on Monday",
292
+ "nextRuns": [
293
+ "Mon, 23 Nov 2026, 09:00",
294
+ "Mon, 30 Nov 2026, 09:00",
295
+ "Mon, 07 Dec 2026, 09:00",
296
+ "Mon, 14 Dec 2026, 09:00",
297
+ "Mon, 21 Dec 2026, 09:00"
298
+ ],
299
+ "timezone": "UTC",
300
+ "platforms": [
301
+ {
302
+ "id": "unix",
303
+ "name": "crontab (Linux, macOS, Vixie,
304
+ \u2026`,args:{frequency:"weekly",daysOfWeek:["mon"],hours:[9],minute:0}},"docker-to-compose":{input:"docker run -d -p 8080:80 --name web nginx:alpine",output:`{
305
+ "compose": "services:\\n web:\\n image: nginx:alpine\\n container_name: web\\n ports:\\n - 8080:80\\n",
306
+ "services": [
307
+ "web"
308
+ ],
309
+ "warnings": []
310
+ }`,args:{}},gitignore:{input:"",output:`{
311
+ "content": "# Generated with the RedBison .gitignore Generator (templates based on github/gitignore, CC0)\\n\\n### Node.js ###\\n# Logs\\nlogs\\n*.log\\nnpm-debug.log*\\nyarn-debug.log*\\nyarn-error.log*\\npnpm-debug.log*\\nlerna-debug.log*\\n\\n# Dependencies\\nnode_modules/\\njspm_packages/\\n.pnpm-store/\\n\\n# Yarn Berry (keep .yarn/releases, plugins and patches if you commit them)\\n.yarn/cache\\n.yarn/unpl
312
+ \u2026`,args:{templates:["node"]}},"http-status":{input:"429",output:`{
313
+ "query": "429",
314
+ "count": 1,
315
+ "results": [
316
+ {
317
+ "code": 429,
318
+ "name": "Too Many Requests",
319
+ "class": "4xx",
320
+ "spec": "RFC 6585 \xA74",
321
+ "official": true,
322
+ "deprecated": false,
323
+ "cacheableByDefault": false,
324
+ "summary": "The client sent too many requests in a given time (rate limiting).",
325
+ "usage": "Include Retry-After with seconds or a date. Clients
326
+ \u2026`,args:{}},"ip-convert":{input:"192.168.1.1",output:`{
327
+ "decimal": "192.168.1.1",
328
+ "integer": 3232235777,
329
+ "hex": "0xC0A80101",
330
+ "binary": "11000000101010000000000100000001"
331
+ }`,args:{}},"mime-lookup":{input:".webp",output:`{
332
+ "query": ".webp",
333
+ "matchedBy": "extension",
334
+ "count": 1,
335
+ "results": [
336
+ {
337
+ "mime": "image/webp",
338
+ "extensions": [
339
+ "webp"
340
+ ],
341
+ "name": "WebP image",
342
+ "category": "image",
343
+ "registered": true,
344
+ "aliases": [],
345
+ "spec": "RFC 9649",
346
+ "note": null,
347
+ "contentType": "image/webp"
348
+ }
349
+ ],
350
+ "fallback": null
351
+ }`,args:{}},"redirect-rules":{input:"/old /new",output:`{
352
+ "platform": "nginx",
353
+ "config": "# Inside the server { } block for your site\\n\\nlocation = /old {\\n return 301 /new$is_args$args;\\n}\\nlocation = /old/ {\\n return 301 /new$is_args$args;\\n}\\n",
354
+ "ruleCount": 1,
355
+ "issues": [],
356
+ "notes": [
357
+ "\\"location =\\" is an exact match and is checked before regex locations; the second block catches the trai
358
+ \u2026`,args:{platform:"nginx"}},subnet:{input:"10.0.0.0/24",output:`{
359
+ "cidr": "10.0.0.0/24",
360
+ "network": "10.0.0.0",
361
+ "broadcast": "10.0.0.255",
362
+ "netmask": "255.255.255.0",
363
+ "firstHost": "10.0.0.1",
364
+ "lastHost": "10.0.0.254",
365
+ "totalAddresses": 256,
366
+ "usableHosts": 254
367
+ }`,args:{}},"user-agent":{input:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 Chrome/120.0 Safari/537.36",output:`{
368
+ "summary": "Chrome 120 on macOS 10.15.7 (Apple Macintosh) \xB7 desktop",
369
+ "browser": {
370
+ "name": "Chrome",
371
+ "version": "120.0",
372
+ "major": "120"
373
+ },
374
+ "engine": {
375
+ "name": "Blink",
376
+ "version": "120.0"
377
+ },
378
+ "os": {
379
+ "name": "macOS",
380
+ "version": "10.15.7"
381
+ },
382
+ "device": {
383
+ "type": "desktop",
384
+ "vendor": "Apple",
385
+ "model": "Mac
386
+ \u2026`,args:{}},"utm-build":{input:"https://redbison.dev/plugins",output:`{
387
+ "url": "https://redbison.dev/plugins?utm_source=blog&utm_medium=post&utm_campaign=launch",
388
+ "params": {
389
+ "utm_source": "blog",
390
+ "utm_medium": "post",
391
+ "utm_campaign": "launch"
392
+ },
393
+ "predictedChannel": "Unassigned",
394
+ "warnings": []
395
+ }`,args:{source:"blog",medium:"post",campaign:"launch"}},"barcode-check":{input:"501234567890",output:`{
396
+ "digits": "501234567890",
397
+ "checkDigit": 0,
398
+ "fullCode": "501234567890",
399
+ "valid": true,
400
+ "gtin14": "00501234567890",
401
+ "formats": [
402
+ "UPC-A (GTIN-12)"
403
+ ]
404
+ }`,args:{}},lorem:{input:"",output:"Mollit lorem aliqua laborum nulla ullamco sunt lorem ex excepteur magna fugiat.",args:{count:1,unit:"sentences"}},"random-email":{input:"",output:`2liv2wkd3@example.com
405
+ 69njxvvb5@example.com`,args:{count:2,domain:"example.com"}},"random-name":{input:"",output:`Finley Bennett
406
+ Zara Lee
407
+ Skyler Hassan`,args:{count:3}},"random-number":{input:"",output:`75
408
+ 57
409
+ 6
410
+ 12
411
+ 90`,args:{min:1,max:100,count:5}},"remove-accents":{input:"caf\xE9 r\xE9sum\xE9 na\xEFve",output:"cafe resume naive",args:{}},slugify:{input:"RedBison: 700+ Free Tools!",output:"redbison-700-free-tools",args:{}},"url-parse":{input:"https://redbison.dev:443/plugins?tab=vscode#install",output:`Scheme: https
412
+ Host: redbison.dev
413
+ Path: /plugins
414
+ Query:
415
+ tab = vscode
416
+ Fragment: install`,args:{}},uuid:{input:"",output:`[
417
+ "7a1d1b93-2d31-47b9-8104-eb991e9c1791"
418
+ ]`,args:{}},"date-diff":{input:"2026-01-01",output:`{
419
+ "milliseconds": 30931200000,
420
+ "totalSeconds": 30931200,
421
+ "totalMinutes": 515520,
422
+ "totalHours": 8592,
423
+ "totalDays": 358,
424
+ "breakdown": {
425
+ "days": 358,
426
+ "hours": 0,
427
+ "minutes": 0,
428
+ "seconds": 0
429
+ }
430
+ }`,args:{to:"2026-12-25"}},epoch:{input:"1700000000",output:'{"input":"1700000000","iso":"2023-11-14T22:13:20.000Z"}',args:{}},"number-to-words":{input:"1234",output:"one thousand two hundred thirty-four",args:{}},"timezone-convert":{input:"2026-11-18T12:00:00Z",output:`{
431
+ "utc": "2026-11-18T12:00:00.000Z",
432
+ "zone": "America/New_York",
433
+ "local": "2026-11-18T07:00:00"
434
+ }`,args:{to:"America/New_York"}},"list-compare":{input:`a
435
+ b
436
+ c`,output:`{
437
+ "union": [
438
+ "a",
439
+ "b",
440
+ "c",
441
+ "d"
442
+ ],
443
+ "intersection": [
444
+ "b",
445
+ "c"
446
+ ],
447
+ "onlyInA": [
448
+ "a"
449
+ ],
450
+ "onlyInB": [
451
+ "d"
452
+ ],
453
+ "counts": {
454
+ "a": 3,
455
+ "b": 3,
456
+ "union": 4,
457
+ "intersection": 2
458
+ }
459
+ }`,args:{b:`b
460
+ c
461
+ d`}},"text-diff":{input:`one
462
+ two`,output:` one
463
+ - two
464
+ + three`,args:{b:`one
465
+ three`}},"color-convert":{input:"#b32020",output:`{
466
+ "hex": "#b32020",
467
+ "rgb": "rgb(179, 32, 32)",
468
+ "hsl": "hsl(0, 70%, 41%)",
469
+ "components": {
470
+ "r": 179,
471
+ "g": 32,
472
+ "b": 32,
473
+ "h": 0,
474
+ "s": 70,
475
+ "l": 41
476
+ }
477
+ }`,args:{}},"color-palette":{input:"#b32020",output:`{
478
+ "base": "#b32020",
479
+ "rule": "complementary",
480
+ "wheel": "oklch",
481
+ "colors": [
482
+ {
483
+ "role": "base",
484
+ "hex": "#b32020",
485
+ "rgb": "rgb(179 32 32)",
486
+ "hsl": "hsl(0 70% 41%)",
487
+ "oklch": "oklch(49.7% 0.182 27.0)",
488
+ "contrastOnWhite": "6.67:1",
489
+ "contrastOnBlack": "3.14:1",
490
+ "bestTextColor": "#ffffff",
491
+ "wcagNorma
492
+ \u2026`,args:{}},"contrast-check":{input:"#b32020",output:`{
493
+ "ratio": 6.67,
494
+ "normalText": {
495
+ "AA": true,
496
+ "AAA": false
497
+ },
498
+ "largeText": {
499
+ "AA": true,
500
+ "AAA": true
501
+ }
502
+ }`,args:{background:"#ffffff"}},"css-gradient":{input:"",output:"linear-gradient(90deg, #b32020, #d4af37)",args:{type:"linear",angle:90,stops:["#b32020","#d4af37"]}}};var b="redbison",S=(o,n)=>o+" ".repeat(Math.max(0,n-o.length));function ce(o){let n=k(o.id);if(!n.length)return[];let c=Math.max(...n.map(t=>D(t).length)),i=["","Options:"];for(let t of n){let r=[t.describe];t.values?.length&&r.push(`one of: ${t.values.map(a=>a.value).join(", ")}`),t.defaultValue!==void 0&&r.push(`default ${JSON.stringify(t.defaultValue)}`),t.required&&r.push("required"),i.push(` ${S(D(t),c)} ${r.join("; ")}`);for(let a of t.values??[])a.describe&&i.push(` ${S("",c)} ${S(a.value,14)}${a.describe}`)}return i}function D(o){return o.type==="boolean"?`--${o.key}`:`--${o.key} <${o.type==="number"?"n":o.key==="b"?"text":"value"}>`}function U(o){let n=[`${b} ${o.id}: ${o.title}`,"",o.summary,"","Usage:",o.kind==="insert"?` ${b} ${o.id} [options]`:` ${b} ${o.id} [options] [text]
503
+ cat file | ${b} ${o.id} [options]
504
+ ${b} ${o.id} [options] --file path`];n.push(...ce(o));let c=E[o.id];if(c){n.push("","Example:");let i=Object.entries(c.args??{}).map(([r,a])=>`--${r} ${I(String(a))}`).join(" "),t=o.kind==="insert"?`${b} ${o.id}${i?` ${i}`:""}`:`${b} ${o.id}${i?` ${i}`:""} ${I(ue(c.input))}`;n.push(` $ ${t}`);for(let r of c.output.split(`
505
+ `).slice(0,6))n.push(` ${r}`);c.output.split(`
506
+ `).length>6&&n.push(" \u2026")}return n.push("",o.offline?"Runs on your machine. No network.":"Sends the input to redbison.dev to be processed. --offline refuses instead.",`Online: ${o.url}`),n.join(`
507
+ `)}function ue(o){let[n]=o.split(`
508
+ `);return n.length>60?`${n.slice(0,57)}...`:n}function I(o){return/^[A-Za-z0-9_@%+=:,./-]+$/.test(o)?o:`'${o.replace(/'/g,"'\\''")}'`}function W(){let o=x.filter(i=>i.offline).length,n=new Map;for(let i of x){let t=i.group??"Other";n.has(t)||n.set(t,[]),n.get(t).push(i)}let c=[`${b}: ${x.length} developer tools in your terminal`,"","Usage:",` ${b} <tool> [options] [text]`,` cat file | ${b} <tool> [options]`,` ${b} <tool> --help what one tool does, and every option it takes`,` ${b} --list every tool, one per line, for grep`,"",`${o} of the ${x.length} run entirely on your machine. The rest send the`,"input to redbison.dev; --offline refuses rather than sending anything.",""];for(let[i,t]of n){c.push(`${i}:`);let r=Math.min(22,Math.max(...t.map(a=>a.id.length)));for(let a of t)c.push(` ${S(a.id,r)} ${a.title}`);c.push("")}return c.push("Examples:",` echo '{"b":1,"a":2}' | ${b} json-format`,` ${b} uuid --variant v7`,` ${b} hash --algorithm sha512 --encoding base64 hello`,` ${b} sort-lines --order natural --file names.txt`,"","Docs: https://redbison.dev/cli"),c.join(`
509
+ `)}function H(){return x.map(o=>`${S(o.id,24)}${o.offline?"local ":"server"} ${o.title}`).join(`
510
+ `)}var y=require("node:crypto");var e=Object.assign(o=>o,{ctx:(o,n)=>`${o}${n}`,plural:(o,n,c)=>(pe(n,c),o===1?n.one:n.other)}),J=o=>[...o.matchAll(/\{(\w+)\}/g)].map(n=>n[1]);function de(o){let n=[...new Set(J(o.other))],c=new Set(J(o.one)),i=n.filter(t=>!c.has(t));return i.length===1?i[0]:n.includes("n")?"n":n.includes("count")?"count":n.length===1?n[0]:void 0}var R=new Map;function pe(o,n){if(R.get(o.other)?.one===o.one)return;let c={one:o.one,other:o.other,count:n??de(o)};R.set(o.other,c),R.has(o.one)||R.set(o.one,c)}var d=(o,n,c,i,t,r={})=>({code:o,name:n,spec:c,summary:i,usage:t,official:r.official??!0,deprecated:r.deprecated,note:r.note}),O=[d(100,"Continue","RFC 9110 \xA715.2.1",e("The server has received the request headers and the client should send the body."),e('Sent in reply to a request carrying "Expect: 100-continue", so a client can check that a large upload will be accepted before sending it.'),{note:e("Clients that did not send Expect: 100-continue may ignore it. A final status always follows.")}),d(101,"Switching Protocols","RFC 9110 \xA715.2.2",e("The server agrees to switch to the protocol named in the Upgrade header."),e("Used for the WebSocket handshake (RFC 6455) and the old h2c upgrade over HTTP/1.1."),{note:e("Not used in HTTP/2 or HTTP/3, which do not support the Upgrade mechanism.")}),d(102,"Processing","RFC 2518 \xA710.1",e("The server has accepted a WebDAV request and is still working on it."),e("Historic WebDAV interim response to stop a client timing out on a long operation."),{deprecated:!0,note:e("Dropped from WebDAV in RFC 4918 but still listed by IANA. Rarely seen today.")}),d(103,"Early Hints","RFC 8297",e("Preliminary headers sent before the final response, usually Link preload or preconnect hints."),e("Lets a CDN or server tell the browser to start fetching CSS, fonts or a third-party origin while the page is still being generated."),{note:e("Browsers act on Link headers in 103 only over HTTP/2 or HTTP/3 in practice.")}),d(200,"OK","RFC 9110 \xA715.3.1",e("The request succeeded."),e("The default success response. For GET the body is the resource; for POST it describes the result of the action.")),d(201,"Created","RFC 9110 \xA715.3.2",e("The request created one or more new resources."),e("Return after a POST or PUT creates something, with a Location header pointing at the new resource.")),d(202,"Accepted","RFC 9110 \xA715.3.3",e("The request was accepted for processing but is not finished."),e("Use for queued or asynchronous jobs. Include a way to check progress, such as a status URL."),{note:e("Promises nothing about the outcome: the job may still fail.")}),d(203,"Non-Authoritative Information","RFC 9110 \xA715.3.4",e("The response was modified by a transforming proxy from the origin's 200."),e("Sent by intermediaries that changed the payload, for example a proxy that recompressed images.")),d(204,"No Content","RFC 9110 \xA715.3.5",e("Success with no response body."),e("Common for DELETE, for PUT that does not echo the resource, and for form saves where the page should not change."),{note:e("A 204 must not contain a body; any bytes after the headers are an error.")}),d(205,"Reset Content","RFC 9110 \xA715.3.6",e("Success, and the client should reset the document view (for example clear a form)."),e('Rarely used by browsers; sometimes used by APIs to say "clear your input".')),d(206,"Partial Content","RFC 9110 \xA715.3.7",e("The body is the byte range(s) asked for with a Range header."),e("Used for resumable downloads and media seeking. Comes with Content-Range, or a multipart/byteranges body for several ranges.")),d(207,"Multi-Status","RFC 4918 \xA711.1",e("A WebDAV XML body carries separate status codes for several resources."),e("Returned by WebDAV methods such as PROPFIND that act on many resources at once.")),d(208,"Already Reported","RFC 5842 \xA77.1",e("Members of a WebDAV binding were already listed earlier in the same multistatus response."),e("Prevents a WebDAV client from walking the same collection twice when bindings create loops.")),d(226,"IM Used","RFC 3229 \xA710.4.1",e("The response is the result of instance manipulations (delta encoding) applied to the current resource."),e("Part of HTTP delta encoding, which saw little adoption.")),d(300,"Multiple Choices","RFC 9110 \xA715.4.1",e("The resource has several representations and the client may choose one."),e("Rare. Content negotiation is usually done silently with Accept headers instead.")),d(301,"Moved Permanently","RFC 9110 \xA715.4.2",e("The resource has a new permanent URL, given in Location."),e("Use when a page or site moves for good. Search engines transfer the old URL's signals to the new one."),{note:e("For historical reasons clients may change POST to GET when following a 301. Use 308 when the method must be kept.")}),d(302,"Found","RFC 9110 \xA715.4.3",e("The resource is temporarily at another URL."),e("Use for short-lived moves, login bounces and A/B routing where the original URL should stay indexed."),{note:e("Browsers change POST to GET when following 302. Use 307 to keep the method and body.")}),d(303,"See Other","RFC 9110 \xA715.4.4",e("The client should GET a different URL to see the result."),e("The Post/Redirect/Get pattern: after a form POST, send 303 to the result page so a refresh does not resubmit.")),d(304,"Not Modified","RFC 9110 \xA715.4.5",e("The cached copy is still valid; no body is sent."),e("Answer to a conditional GET (If-None-Match or If-Modified-Since) when the ETag or date still matches."),{note:e("Not really a redirect: it tells the client to use its own cache.")}),d(305,"Use Proxy","RFC 9110 \xA715.4.6",e("Deprecated. Was meant to tell the client to use a proxy."),e("Do not use. Browsers ignore it for security reasons."),{deprecated:!0}),d(306,"(Unused)","RFC 9110 \xA715.4.7",e('Reserved. Was "Switch Proxy" in a draft and is no longer used.'),e("Never send it."),{deprecated:!0}),d(307,"Temporary Redirect","RFC 9110 \xA715.4.8",e("Temporarily at another URL, and the client must repeat the same method and body there."),e("Use instead of 302 when a POST or PUT must not turn into a GET. Browsers also show 307 for internal HSTS upgrades.")),d(308,"Permanent Redirect","RFC 9110 \xA715.4.9",e("Permanently at another URL, and the client must repeat the same method and body there."),e("The method-preserving version of 301. Vercel and Next.js use 308 for permanent redirects by default.")),d(400,"Bad Request","RFC 9110 \xA715.5.1",e("The server cannot process the request because of a client error."),e("Malformed syntax, invalid JSON, a missing required parameter or a request that fails validation.")),d(401,"Unauthorized","RFC 9110 \xA715.5.2",e("The request lacks valid authentication credentials."),e("Send when the user is not logged in or the token is missing or expired. Must include a WWW-Authenticate header."),{note:e('Despite the name it means "unauthenticated". Use 403 when the caller is known but not allowed.')}),d(402,"Payment Required","RFC 9110 \xA715.5.3",e("Reserved for future use."),e("Not standardised. Some APIs use it for exhausted credit or an unpaid plan.")),d(403,"Forbidden","RFC 9110 \xA715.5.4",e("The server understood the request but refuses to authorise it."),e("The caller is authenticated (or authentication would not help) but lacks permission. Logging in again will not change the answer."),{note:e("Servers may return 404 instead to hide that a resource exists.")}),d(404,"Not Found","RFC 9110 \xA715.5.5",e("No resource exists at this URL, or the server will not say whether it does."),e("The default for unknown URLs. Cacheable by default, so a temporary 404 can stick in caches.")),d(405,"Method Not Allowed","RFC 9110 \xA715.5.6",e("The resource exists but does not support this method."),e("For example POST to a read-only endpoint. Must include an Allow header listing the supported methods.")),d(406,"Not Acceptable","RFC 9110 \xA715.5.7",e("No representation matches the request's Accept headers."),e("Rarely sent: most servers fall back to a default format instead of refusing.")),d(407,"Proxy Authentication Required","RFC 9110 \xA715.5.8",e("Like 401, but the client must authenticate with the proxy."),e("Sent by forward proxies with a Proxy-Authenticate header.")),d(408,"Request Timeout","RFC 9110 \xA715.5.9",e("The server did not receive a complete request in time."),e("Servers send it before closing an idle connection. The client may retry on a new connection.")),d(409,"Conflict","RFC 9110 \xA715.5.10",e("The request conflicts with the current state of the resource."),e("Edit conflicts, duplicate unique keys, or creating something that already exists. Describe the conflict in the body.")),d(410,"Gone","RFC 9110 \xA715.5.11",e("The resource used to exist and has been removed for good."),e("Tell clients and crawlers the removal is deliberate. Google documents that it drops both 404 and 410 URLs from the index; 410 states the intent more clearly.")),d(411,"Length Required","RFC 9110 \xA715.5.12",e("The server requires a Content-Length header."),e("Sent when a request body arrives without a length and the server does not accept chunked uploads.")),d(412,"Precondition Failed","RFC 9110 \xA715.5.13",e("A conditional header such as If-Match or If-Unmodified-Since evaluated to false."),e("Optimistic locking: the client's ETag is stale, so the update is rejected to avoid a lost update.")),d(413,"Content Too Large","RFC 9110 \xA715.5.14",e("The request body is larger than the server will accept."),e("Upload limits, such as nginx client_max_body_size (default 1 MB). May include Retry-After if temporary."),{note:e('Called "Payload Too Large" in RFC 7231 and "Request Entity Too Large" before that.')}),d(414,"URI Too Long","RFC 9110 \xA715.5.15",e("The request target is longer than the server will interpret."),e("Usually a GET with a huge query string that should have been a POST, or a redirect loop that keeps appending.")),d(415,"Unsupported Media Type","RFC 9110 \xA715.5.16",e("The body's Content-Type or Content-Encoding is not supported."),e("For example sending form data to a JSON-only endpoint. Respond with Accept or Accept-Encoding to show what works.")),d(416,"Range Not Satisfiable","RFC 9110 \xA715.5.17",e("None of the requested byte ranges overlap the resource."),e("A Range header past the end of the file. Send Content-Range: bytes */<length>.")),d(417,"Expectation Failed","RFC 9110 \xA715.5.18",e("The server cannot meet the Expect header."),e("Typically an Expect value other than 100-continue.")),d(418,"(Unused) / I'm a teapot","RFC 9110 \xA715.5.19; RFC 2324",e(`Reserved. Originally the April Fools' "I'm a teapot" from the coffee-pot protocol.`),e("Do not use for real errors. RFC 9110 reserves it because enough software implements the joke that it cannot be reassigned."),{deprecated:!0}),d(421,"Misdirected Request","RFC 9110 \xA715.5.20",e("The request reached a server that cannot answer for this host and scheme."),e("Happens when an HTTP/2 connection is reused for a host its certificate covers but the server is not configured for. The client should retry on a new connection.")),d(422,"Unprocessable Content","RFC 9110 \xA715.5.21",e("The syntax is valid but the content fails semantic validation."),e("A well-formed JSON body whose values break business rules, such as an end date before the start date."),{note:e('Was "Unprocessable Entity" in WebDAV (RFC 4918). Choosing 400 or 422 for validation errors is an API style decision.')}),d(423,"Locked","RFC 4918 \xA711.3",e("The WebDAV resource is locked."),e("Returned when another client holds a lock on the resource.")),d(424,"Failed Dependency","RFC 4918 \xA711.4",e("The method failed because an earlier action it depended on failed."),e("Used inside WebDAV multistatus responses.")),d(425,"Too Early","RFC 8470 \xA75.2",e("The server will not process a request that might be replayed from TLS 1.3 early data."),e("Protects non-idempotent requests sent in 0-RTT data. The client should retry after the handshake.")),d(426,"Upgrade Required","RFC 9110 \xA715.5.22",e("The server refuses the request on the current protocol and names a required one in Upgrade."),e("For example demanding TLS or a newer HTTP version.")),d(428,"Precondition Required","RFC 6585 \xA73",e("The server requires the request to be conditional."),e("Forces clients to send If-Match so concurrent edits cannot overwrite each other.")),d(429,"Too Many Requests","RFC 6585 \xA74",e("The client sent too many requests in a given time (rate limiting)."),e("Include Retry-After with seconds or a date. Clients should back off, ideally with jitter.")),d(431,"Request Header Fields Too Large","RFC 6585 \xA75",e("One header, or all headers together, are too large."),e("Often caused by oversized cookies. Clearing cookies for the site usually fixes it.")),d(451,"Unavailable For Legal Reasons","RFC 7725 \xA73",e("Access is denied because of a legal demand."),e('Court orders, government censorship or geo-blocking for legal reasons. Should include a Link with rel="blocked-by".')),d(500,"Internal Server Error","RFC 9110 \xA715.6.1",e("The server hit an unexpected condition."),e("The generic catch-all for unhandled exceptions. Log the details server-side; do not leak stack traces to clients.")),d(501,"Not Implemented","RFC 9110 \xA715.6.2",e("The server does not support the functionality needed, such as an unknown method."),e("Use for methods the server does not recognise at all. Cacheable by default.")),d(502,"Bad Gateway","RFC 9110 \xA715.6.3",e("A gateway or proxy got an invalid response from the upstream server."),e("Typical when nginx or a load balancer cannot connect to the app, or the app crashed mid-response.")),d(503,"Service Unavailable","RFC 9110 \xA715.6.4",e("The server is temporarily unable to handle the request."),e("Maintenance or overload. Add Retry-After. Search engines treat a short 503 as temporary and keep the page indexed.")),d(504,"Gateway Timeout","RFC 9110 \xA715.6.5",e("A gateway or proxy did not get a response from upstream in time."),e("A slow query or blocked worker behind nginx (proxy_read_timeout defaults to 60 s) or a cloud load balancer.")),d(505,"HTTP Version Not Supported","RFC 9110 \xA715.6.6",e("The server does not support the HTTP major version used."),e("Rare in practice.")),d(506,"Variant Also Negotiates","RFC 2295 \xA78.1",e("Transparent content negotiation is misconfigured and loops."),e("Only seen with experimental content negotiation setups.")),d(507,"Insufficient Storage","RFC 4918 \xA711.5",e("The server cannot store what is needed to complete the request."),e("WebDAV disk quota exceeded.")),d(508,"Loop Detected","RFC 5842 \xA77.2",e("The server found an infinite loop while processing a WebDAV request."),e("Depth-infinity operations over bindings that refer back to themselves.")),d(510,"Not Extended","RFC 2774 \xA77",e("Further extensions to the request are required."),e("Part of the HTTP Extension Framework, now marked obsolete by IANA."),{deprecated:!0}),d(511,"Network Authentication Required","RFC 6585 \xA76",e("The client must authenticate to gain network access."),e("Sent by captive portals on hotel and airport Wi-Fi, never by origin servers.")),d(419,"Page Expired","Laravel framework",e("The CSRF token is missing or expired."),e("Laravel returns it when a form is submitted after the session expired."),{official:!1}),d(444,"No Response","nginx",e("nginx closed the connection without sending anything."),e('Configured with "return 444;" to drop unwanted or malicious requests. Never reaches the client as a status.'),{official:!1}),d(494,"Request Header Too Large","nginx",e("nginx's internal code for headers over large_client_header_buffers."),e("Logged by nginx; clients receive 400."),{official:!1}),d(495,"SSL Certificate Error","nginx",e("The client certificate failed verification."),e("Mutual TLS setups; clients receive 400."),{official:!1}),d(496,"SSL Certificate Required","nginx",e("A required client certificate was not sent."),e("Mutual TLS setups; clients receive 400."),{official:!1}),d(497,"HTTP Request Sent to HTTPS Port","nginx",e("A plain HTTP request arrived on a TLS port."),e('Often handled with "error_page 497 =301 https://$host$request_uri;".'),{official:!1}),d(499,"Client Closed Request","nginx",e("The client closed the connection before nginx sent a response."),e("Shows up in nginx access logs when users cancel or a client-side timeout is shorter than the backend's response time."),{official:!1}),d(509,"Bandwidth Limit Exceeded","Apache / cPanel",e("The hosting account has exceeded its bandwidth quota."),e("Shared hosting control panels. Not part of any standard."),{official:!1}),d(520,"Web Server Returned an Unknown Error","Cloudflare",e("The origin returned an empty, unknown or unexpected response."),e("Cloudflare-only. Check origin logs for crashes or oversized headers."),{official:!1}),d(521,"Web Server Is Down","Cloudflare",e("The origin refused Cloudflare's connection."),e("Origin server offline or a firewall blocking Cloudflare IP ranges."),{official:!1}),d(522,"Connection Timed Out","Cloudflare",e("Cloudflare could not complete a TCP handshake with the origin."),e("Overloaded origin, wrong DNS origin IP or dropped packets."),{official:!1}),d(523,"Origin Is Unreachable","Cloudflare",e("Cloudflare cannot route to the origin."),e("Usually wrong DNS records for the origin."),{official:!1}),d(524,"A Timeout Occurred","Cloudflare",e("Cloudflare connected but the origin did not send an HTTP response within the timeout (100 s by default)."),e("Move long jobs to a background queue and poll for the result."),{official:!1}),d(525,"SSL Handshake Failed","Cloudflare",e("The TLS handshake between Cloudflare and the origin failed."),e("Check the origin certificate and cipher support in Full or Full (strict) SSL mode."),{official:!1}),d(526,"Invalid SSL Certificate","Cloudflare",e("The origin certificate is invalid in Full (strict) mode."),e("Install a valid or Cloudflare Origin CA certificate on the origin."),{official:!1})].sort((o,n)=>o.code-n.code),qe=[{id:"1xx",name:e("Informational"),desc:e("Interim responses; the final status follows.")},{id:"2xx",name:e("Successful"),desc:e("The request was received, understood and accepted.")},{id:"3xx",name:e("Redirection"),desc:e("Further action, usually following Location, is needed.")},{id:"4xx",name:e("Client error"),desc:e("The request is wrong or cannot be fulfilled as sent.")},{id:"5xx",name:e("Server error"),desc:e("The server failed to fulfil a valid request.")}];var l=(o,n,c,i,t={})=>({ext:Array.isArray(o)?o:[o],mime:n,name:c,category:i,registered:t.registered??!0,aliases:t.aliases,spec:t.spec,note:t.note}),N=[l(["html","htm"],"text/html",e("HTML document"),"web",{spec:"WHATWG HTML"}),l("css","text/css",e("Cascading Style Sheets"),"web",{spec:"RFC 2318"}),l(["js","mjs"],"text/javascript",e("JavaScript"),"web",{spec:"RFC 9239",aliases:["application/javascript","application/x-javascript"],note:e("RFC 9239 (2022) made text/javascript the only recommended type and marked application/javascript obsolete.")}),l("json","application/json",e("JSON"),"data",{spec:"RFC 8259",note:e("No charset parameter: JSON is always UTF-8 on the wire.")}),l("jsonld","application/ld+json",e("JSON-LD"),"data",{spec:"W3C JSON-LD 1.1"}),l("map","application/json",e("Source map"),"web",{note:e("Source maps have no type of their own; servers send application/json.")}),l("webmanifest","application/manifest+json",e("Web app manifest"),"web",{spec:"W3C Web App Manifest"}),l("wasm","application/wasm",e("WebAssembly binary"),"web",{note:e("WebAssembly.instantiateStreaming refuses any other type.")}),l("xhtml","application/xhtml+xml",e("XHTML document"),"web",{spec:"RFC 3236"}),l("ics","text/calendar",e("iCalendar"),"text",{spec:"RFC 5545"}),l("vcf","text/vcard",e("vCard contact"),"text",{spec:"RFC 6350",aliases:["text/x-vcard"]}),l("rss","application/rss+xml",e("RSS feed"),"web",{registered:!1,note:e("Widely used but never registered with IANA. application/xml also works.")}),l("atom","application/atom+xml",e("Atom feed"),"web",{spec:"RFC 4287"}),l("appcache","text/cache-manifest",e("Application cache manifest"),"web",{note:e("AppCache was removed from browsers.")}),l(["txt","text","log"],"text/plain",e("Plain text"),"text",{spec:"RFC 2046"}),l("csv","text/csv",e("Comma-separated values"),"data",{spec:"RFC 4180"}),l("tsv","text/tab-separated-values",e("Tab-separated values"),"data"),l(["md","markdown"],"text/markdown",e("Markdown"),"text",{spec:"RFC 7763"}),l("xml","application/xml",e("XML document"),"data",{spec:"RFC 7303",aliases:["text/xml"],note:e("RFC 7303 treats text/xml as an alias; application/xml is preferred.")}),l("xsl","application/xslt+xml",e("XSLT stylesheet"),"data",{spec:"W3C XSLT"}),l(["yaml","yml"],"application/yaml",e("YAML"),"data",{spec:"RFC 9512",aliases:["text/yaml","application/x-yaml","text/x-yaml"],note:e("Registered by RFC 9512 in 2024; older software sends application/x-yaml.")}),l("toml","application/toml",e("TOML"),"data",{note:e("Older tools may send text/x-toml or application/x-toml.")}),l("rtf","application/rtf",e("Rich Text Format"),"document",{aliases:["text/rtf"]}),l("sql","application/sql",e("SQL script"),"code",{spec:"RFC 6922"}),l("ndjson","application/x-ndjson",e("Newline-delimited JSON"),"data",{registered:!1,aliases:["application/jsonl"]}),l("geojson","application/geo+json",e("GeoJSON"),"data",{spec:"RFC 7946"}),l("gpx","application/gpx+xml",e("GPS exchange format"),"data",{registered:!1}),l("kml","application/vnd.google-earth.kml+xml",e("Google Earth KML"),"data"),l("srt","application/x-subrip",e("SubRip subtitles"),"text",{registered:!1}),l("vtt","text/vtt",e("WebVTT subtitles"),"text",{spec:"W3C WebVTT",note:e("The <track> element needs this exact type.")}),l("py","text/x-python",e("Python source"),"code",{registered:!1}),l("java","text/x-java-source",e("Java source"),"code",{registered:!1}),l(["c","h"],"text/x-c",e("C source"),"code",{registered:!1}),l("sh","application/x-sh",e("Shell script"),"code",{registered:!1}),l("php","application/x-httpd-php",e("PHP script"),"code",{registered:!1,note:e("Servers execute .php rather than serving it; this type is what Apache uses internally.")}),l("ts","video/mp2t",e("MPEG transport stream"),"video",{note:e("The .ts extension is MPEG-TS video by default on servers. TypeScript source has no registered type; tools use text/x-typescript or application/typescript.")}),l("png","image/png",e("PNG image"),"image",{spec:"W3C PNG"}),l(["jpg","jpeg","jpe","jfif"],"image/jpeg",e("JPEG image"),"image",{aliases:["image/pjpeg"],note:e("There is no image/jpg. Browsers tolerate it but it is not a valid type.")}),l("gif","image/gif",e("GIF image"),"image"),l("webp","image/webp",e("WebP image"),"image",{spec:"RFC 9649"}),l("avif","image/avif",e("AVIF image"),"image"),l("svg","image/svg+xml",e("SVG vector image"),"image",{spec:"W3C SVG",note:e("Without this exact type, <img> will not render an SVG.")}),l("svgz","image/svg+xml",e("Compressed SVG"),"image",{note:e("Also needs Content-Encoding: gzip.")}),l("ico","image/vnd.microsoft.icon",e("Windows icon"),"image",{aliases:["image/x-icon"],note:e("image/x-icon is far more common in the wild and works everywhere.")}),l("bmp","image/bmp",e("Bitmap image"),"image",{aliases:["image/x-ms-bmp"]}),l(["tif","tiff"],"image/tiff",e("TIFF image"),"image",{spec:"RFC 3302"}),l("heic","image/heic",e("HEIC image (HEIF with HEVC)"),"image"),l("heif","image/heif",e("HEIF image"),"image"),l("jxl","image/jxl",e("JPEG XL image"),"image"),l("apng","image/apng",e("Animated PNG"),"image",{note:e("image/png also works, and is what most servers send.")}),l("psd","image/vnd.adobe.photoshop",e("Photoshop document"),"image"),l("mp3","audio/mpeg",e("MP3 audio"),"audio",{spec:"RFC 3003",aliases:["audio/mp3"]}),l("wav","audio/wav",e("WAV audio"),"audio",{registered:!1,aliases:["audio/x-wav","audio/wave","audio/vnd.wave"]}),l("ogg","audio/ogg",e("Ogg audio"),"audio",{spec:"RFC 5334"}),l("oga","audio/ogg",e("Ogg audio"),"audio",{spec:"RFC 5334"}),l("opus","audio/ogg",e("Opus in Ogg"),"audio",{spec:"RFC 7845",note:e("Use audio/ogg; codecs=opus to signal the codec.")}),l("flac","audio/flac",e("FLAC audio"),"audio",{spec:"RFC 9639",aliases:["audio/x-flac"]}),l(["m4a","mp4a"],"audio/mp4",e("MPEG-4 audio (AAC)"),"audio",{spec:"RFC 4337",aliases:["audio/x-m4a"]}),l("aac","audio/aac",e("AAC audio (ADTS)"),"audio",{aliases:["audio/x-aac"]}),l("weba","audio/webm",e("WebM audio"),"audio",{registered:!1}),l(["mid","midi"],"audio/midi",e("MIDI"),"audio",{registered:!1,aliases:["audio/x-midi"]}),l(["aiff","aif"],"audio/x-aiff",e("AIFF audio"),"audio",{registered:!1,aliases:["audio/aiff"]}),l("mp4","video/mp4",e("MPEG-4 video"),"video",{spec:"RFC 4337"}),l("m4v","video/x-m4v",e("Apple MPEG-4 video"),"video",{registered:!1,note:e("video/mp4 also works for most .m4v files.")}),l("webm","video/webm",e("WebM video"),"video",{registered:!1,note:e("Defined by the WebM project rather than IANA, but universal.")}),l("ogv","video/ogg",e("Ogg video"),"video",{spec:"RFC 5334"}),l("mov","video/quicktime",e("QuickTime movie"),"video"),l("avi","video/x-msvideo",e("AVI video"),"video",{registered:!1}),l("mkv","video/x-matroska",e("Matroska video"),"video",{registered:!1,aliases:["video/matroska"]}),l("mpeg","video/mpeg",e("MPEG-1/2 video"),"video",{spec:"RFC 2045"}),l("3gp","video/3gpp",e("3GPP video"),"video",{spec:"RFC 3839"}),l("flv","video/x-flv",e("Flash video"),"video",{registered:!1}),l("m3u8","application/vnd.apple.mpegurl",e("HLS playlist"),"video",{aliases:["application/x-mpegURL","audio/mpegurl"],spec:"RFC 8216"}),l("mpd","application/dash+xml",e("MPEG-DASH manifest"),"video"),l("woff2","font/woff2",e("WOFF2 font"),"font",{spec:"RFC 8081",aliases:["application/font-woff2"]}),l("woff","font/woff",e("WOFF font"),"font",{spec:"RFC 8081",aliases:["application/font-woff"]}),l("ttf","font/ttf",e("TrueType font"),"font",{spec:"RFC 8081",aliases:["application/x-font-ttf"]}),l("otf","font/otf",e("OpenType font"),"font",{spec:"RFC 8081",aliases:["application/x-font-opentype"]}),l("eot","application/vnd.ms-fontobject",e("Embedded OpenType font"),"font",{note:e("Only old Internet Explorer used EOT.")}),l("pdf","application/pdf",e("PDF document"),"document",{spec:"RFC 8118"}),l("doc","application/msword",e("Word 97-2003 document"),"document"),l("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document",e("Word document"),"document"),l("xls","application/vnd.ms-excel",e("Excel 97-2003 workbook"),"document"),l("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",e("Excel workbook"),"document"),l("ppt","application/vnd.ms-powerpoint",e("PowerPoint 97-2003 presentation"),"document"),l("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation",e("PowerPoint presentation"),"document"),l("odt","application/vnd.oasis.opendocument.text",e("OpenDocument text"),"document"),l("ods","application/vnd.oasis.opendocument.spreadsheet",e("OpenDocument spreadsheet"),"document"),l("odp","application/vnd.oasis.opendocument.presentation",e("OpenDocument presentation"),"document"),l("epub","application/epub+zip",e("EPUB e-book"),"document"),l("eml","message/rfc822",e("Email message"),"document",{spec:"RFC 5322"}),l("zip","application/zip",e("ZIP archive"),"archive",{aliases:["application/x-zip-compressed"]}),l("gz","application/gzip",e("Gzip file"),"archive",{spec:"RFC 6713",aliases:["application/x-gzip"]}),l("tar","application/x-tar",e("Tar archive"),"archive",{registered:!1}),l("tgz","application/gzip",e("Gzipped tar archive"),"archive",{note:e("A .tar.gz file is served as application/gzip.")}),l("bz2","application/x-bzip2",e("Bzip2 file"),"archive",{registered:!1}),l("xz","application/x-xz",e("XZ file"),"archive",{registered:!1}),l("zst","application/zstd",e("Zstandard file"),"archive",{spec:"RFC 8878"}),l("7z","application/x-7z-compressed",e("7-Zip archive"),"archive",{registered:!1}),l("rar","application/vnd.rar",e("RAR archive"),"archive",{aliases:["application/x-rar-compressed"]}),l("jar","application/java-archive",e("Java archive"),"archive"),l(["bin","exe","dll","so","iso","img","dmg"],"application/octet-stream",e("Arbitrary binary data"),"application",{spec:"RFC 2046",note:e("The fallback for any unknown binary. Browsers download it rather than display it.")}),l("apk","application/vnd.android.package-archive",e("Android package"),"application",{registered:!1}),l("deb","application/vnd.debian.binary-package",e("Debian package"),"application"),l("rpm","application/x-redhat-package-manager",e("RPM package"),"application",{registered:!1,aliases:["application/x-rpm"]}),l("msi","application/x-msdownload",e("Windows installer"),"application",{registered:!1,aliases:["application/x-msi"]}),l("swf","application/x-shockwave-flash",e("Flash movie"),"application",{registered:!1,note:e("Flash Player reached end of life in 2020.")}),l("torrent","application/x-bittorrent",e("BitTorrent file"),"application",{registered:!1}),l("pem","application/x-pem-file",e("PEM certificate or key"),"application",{registered:!1,note:e("Apache's mime.types maps .pem to application/x-x509-ca-cert instead.")}),l("crt","application/x-x509-ca-cert",e("X.509 certificate"),"application",{aliases:["application/pkix-cert"],note:e("application/pkix-cert (RFC 2585) is also used for a single DER certificate.")}),l("p12","application/x-pkcs12",e("PKCS #12 keystore"),"application",{registered:!1}),l("parquet","application/vnd.apache.parquet",e("Apache Parquet"),"data"),l("sqlite","application/vnd.sqlite3",e("SQLite database"),"data"),l("glb","model/gltf-binary",e("glTF binary 3D model"),"application"),l("gltf","model/gltf+json",e("glTF 3D model"),"application"),l("stl","model/stl",e("STL 3D model"),"application"),l("ipynb","application/x-ipynb+json",e("Jupyter notebook"),"data",{registered:!1}),l([],"application/x-www-form-urlencoded",e("URL-encoded form body"),"web",{spec:"WHATWG URL",note:e("Default encoding of an HTML form post.")}),l([],"multipart/form-data",e("Multipart form body (file uploads)"),"web",{spec:"RFC 7578",note:e("Needs a boundary parameter, which browsers and fetch add for you when the body is FormData.")}),l([],"application/problem+json",e("Problem Details for HTTP APIs"),"data",{spec:"RFC 9457"}),l([],"text/event-stream",e("Server-sent events"),"web",{spec:"WHATWG HTML"}),l([],"application/graphql-response+json",e("GraphQL over HTTP response"),"data",{registered:!1})];function me(o){let n=o.trim().toLowerCase();n=n.split(/[?#]/)[0];let c=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\"));c>=0&&(n=n.slice(c+1));let i=n.lastIndexOf(".");return i>=0&&(n=n.slice(i+1)),n}function B(o){let n=o.trim().toLowerCase();if(/\.tar\.gz$/.test(n))return N.find(i=>i.ext.includes("tgz"));let c=me(o);if(c)return N.find(i=>i.ext.includes(c))}function V(o){let n=o.trim().toLowerCase().split(";")[0].trim();return n?N.filter(c=>c.mime===n||(c.aliases??[]).some(i=>i.toLowerCase()===n)):[]}var G=["lorem","ipsum","dolor","sit","amet","consectetur","adipiscing","elit","sed","do","eiusmod","tempor","incididunt","ut","labore","et","dolore","magna","aliqua","enim","ad","minim","veniam","quis","nostrud","exercitation","ullamco","laboris","nisi","aliquip","ex","ea","commodo","consequat","duis","aute","irure","in","reprehenderit","voluptate","velit","esse","cillum","fugiat","nulla","pariatur","excepteur","sint","occaecat","cupidatat","non","proident","sunt","culpa","qui","officia","deserunt","mollit","anim","id","est","laborum"];function z(o){let n=Math.trunc(Number(o));return!Number.isFinite(n)||n<1?1:Math.min(n,1e3)}var fe=o=>G[Math.floor(o()*G.length)];function j(o=Math.random){let n=Math.floor(o()*15)+5,c=Array.from({length:n},()=>fe(o)).join(" ");return c.charAt(0).toUpperCase()+c.slice(1)+"."}var h=class extends Error{},T=o=>{try{return JSON.parse(o)}catch(n){throw new h(n instanceof Error?n.message:"The selection is not valid JSON.")}};function Z(o){let n=o.trim().replace(/-/g,"+").replace(/_/g,"/"),c=n+"=".repeat((4-n.length%4)%4);if(!/^[A-Za-z0-9+/]*={0,2}$/.test(c))throw new h("The selection is not Base64.");let i=Buffer.from(c,"base64");if(i.toString("base64").replace(/=+$/,"")!==c.replace(/=+$/,""))throw new h("The selection is not Base64.");return i}var he=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).filter(Boolean),L=o=>o.charAt(0).toUpperCase()+o.slice(1).toLowerCase();function _(o,n,c={}){let i=(t,r)=>String(c[t]??r);switch(o){case"json-format":{let t=Number(c.indent??2);return JSON.stringify(T(n),null,Number.isFinite(t)?t:2)}case"json-minify":return JSON.stringify(T(n));case"json-validate":{T(n);let t=T(n);return`Valid JSON.
511
+ Top level: ${Array.isArray(t)?"array":t===null?"null":typeof t}${Array.isArray(t)?` of ${t.length}`:""}`}case"base64-encode":return Buffer.from(n,"utf8").toString(i("variant","standard")==="url"?"base64url":"base64");case"base64-decode":return Z(n).toString("utf8");case"url-encode":return i("variant","component")==="uri"?encodeURI(n):encodeURIComponent(n);case"url-decode":try{return decodeURIComponent(n)}catch{throw new h("The selection has a percent-escape that is not valid.")}case"uuid":{let t=i("variant","v4");if(t==="v4")return(0,y.randomUUID)();if(t==="v4-upper")return(0,y.randomUUID)().toUpperCase();if(t==="v4-compact")return(0,y.randomUUID)().replace(/-/g,"");if(t==="nil")return"00000000-0000-0000-0000-000000000000";if(t==="v7"){let r=Date.now(),a=(0,y.randomBytes)(16);a.writeUIntBE(r,0,6),a[6]=a[6]&15|112,a[8]=a[8]&63|128;let s=a.toString("hex");return`${s.slice(0,8)}-${s.slice(8,12)}-${s.slice(12,16)}-${s.slice(16,20)}-${s.slice(20)}`}return(0,y.randomUUID)()}case"password":{let t=Math.min(Math.max(Number(c.length??20)||20,8),128),r={letters:"abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",alphanumeric:"abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789",full:"abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789!@#$%^&*()-_=+[]{}"},a=r[i("charset","full")]??r.full,s="";for(let u=0;u<t;u+=1)s+=a[(0,y.randomInt)(a.length)];return s}case"hash":{let t=i("algorithm","sha256");if(!["md5","sha1","sha256","sha384","sha512"].includes(t))throw new h(`${t} is not one of md5, sha1, sha256, sha384 or sha512.`);let r=(0,y.createHash)(t).update(n,"utf8");return i("encoding","hex")==="base64"?r.digest("base64"):r.digest("hex")}case"hmac":{let t=String(c.key??"");if(!t)throw new h("An HMAC needs a key.");let r=i("algorithm","sha256"),a=(0,y.createHmac)(r,t).update(n,"utf8");return i("encoding","hex")==="base64"?a.digest("base64"):a.digest("hex")}case"jwt-decode":{let t=n.trim().split(".");if(t.length<2)throw new h("That is not a JWT: it needs a header and a payload.");let r=(p,f)=>{try{return JSON.parse(Z(p).toString("utf8"))}catch{throw new h(`The ${f} is not valid JSON once decoded.`)}},a=r(t[0],"header"),s=r(t[1],"payload"),u=p=>typeof p=="number"?` (${new Date(p*1e3).toISOString()})`:"",m=[typeof s.exp=="number"?`exp${u(s.exp)}${s.exp*1e3<Date.now()?" EXPIRED":""}`:"",typeof s.iat=="number"?`iat${u(s.iat)}`:"",typeof s.nbf=="number"?`nbf${u(s.nbf)}`:""].filter(Boolean);return["// header",JSON.stringify(a,null,2),"","// payload",JSON.stringify(s,null,2),m.length?`
512
+ // ${m.join(" ")}`:"",`
513
+ // The signature is NOT verified. Decoding is not authentication.`].join(`
514
+ `)}case"case-convert":{let t=he(n);if(!t.length)return n;switch(i("style","camel")){case"camel":return t.map((r,a)=>a?L(r):r.toLowerCase()).join("");case"pascal":return t.map(L).join("");case"snake":return t.map(r=>r.toLowerCase()).join("_");case"kebab":return t.map(r=>r.toLowerCase()).join("-");case"constant":return t.map(r=>r.toUpperCase()).join("_");case"upper":return n.toUpperCase();case"lower":return n.toLowerCase();case"title":return t.map(L).join(" ");default:return n}}case"slugify":return n.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");case"dedupe-lines":{let t=new Set,r=i("compare","exact")==="ignore-case";return n.split(`
515
+ `).filter(a=>{let s=r?a.toLowerCase():a;return t.has(s)?!1:(t.add(s),!0)}).join(`
516
+ `)}case"lines-to-comma":{let t=i("separator",", "),r=i("quote","none");return n.split(`
517
+ `).map(s=>s.trim()).filter(Boolean).map(s=>r==="double"?`"${s}"`:r==="single"?`'${s}'`:s).join(t)}case"word-count":{let t=[...n].length,r=[...n.replace(/\s/g,"")].length,a=n.trim()?n.trim().split(/\s+/).length:0,s=n?n.split(`
518
+ `).length:0,u=Math.max(1,Math.round(a/238));return[`Words: ${a}`,`Characters: ${t}`,`Characters (no space): ${r}`,`Lines: ${s}`,`Reading time: about ${u} min`].join(`
519
+ `)}case"number-base":{let t=n.trim().replace(/[_,\s]/g,""),r=/^0x/i.test(t)?16:/^0o/i.test(t)?8:/^0b/i.test(t)?2:Number(i("from","10")),a=t.replace(/^0[xob]/i,""),s;try{s=BigInt(r===10?a:`0${r===16?"x":r===8?"o":"b"}${a}`)}catch{throw new h(`${n.trim()} is not a base ${r} number.`)}return[`Decimal: ${s.toString(10)}`,`Hex: 0x${s.toString(16).toUpperCase()}`,`Octal: 0o${s.toString(8)}`,`Binary: 0b${s.toString(2)}`].join(`
520
+ `)}case"epoch":{let t=n.trim(),r=Number(t),a=Number.isFinite(r)&&t!==""?new Date(t.length<=10?r*1e3:r):new Date(t);if(Number.isNaN(a.getTime()))throw new h(`${t} is not a timestamp or a date.`);return[`ISO 8601 (UTC): ${a.toISOString()}`,`Local: ${a.toString()}`,`Unix seconds: ${Math.floor(a.getTime()/1e3)}`,`Unix millis: ${a.getTime()}`].join(`
521
+ `)}case"regex-test":{let t=String(c.pattern??"");if(!t)throw new h("Enter a regular expression first.");let r;try{r=new RegExp(t,i("flags","g").includes("g")?i("flags","g"):`${i("flags","g")}g`)}catch(u){throw new h(u instanceof Error?u.message:"That is not a valid regular expression.")}let a=[],s=0;for(let u of n.matchAll(r))if(s+=1,a.length<50){let m=u.slice(1).map((p,f)=>` ${f+1}: ${p??"(no match)"}`);a.push(`${String(u.index).padStart(6)}: ${u[0]}${m.length?`
522
+ ${m.join(`
523
+ `)}`:""}`)}return s?[`${s} match${s===1?"":"es"} for /${t}/`,"",...a,s>50?`
524
+ \u2026 ${s-50} more`:""].join(`
525
+ `):`No matches for /${t}/`}case"http-status":{let t=n.trim(),r=Number(t),a=Number.isFinite(r)?O.filter(s=>s.code===r):O.filter(s=>s.name.toLowerCase().includes(t.toLowerCase())).slice(0,8);if(!a.length)throw new h(`No HTTP status matches ${t}.`);return a.map(s=>[`${s.code} ${s.name}`,` ${s.spec}`,` ${s.summary}`].join(`
526
+ `)).join(`
527
+
528
+ `)}case"mime-lookup":{let t=n.trim(),r=B(t),a=V(t);if(r)return`${t}
529
+ ${r.mime}${r.note?`
530
+ ${r.note}`:""}`;if(a.length)return a.map(s=>`${s.mime}
531
+ .${s.ext.join(" .")}`).join(`
532
+
533
+ `);throw new h(`Nothing registered for ${t}.`)}case"lorem":{let t=z(String(c.count??2)),r=i("unit","paragraphs");return r==="sentences"?Array.from({length:t},()=>j()).join(" "):r==="words"?Array.from({length:t},()=>j()).join(" ").split(/\s+/).slice(0,t).join(" "):Array.from({length:t},()=>Array.from({length:4},()=>j()).join(" ")).join(`
534
+
535
+ `)}case"csv-to-json":{let t=[],r=[],a="",s=!1;for(let p=0;p<n.length;p+=1){let f=n[p];s?f==='"'&&n[p+1]==='"'?(a+='"',p+=1):f==='"'?s=!1:a+=f:f==='"'?s=!0:f===","?(r.push(a),a=""):f===`
536
+ `?(r.push(a),t.push(r),r=[],a=""):f!=="\r"&&(a+=f)}if((a||r.length)&&(r.push(a),t.push(r)),!t.length)throw new h("The selection has no rows.");let[u,...m]=t;return JSON.stringify(m.filter(p=>p.some(f=>f!=="")).map(p=>Object.fromEntries(u.map((f,v)=>[f,p[v]??""]))),null,2)}case"json-to-csv":{let t=T(n);if(!Array.isArray(t))throw new h("JSON to CSV needs an array of objects.");let r=[...new Set(t.flatMap(s=>s&&typeof s=="object"?Object.keys(s):[]))];if(!r.length)throw new h("No object keys to use as a header.");let a=s=>{let u=s==null?"":String(s);return/[",\n\r]/.test(u)?`"${u.replace(/"/g,'""')}"`:u};return[r.join(","),...t.map(s=>r.map(u=>a(s?.[u])).join(","))].join(`
537
+ `)}case"markdown-table":{let t=n.trim().split(`
538
+ `).map(p=>p.includes("|")?p.replace(/^\s*\|/,"").replace(/\|\s*$/,"").split("|").map(f=>f.trim()):p.split(/\t|,/).map(f=>f.trim())).filter(p=>p.length&&!p.every(f=>/^:?-{2,}:?$/.test(f)||f===""));if(t.length<2)throw new h("A table needs a header row and at least one row of data.");let r=Math.max(...t.map(p=>p.length)),a=Array.from({length:r},(p,f)=>Math.max(3,...t.map(v=>(v[f]??"").length))),s=p=>`| ${p.map((f,v)=>(f??"").padEnd(a[v])).join(" | ")} |`,[u,...m]=t;return[s(u),`| ${a.map(p=>"-".repeat(p)).join(" | ")} |`,...m.map(s)].join(`
539
+ `)}case"sort-lines":{let t=i("order","asc"),r=n.split(`
540
+ `),a=t==="natural"||t==="natural-desc"?(u,m)=>u.localeCompare(m,void 0,{numeric:!0,sensitivity:"base"}):t==="length"?(u,m)=>u.length-m.length:(u,m)=>u.localeCompare(m),s=[...r].sort(a);return t.endsWith("desc")?s.reverse().join(`
541
+ `):s.join(`
542
+ `)}case"reverse-lines":return n.split(`
543
+ `).reverse().join(`
544
+ `);case"shuffle-lines":{let t=n.split(`
545
+ `);for(let r=t.length-1;r>0;r-=1){let a=(0,y.randomInt)(r+1);[t[r],t[a]]=[t[a],t[r]]}return t.join(`
546
+ `)}case"number-lines":{let t=n.split(`
547
+ `),r=String(t.length).length,a=i("separator",". ");return t.map((s,u)=>`${String(u+1).padStart(r)}${a}${s}`).join(`
548
+ `)}case"trim-lines":return n.split(`
549
+ `).map(t=>t.trim()).join(`
550
+ `);case"wrap-lines":{let t=Math.max(20,Number(c.width??72)||72);return n.split(`
551
+ `).map(r=>{if(r.length<=t)return r;let a=[],s="";for(let u of r.split(/\s+/))s?`${s} ${u}`.length<=t?s+=` ${u}`:(a.push(s),s=u):s=u;return s&&a.push(s),a.join(`
552
+ `)}).join(`
553
+ `)}case"reverse-text":return[...n].reverse().join("");case"rot13":return n.replace(/[a-zA-Z]/g,t=>{let r=t<="Z"?65:97;return String.fromCharCode((t.charCodeAt(0)-r+13)%26+r)});case"remove-accents":return n.normalize("NFD").replace(/[\u0300-\u036f]/g,"");case"strip-html":return n.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<style[\s\S]*?<\/style>/gi,"").replace(/<[^>]+>/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/\n{3,}/g,`
554
+
555
+ `).trim();case"html-escape":return n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;");case"html-unescape":return n.replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(Number(r))).replace(/&#x([0-9a-f]+);/gi,(t,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&quot;/g,'"').replace(/&#39;|&apos;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&nbsp;/g," ").replace(/&amp;/g,"&");case"to-hex":{let t=i("separator"," ");return[...Buffer.from(n,"utf8")].map(r=>r.toString(16).padStart(2,"0")).join(t)}case"from-hex":{let t=n.replace(/0x/gi,"").replace(/[^0-9a-f]/gi,"");if(!t)throw new h("No hex digits in the selection.");if(t.length%2)throw new h("Hex needs an even number of digits.");return Buffer.from(t,"hex").toString("utf8")}case"extract-urls":return[...new Set(n.match(/https?:\/\/[^\s<>"')\]]+/g)??[])].join(`
556
+ `)||"(no URLs found)";case"extract-emails":return[...new Set(n.match(/[\w.+-]+@[\w-]+\.[\w.-]+/g)??[])].join(`
557
+ `)||"(no addresses found)";case"extract-numbers":return(n.match(/-?\d+(?:\.\d+)?/g)??[]).join(`
558
+ `)||"(no numbers found)";case"sort-json-keys":{let t=r=>Array.isArray(r)?r.map(t):r&&typeof r=="object"?Object.fromEntries(Object.entries(r).sort(([a],[s])=>a.localeCompare(s)).map(([a,s])=>[a,t(s)])):r;return JSON.stringify(t(T(n)),null,2)}case"query-to-json":{let t=n.trim().replace(/^[^?]*\?/,"");if(!/[=&]/.test(t))throw new h("No query parameters in the selection.");let r={};for(let[a,s]of new URLSearchParams(t))a in r?r[a]=Array.isArray(r[a])?[...r[a],s]:[r[a],s]:r[a]=s;if(!Object.keys(r).length)throw new h("No query parameters in the selection.");return JSON.stringify(r,null,2)}case"json-to-query":{let t=T(n);if(!t||typeof t!="object"||Array.isArray(t))throw new h("This needs a JSON object.");let r=new URLSearchParams;for(let[a,s]of Object.entries(t))Array.isArray(s)?s.forEach(u=>r.append(a,String(u))):r.append(a,String(s));return r.toString()}case"url-parse":{let t;try{t=new URL(n.trim())}catch{throw new h("That is not a URL this can parse. It needs a scheme, such as https://.")}let r=[...t.searchParams].map(([a,s])=>` ${a} = ${s}`);return[`Scheme: ${t.protocol.replace(":","")}`,t.username?`User: ${t.username}`:"",`Host: ${t.hostname}`,t.port?`Port: ${t.port}`:"",`Path: ${t.pathname}`,r.length?`Query:
559
+ ${r.join(`
560
+ `)}`:"",t.hash?`Fragment: ${t.hash.slice(1)}`:""].filter(Boolean).join(`
561
+ `)}case"unique-words":{let t=new Map;for(let r of n.toLowerCase().match(/[\p{L}\p{N}'-]+/gu)??[])t.set(r,(t.get(r)??0)+1);if(!t.size)throw new h("No words in the selection.");return[...t].sort((r,a)=>a[1]-r[1]||r[0].localeCompare(a[0])).map(([r,a])=>`${String(a).padStart(6)} ${r}`).join(`
562
+ `)}case"char-frequency":{let t=new Map;for(let a of n)t.set(a,(t.get(a)??0)+1);let r=a=>a===" "?"(space)":a===`
563
+ `?"(newline)":a===" "?"(tab)":a==="\r"?"(return)":a;return[...t].sort((a,s)=>s[1]-a[1]).map(([a,s])=>`${String(s).padStart(6)} ${r(a)}`).join(`
564
+ `)}case"tsv-parse":{let t=n.split(`
565
+ `).filter(s=>s.trim()).map(s=>s.split(" "));if(t.length<2)throw new h("TSV needs a header row and at least one row of data.");let[r,...a]=t;return JSON.stringify(a.map(s=>Object.fromEntries(r.map((u,m)=>[u.trim(),(s[m]??"").trim()]))),null,2)}case"find-duplicates":{let t=new Map;for(let a of n.split(`
566
+ `))t.set(a,(t.get(a)??0)+1);let r=[...t].filter(([,a])=>a>1).sort((a,s)=>s[1]-a[1]);return r.length?r.map(([a,s])=>`${String(s).padStart(5)}x ${a}`).join(`
567
+ `):"No duplicate lines."}case"remove-extra-spaces":return n.split(`
568
+ `).map(t=>t.replace(/[ \t]+/g," ").trim()).join(`
569
+ `);case"remove-empty-lines":return n.split(`
570
+ `).filter(t=>t.trim()).join(`
571
+ `);case"comma-to-lines":return n.split(i("separator",",")).map(t=>t.trim()).filter(Boolean).join(`
572
+ `);case"hash-compare":{let t=String(c.b??"");if(!t)throw new h("Paste the hash to compare against.");let r=s=>s.trim().toLowerCase().replace(/\s+/g,"");return r(n)===r(t)?`MATCH
573
+ The two hashes are the same.`:`NO MATCH
574
+ a: ${r(n)}
575
+ b: ${r(t)}`}case"escape-characters":{let t=i("format","json");return t==="json"?JSON.stringify(n).slice(1,-1):t==="html"?_("html-escape",n):t==="xml"?n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):JSON.stringify(n).slice(1,-1)}case"subnet":{let t=n.trim().match(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/);if(!t)throw new h("Expected a CIDR block such as 10.0.0.0/24.");let r=t.slice(1,5).map(Number),a=Number(t[5]);if(r.some(C=>C>255)||a>32)throw new h("That is not a valid IPv4 CIDR block.");let s=r.reduce((C,F)=>(C<<8)+F,0)>>>0,u=a===0?0:4294967295<<32-a>>>0,m=(s&u)>>>0,p=(m|~u>>>0)>>>0,f=C=>[24,16,8,0].map(F=>C>>>F&255).join("."),v=2**(32-a);return[`Network: ${f(m)}/${a}`,`Netmask: ${f(u)}`,`Broadcast: ${f(p)}`,`Hosts: ${v>2?`${f(m+1)} to ${f(p-1)} (${v-2} usable)`:`${v} addresses`}`].join(`
576
+ `)}case"ip-convert":{let t=n.trim(),r;if(/^\d+\.\d+\.\d+\.\d+$/.test(t)){let s=t.split(".").map(Number);if(s.some(u=>u>255))throw new h("Each octet must be 0 to 255.");r=s.reduce((u,m)=>(u<<8)+m,0)>>>0}else if(r=Number((/^0x/i.test(t),BigInt(t))),!Number.isFinite(r)||r<0||r>4294967295)throw new h("Not an IPv4 address or a 32-bit integer.");let a=[24,16,8,0].map(s=>r>>>s&255).join(".");return[`Dotted: ${a}`,`Integer: ${r>>>0}`,`Hex: 0x${(r>>>0).toString(16).toUpperCase().padStart(8,"0")}`,`Binary: ${[24,16,8,0].map(s=>(r>>>s&255).toString(2).padStart(8,"0")).join(".")}`,`IPv6: ::ffff:${a}`].join(`
577
+ `)}case"chmod":{let t=n.trim(),r=["owner","group","others"];if(/^[0-7]{3,4}$/.test(t)){let m=t.slice(-3).split("").map(Number).map(p=>`${p&4?"r":"-"}${p&2?"w":"-"}${p&1?"x":"-"}`);return[`Octal: ${t}`,`Symbolic: ${m.join("")}`,...m.map((p,f)=>` ${r[f].padEnd(7)} ${p}`)].join(`
578
+ `)}let a=t.replace(/^[-dl]/,"");if(!/^[rwx-]{9}$/.test(a))throw new h("Expected 755 or rwxr-xr-x.");let s=[0,3,6].map(u=>{let m=a.slice(u,u+3);return(m[0]==="r"?4:0)+(m[1]==="w"?2:0)+(m[2]==="x"?1:0)}).join("");return[`Symbolic: ${a}`,`Octal: ${s}`].join(`
579
+ `)}case"ieee754":{let t=Number(n.trim());if(!Number.isFinite(t)&&!Number.isNaN(t))throw new h(`${n.trim()} is not a number.`);let r=[];for(let[a,s]of[["Single (32-bit)",4],["Double (64-bit)",8]]){let u=new DataView(new ArrayBuffer(s));s===4?u.setFloat32(0,t):u.setFloat64(0,t);let m=[...Array(s).keys()].map(v=>u.getUint8(v).toString(2).padStart(8,"0")).join(""),p=s===4?u.getFloat32(0):u.getFloat64(0),f=s===4?8:11;r.push(`${a}`,` Sign ${m[0]}`,` Exponent ${m.slice(1,1+f)}`,` Mantissa ${m.slice(1+f)}`,` Stored as ${p}`,"")}return r.join(`
580
+ `).trimEnd()}case"military-time":{let t=n.trim().toUpperCase(),r=t.match(/^(\d{1,2}):?(\d{2})$/),a=t.match(/^(\d{1,2}):?(\d{2})\s*(AM|PM)$/);if(a){let s=Number(a[1])%12;return a[3]==="PM"&&(s+=12),`${String(s).padStart(2,"0")}:${a[2]}`}if(r){let s=Number(r[1]);if(s>23||Number(r[2])>59)throw new h("That is not a valid time.");let u=s<12?"AM":"PM";return`${s%12===0?12:s%12}:${r[2]} ${u}`}throw new h("Expected 14:30 or 2:30 PM.")}case"binary-text":{let t=n.trim();if(/^[01\s]+$/.test(t)){let r=t.replace(/\s+/g,"");if(r.length%8)throw new h("Binary needs a multiple of eight bits.");return(r.match(/.{8}/g)??[]).map(a=>String.fromCharCode(parseInt(a,2))).join("")}return[...Buffer.from(t,"utf8")].map(r=>r.toString(2).padStart(8,"0")).join(" ")}case"date-diff":{let t=String(c.to??"");if(!t)throw new h("Enter the second date.");let r=new Date(n.trim()),a=new Date(t);if(Number.isNaN(r.getTime())||Number.isNaN(a.getTime()))throw new h("One of those is not a date.");let s=Math.abs(a.getTime()-r.getTime()),u=Math.floor(s/864e5);return[`Total days: ${u}`,`Total hours: ${Math.floor(s/36e5)}`,`Weeks: ${Math.floor(u/7)} weeks, ${u%7} days`,`Approx years: ${(u/365.2425).toFixed(2)}`].join(`
581
+ `)}case"list-compare":{let t=String(c.b??"");if(!t)throw new h("Paste the second list.");let r=p=>new Set(p.split(`
582
+ `).map(f=>f.trim()).filter(Boolean)),a=r(n),s=r(t),u=(p,f)=>[...p].filter(v=>!f.has(v)),m=[...a].filter(p=>s.has(p));return[`Only in the first (${u(a,s).length}):`,...u(a,s).map(p=>` ${p}`),"",`Only in the second (${u(s,a).length}):`,...u(s,a).map(p=>` ${p}`),"",`In both (${m.length}):`,...m.map(p=>` ${p}`)].join(`
583
+ `)}case"utm-build":{let t=n.trim(),r;try{r=new URL(t)}catch{throw new h("That is not a URL. It needs a scheme, such as https://.")}for(let a of["source","medium","campaign","term","content"]){let s=c[a];s&&r.searchParams.set(`utm_${a}`,String(s))}return r.toString()}default:return}}var g=class extends Error{},ge=process.env.REDBISON_MCP_URL??"https://mcp.redbison.dev",be=1e6;async function X(o,n,c,i={}){let t=$(o);if(!t)throw new g(`No tool called ${o}. Try: redbison --list`);let r=P(o,c);if(r.length){let a=r.map(s=>`--${s.key} (${s.describe})`).join(", ");throw new g(`${o} needs ${a}.`)}if(t.offline)try{let a=_(o,n,c);if(a===void 0)throw new g(`${o} is marked as local but has no implementation. Please report this.`);return a}catch(a){throw a instanceof h?new g(a.message):a}if(i.offline)throw new g(`${o} runs on the server, and --offline was given, so nothing was sent.
584
+ Tools that work without a network: redbison --list | grep local`);return ye(t,n,c,i.timeoutMs??2e4)}async function ye(o,n,c,i){if(!o.mcp)throw new g(`${o.id} has no server tool.`);let t=Buffer.byteLength(n,"utf8")+Object.values(c).reduce((m,p)=>m+(typeof p=="string"?Buffer.byteLength(p,"utf8"):0),0);if(t>be)throw new g(`That is ${(t/1e6).toFixed(1)}MB, and ${o.id} would have to send it to redbison.dev. The limit is 1MB.`);let r={...o.mcp.args??{},...c};o.mcp.input&&(r[o.mcp.input]=n);let a=new AbortController,s=setTimeout(()=>a.abort(),i),u;try{let m=await fetch(ge,{method:"POST",headers:{"content-type":"application/json",accept:"application/json, text/event-stream"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"tools/call",params:{name:o.mcp.name,arguments:r}}),signal:a.signal});if(!m.ok)throw new g(`redbison.dev answered ${m.status} for ${o.id}.`);u=await m.text()}catch(m){throw m instanceof g?m:m.name==="AbortError"?new g(`${o.id} timed out after ${i/1e3}s.`):new g(`Could not reach redbison.dev: ${m.message}`)}finally{clearTimeout(s)}return ve(u,o.id)}function ve(o,n){let c=o.split(`
585
+ `).find(s=>s.startsWith("data: ")),i=c?c.slice(6):o,t;try{t=JSON.parse(i)}catch{throw new g(`Could not read the reply for ${n}.`)}let r=t;if(r.error)throw new g(r.error.message??`${n} failed.`);let a=r.result?.content?.find(s=>s.type==="text");if(!a?.text)throw new g(`${n} returned nothing.`);try{let s=JSON.parse(a.text);if(s?.error?.message)throw new g(`${n}: ${s.error.message}`)}catch(s){if(s instanceof g)throw s}return a.text}var we="0.1.0";function xe(o){let n=(i,t)=>{if(t.includes(i)||i.includes(t))return 0;let r=0;for(let a of new Set(i))t.includes(a)&&(r+=1);return i.length-r},c=x.map(i=>({id:i.id,d:n(o.toLowerCase(),i.id)})).sort((i,t)=>i.d-t.d).filter(i=>i.d<=2).slice(0,4).map(i=>i.id);return c.length?`
586
+
587
+ Did you mean:
588
+ ${c.map(i=>` ${i}`).join(`
589
+ `)}`:""}async function ke(){if(process.stdin.isTTY)return"";let o=[];for await(let n of process.stdin)o.push(n);return Buffer.concat(o).toString("utf8")}async function Y(o){let n;try{n=q(o)}catch(r){return process.stderr.write(`${r.message}
590
+ `),2}if(n.version)return process.stdout.write(`${we}
591
+ `),0;if(n.list)return process.stdout.write(`${H()}
592
+ `),0;if(!n.tool)return process.stdout.write(`${W()}
593
+ `),n.help?0:1;let c=$(n.tool);if(!c)return process.stderr.write(`No tool called "${n.tool}".${xe(n.tool)}
594
+
595
+ redbison --list shows all ${x.length}.
596
+ `),2;if(n.help)return process.stdout.write(`${U(c)}
597
+ `),0;let i="";if(c.kind!=="insert"){if(n.input!==void 0)i=n.input;else if(n.file)try{i=(0,M.readFileSync)(n.file,"utf8")}catch(r){return process.stderr.write(`Could not read ${n.file}: ${r.message}
598
+ `),2}else i=await ke();if(!i)return process.stderr.write(`${c.id} needs some input. Give it as an argument, with --file, or on a pipe:
599
+ redbison ${c.id} "text"
600
+ cat file | redbison ${c.id}
601
+
602
+ redbison ${c.id} --help explains the options.
603
+ `),2}let t={...n.options};for(let[r,a]of Object.entries(t))if(typeof a=="string"&&a.startsWith("@"))try{t[r]=(0,M.readFileSync)(a.slice(1),"utf8")}catch(s){return process.stderr.write(`Could not read ${a.slice(1)}: ${s.message}
604
+ `),2}try{let r=await X(c.id,i,t,{offline:n.offline});return n.json?process.stdout.write(`${JSON.stringify({tool:c.id,input:i,options:t,output:r})}
605
+ `):process.stdout.write(r.endsWith(`
606
+ `)?r:`${r}
607
+ `),0}catch(r){return r instanceof g?(process.stderr.write(`${r.message}
608
+ `),1):(process.stderr.write(`${c.id} failed: ${r.message}
609
+ `),1)}}process.argv[1]&&/redbison|cli[/\\](dist|src)[/\\]index/.test(process.argv[1])&&Y(process.argv.slice(2)).then(o=>process.exit(o)).catch(o=>{process.stderr.write(`${o?.message??o}
610
+ `),process.exit(1)});0&&(module.exports={main});
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
1
  {
2
2
  "name": "@redbison/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "100 developer tools in your terminal. 65 of them never touch the network.",
5
+ "keywords": [
6
+ "cli",
7
+ "json",
8
+ "base64",
9
+ "uuid",
10
+ "hash",
11
+ "jwt",
12
+ "developer-tools",
13
+ "offline"
14
+ ],
15
+ "homepage": "https://redbison.dev/cli",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/redbison-dev/redbison-tools.git"
19
+ },
20
+ "license": "MIT",
21
+ "type": "commonjs",
22
+ "bin": {
23
+ "redbison": "dist/index.js",
24
+ "rb": "dist/index.js"
25
+ },
26
+ "files": [
27
+ "dist",
28
+ "README.md"
29
+ ],
30
+ "engines": {
31
+ "node": ">=18"
32
+ },
33
+ "scripts": {
34
+ "build": "esbuild src/index.ts --bundle --outfile=dist/index.js --platform=node --target=node18 --format=cjs --minify && chmod +x dist/index.js",
35
+ "test": "vitest run",
36
+ "typecheck": "tsc --noEmit -p tsconfig.json"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^22.10.2",
40
+ "esbuild": "^0.24.2",
41
+ "typescript": "^5.7.2",
42
+ "vitest": "^2.1.8"
43
+ }
44
+ }