diff options
| author | twells46 <173561638+twells46@users.noreply.github.com> | 2026-04-13 14:29:14 -0500 |
|---|---|---|
| committer | twells46 <173561638+twells46@users.noreply.github.com> | 2026-04-13 14:29:14 -0500 |
| commit | aa7094c66254e8ec27bd5443598aca51cbae8e9e (patch) | |
| tree | 4dba968098bece3f500274ed3d95bc7798773d3b /cards.jsonl | |
| parent | 9b64caaf249128d9aa040e9c44944525f13f1e49 (diff) | |
Diffstat (limited to 'cards.jsonl')
| -rw-r--r-- | cards.jsonl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cards.jsonl b/cards.jsonl index 5cdb994..1a82b2a 100644 --- a/cards.jsonl +++ b/cards.jsonl @@ -123,3 +123,16 @@ {"id":"jq_build_object_from_fields","intent":["construct a new json object with jq","pick only selected fields from json","reshape json into smaller object","jq object literal example"],"command":"jq '{id, command, tags}' file.json","alternatives":["jq '{name: .metadata.name, version: .metadata.version}' file.json"],"explanation":"Builds a new object containing only the fields you want, optionally with renamed keys or nested lookups.","requires":["jq"],"packages":{"fedora":["jq"],"debian":["jq"],"arch":["jq"]},"tags":["jq","json","transform"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} {"id":"jq_sort_array_by_field","intent":["sort json array by field with jq","order objects by property value","jq sort objects by name","sort array entries in json"],"command":"jq 'sort_by(.name)' file.json","alternatives":["jq 'sort_by(.created_at) | reverse' file.json"],"explanation":"Sorts an array of objects by the chosen field before printing the result.","requires":["jq"],"packages":{"fedora":["jq"],"debian":["jq"],"arch":["jq"]},"tags":["jq","json","sort"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} {"id":"jq_count_array_items","intent":["count array items with jq","get length of json array","how many objects are in this json list","jq length example"],"command":"jq 'length' file.json","alternatives":["jq '.items | length' file.json"],"explanation":"Returns the number of elements in an array, or the number of keys in an object.","requires":["jq"],"packages":{"fedora":["jq"],"debian":["jq"],"arch":["jq"]},"tags":["jq","json","count"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} +{"id":"sort_version_numbers","intent":["sort version strings naturally","order versions like 1.9 1.10 correctly","version sort lines","sort semantic-ish version text"],"command":"sort -V versions.txt","alternatives":["printf '%s\n' 1.9 1.10 1.2 | sort -V"],"explanation":"Sorts text using version-aware ordering so dotted numbers come out in the order humans expect.","requires":["sort"],"packages":{},"tags":["text","sort","versions"],"platform":["linux"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} +{"id":"tsort_topological_order","intent":["topologically sort dependency pairs","order tasks from parent child edges","resolve simple dependency chain from pairs","tsort example"],"command":"tsort edges.txt","alternatives":["printf 'build test\ntest deploy\n' | tsort"],"explanation":"Reads whitespace-separated dependency pairs and prints a topological order, which is easy to forget exists.","requires":["tsort"],"packages":{},"tags":["text","graph","dependencies"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} +{"id":"nl_number_all_lines","intent":["number every line in a file","show line numbers including blank lines","annotate text with line numbers","nl all lines example"],"command":"nl -ba file.txt","alternatives":["cat -n file.txt"],"explanation":"Numbers all lines, including blank ones, which is handy when exact line references matter.","requires":["nl"],"packages":{},"tags":["text","lines","numbering"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} +{"id":"pr_two_column_view","intent":["display a file in two columns","split text into side by side columns","pretty print file as columns","pr multi column example"],"command":"pr -T -2 file.txt","alternatives":["pr -T -3 file.txt"],"explanation":"Formats text into multiple columns without headers, a useful but often-forgotten pager-style trick.","requires":["pr"],"packages":{},"tags":["text","formatting","columns"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} +{"id":"xargs_null_delimited","intent":["handle filenames with spaces from find","pass null delimited input to another command","safe xargs for weird filenames","xargs zero terminated example"],"command":"find . -type f -print0 | xargs -0 file","alternatives":["find . -type f -print0 | xargs -0 -n1 basename"],"explanation":"Consumes NUL-delimited input so paths with spaces, quotes, and newlines are handled safely.","requires":["find","xargs"],"packages":{},"tags":["find","xargs","files","safety"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} +{"id":"split_file_by_size","intent":["split a large file into chunks","break file into 100MB pieces","chunk big file by size","split archive or log into parts"],"command":"split -b 100M bigfile chunk-","alternatives":["split -l 10000 file.txt chunk-"],"explanation":"Splits a file into smaller pieces by size or line count using a chosen output prefix.","requires":["split"],"packages":{},"tags":["files","split","chunks"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-modifying"} +{"id":"expand_tabs_to_spaces","intent":["convert tabs to spaces","replace tab characters with spaces","normalize indentation from tabs","expand tabs in text file"],"command":"expand -t 4 file.txt","alternatives":["expand file.txt"],"explanation":"Replaces tab characters with the corresponding number of spaces at the chosen tab stop width.","requires":["expand"],"packages":{},"tags":["text","tabs","whitespace"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} +{"id":"unexpand_spaces_to_tabs","intent":["convert spaces to tabs","compress indentation back into tabs","replace leading spaces with tabs","unexpand text example"],"command":"unexpand -a file.txt","alternatives":["unexpand --first-only file.txt"],"explanation":"Turns runs of spaces into tabs where possible, which is useful when matching tab-based formatting.","requires":["unexpand"],"packages":{},"tags":["text","tabs","whitespace"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} +{"id":"script_capture_clean_output","intent":["capture output exactly as shown in terminal","record command output through a pseudo tty","run command under script to preserve tty behavior","script command example"],"command":"script -q -c 'command' /dev/null","alternatives":["script session.log"],"explanation":"Runs a command under a pseudo-terminal, which helps with programs that behave differently when stdout is not a TTY.","requires":["script"],"packages":{},"tags":["terminal","tty","capture"],"platform":["linux","macos"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} +{"id":"flock_single_instance_command","intent":["prevent two copies of a command from running","take a lock file before running command","serialize script execution with flock","run only one instance"],"command":"flock -n /tmp/my.lock command","alternatives":["flock /tmp/my.lock command"],"explanation":"Uses a lock file to ensure only one instance runs at a time, which is easy to overlook when scripting.","requires":["flock"],"packages":{},"tags":["locking","scripts","concurrency"],"platform":["linux"],"shell":["bash","zsh","fish"],"safety":"safe-modifying"} +{"id":"env_clean_shell","intent":["start command with empty environment","debug issue caused by env vars","run shell without inherited environment","test command in clean env"],"command":"env -i bash --noprofile --norc","alternatives":["env -i PATH=\"$PATH\" command"],"explanation":"Starts a command with an empty environment so you can isolate problems caused by inherited variables or shell startup files.","requires":["env","bash"],"packages":{},"tags":["environment","shell","debugging"],"platform":["linux","macos"],"shell":["bash","zsh"],"safety":"safe-readonly"} +{"id":"kernel_cmdline_current","intent":["view current kernel commandline","show current kernel command line","inspect boot kernel arguments","read running kernel cmdline"],"command":"cat /proc/cmdline","alternatives":[],"explanation":"Prints the kernel command line that the currently running system was booted with.","requires":["cat"],"packages":{},"tags":["kernel","boot","cmdline"],"platform":["linux"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} +{"id":"sysctl_list_all","intent":["view current kernel parameters","show all current kernel parameters","list all sysctl settings","inspect all runtime kernel tunables"],"command":"sysctl -a","alternatives":["find /proc/sys -type f | sort"],"explanation":"Lists all currently readable sysctl-exposed kernel parameters and their values.","requires":["sysctl"],"packages":{},"tags":["kernel","sysctl","parameters"],"platform":["linux"],"shell":["bash","zsh","fish"],"safety":"safe-readonly"} |