Tema: cli
-
El filtrado por defecto de ripgrep acorta las búsquedas de código de los agentes frente a grep -r
Hipótesis: los agentes de codificación que buscan en repositorios con las reglas de exclusión por defecto de ripgrep (se omiten los archivos ignorados por git, los ocultos y los binarios) necesitan menos llamadas de búsqueda y leen menos resultado irrelevante por tarea que los agentes que usan grep -r sin exclusiones, porque no aparecen coincidencias en artefactos de compilación ni en dependencias; no se reporta ninguna medición.
-
Diseñar una herramienta de línea de comandos en Python: argparse, main() y códigos de salida
Coloca la interfaz en una función main(argv) -> int registrada como console script, valida con los parámetros type y choices de argparse, sigue la convención de códigos de salida (0 éxito, 2 error de uso, 1 otro fallo, códigos de sysexits solo si están documentados), mantén los resultados en stdout y los diagnósticos en stderr, y gestiona SIGINT y las tuberías rotas (broken pipes).
-
How do teams run several coding agents in parallel git worktrees without their caches, hooks and ports colliding?
Open question: worktrees give each agent its own branch and files, and the git-worktree documentation says a linked worktree shares everything except per-worktree files such as HEAD and the index, so hooks and configuration are shared while build caches, dependency directories and local ports are often hard-coded; which conventions have kept parallel agent runs isolated, and what broke first?
-
grep and ripgrep for code search: recursion, filters and exit codes
GNU grep searches recursively with -r, narrows with --include and --exclude-dir and exits 0, 1 or 2 for match, no match or error; ripgrep does the same by default while skipping git-ignored, hidden and binary files. Know what each tool skips before trusting an empty result.
-
Locale and date pitfalls in coreutils: LC_ALL, character ranges and GNU versus BSD date
The locale silently changes sort order, what [a-z] matches, decimal separators and the default date format; scripts should set LC_ALL=C (or C.UTF-8) and TZ explicitly, request explicit date formats, and avoid GNU-only date -d or BSD-only date -v unless the platform is known.
-
SSH tunnels: local, remote and dynamic port forwarding
ssh -L exposes a remote service on a local port, -R exposes a local service on the remote host, -D provides a SOCKS proxy and -J hops through a bastion; combine them with -N, bind to localhost and set ExitOnForwardFailure so that a forward that could not be set up does not leave a silently useless session.
-
sort, uniq and comm: set operations on text that depend on sorted input
uniq only collapses adjacent duplicates, comm requires both inputs sorted in the same collation, and sort's order follows LC_COLLATE; run such pipelines under LC_ALL=C, pick the right key options (-n, -h, -V, -k, -t) and use comm -12 and comm -23 for intersections and differences.
-
make as a task runner: phony targets, tabs and one shell per line
A Makefile is a workable entry point for a repository's commands if command targets are declared .PHONY, recipe lines start with a tab, and it is understood that each recipe line runs in its own shell unless .ONESHELL is set; keep the default goal harmless and keep real file dependencies real.
-
find and xargs without surprises: null-separated names, -exec + and dry runs
File names may contain spaces and newlines, so pass them from find to other programs with -print0 and xargs -0 (or find -exec ... {} +), test the selection with -print before adding -delete, and use xargs -r so that an empty list runs nothing.
-
Working with JSON on the command line with jq
jq reads JSON, applies a filter and prints the result: use -r for plain strings, -c for one object per line, --arg and --argjson to pass values in safely, -e to turn null or false into an exit code, and select, map and to_entries to reshape; never assemble filters by string concatenation.
-
Checking a served TLS certificate chain and its expiry from the command line with openssl
openssl s_client with -servername and -showcerts prints the certificates a server actually sends, which the manual describes as not a verified chain; openssl x509 reads subject, issuer, SANs and the notAfter date of each one, and openssl verify -untrusted rebuilds the chain against a trust store. Check every hostname, and IPv4 and IPv6 separately.
-
Debugging HTTP with curl: verbose output, timing breakdown and forcing the connection
Use curl -v or --trace-ascii to see the exact request and response, --write-out with time_namelookup, time_connect, time_appconnect, time_starttransfer and time_total to locate where the time goes, and --resolve or --connect-to to send a request to one specific server while keeping the Host header and TLS name intact.
-
sed and awk for line-oriented edits: substitution, fields and in-place changes
sed applies editing commands, chiefly s/regexp/replacement/, to each line; awk splits lines into fields and runs pattern-action pairs. Use sed for substitutions and deletions, awk for column work and small aggregations, and handle -i, -n and GNU-versus-BSD differences deliberately.
-
Parallel work with git worktrees instead of stash-and-switch
git worktree add creates a second working directory attached to the same repository, so a hotfix, a review or an agent's task can run on its own branch without disturbing the current checkout; a branch can be checked out in only one worktree at a time, and worktrees are removed with git worktree remove rather than rm.
Legible por máquina: JSON