From 83af6b3c728dddcdf5c16b5cfc1288de2f697fcd Mon Sep 17 00:00:00 2001 From: ivuorinen Date: Tue, 18 Nov 2025 00:20:54 +0000 Subject: [PATCH] Update cheatsheets --- tldr/az-login | 2 +- tldr/brew-tap | 29 +++++++++++++++++++ tldr/clido | 2 +- tldr/code2prompt | 29 +++++++++++++++++++ tldr/doppler | 4 --- tldr/fd | 8 ++++-- tldr/ifne | 4 +-- tldr/jj-diffedit | 33 ++++++++++++++++++++++ tldr/linux/csplit | 16 +++++++---- tldr/linux/koji-help | 21 ++++++++++++++ tldr/linux/systemctl-reenable | 22 +++++++++++++++ tldr/linux/systemctl-service-log-target | 34 +++++++++++++++++++++++ tldr/linux/toolbox | 14 ++++++++-- tldr/linux/toybox | 34 +++++++++++++++++++++++ tldr/lolcat | 12 ++++++++ tldr/npm-install | 4 +-- tldr/npm-uninstall | 2 +- tldr/npm-update | 2 +- tldr/pass | 2 +- tldr/stow | 10 +++---- tldr/ttyd | 33 ++++++++++++++++++++++ tldr/yek | 37 +++++++++++++++++++++++++ 22 files changed, 325 insertions(+), 29 deletions(-) create mode 100644 tldr/brew-tap create mode 100644 tldr/code2prompt create mode 100644 tldr/jj-diffedit create mode 100644 tldr/linux/koji-help create mode 100644 tldr/linux/systemctl-reenable create mode 100644 tldr/linux/systemctl-service-log-target create mode 100644 tldr/linux/toybox create mode 100644 tldr/ttyd create mode 100644 tldr/yek diff --git a/tldr/az-login b/tldr/az-login index f440ec54..4c363851 100644 --- a/tldr/az-login +++ b/tldr/az-login @@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git - Log in with a service principal using a client secret: -`az login --service-principal {{[-u|--username]}} {{http://azure-cli-service-principal}} {{[-p|--password]}} {{secret}} --tenant {{someone.onmicrosoft.com}}` +`az login --service-principal {{[-u|--username]}} {{http://azure-cli-service-principal}} {{[-p|--password]}} {{secret}} {{[-t|--tenant]}} {{someone.onmicrosoft.com}}` - Log in with a service principal using a client certificate: diff --git a/tldr/brew-tap b/tldr/brew-tap new file mode 100644 index 00000000..63eb5fd9 --- /dev/null +++ b/tldr/brew-tap @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# brew tap + +> Tap a Homebrew formula repository. If no arguments are provided, list all installed Homebrew taps. +> More information: . + +- List installed Homebrew taps: + +`brew tap` + +- Tap a Git repository hosted on GitHub: + +`brew tap {{github_username}}/{{github_repository_name}}` + +- Tap a Git repository hosted outside of GitHub: + +`brew tap {{username}}/{{repository_name}} {{git_clone_url}}` + +- Tap a repository hosted on GitLab: + +`brew tap {{username}}/{{repository_name}} https://gitlab.com/{{username}}/{{repository_name}}.git` + +- Display help: + +`brew tap {{[-h|--help]}}` diff --git a/tldr/clido b/tldr/clido index 82cebd00..e10a7ff6 100644 --- a/tldr/clido +++ b/tldr/clido @@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # clido > Save-state TODO app for the terminal. -> More information: . +> More information: . - Create a list: diff --git a/tldr/code2prompt b/tldr/code2prompt new file mode 100644 index 00000000..af498ddf --- /dev/null +++ b/tldr/code2prompt @@ -0,0 +1,29 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# code2prompt + +> Generate AI-ready prompts from a codebase (extracts, filters and formats code for LLMs). +> More information: . + +- Generate a prompt for the current project and copy it to the clipboard (default behaviour): + +`code2prompt {{path/to/project}}` + +- Include only specific files and exclude a directory: + +`code2prompt {{path/to/project}} {{[-i|--include]}} "{{**/*.rs}}" {{[-e|--exclude]}} "{{tests/**}}"` + +- Write the prompt to a file instead of the clipboard: + +`code2prompt {{path/to/project}} {{[-O|--output-file]}} {{my_prompt.txt}}` + +- Produce structured JSON output: + +`code2prompt {{path/to/project}} {{[-F|--output-format]}} json` + +- Use a custom Handlebars template when generating the prompt: + +`code2prompt {{path/to/project}} {{[-t|--template]}} {{my_template.hbs}}` diff --git a/tldr/doppler b/tldr/doppler index 93f89026..adbb8854 100644 --- a/tldr/doppler +++ b/tldr/doppler @@ -9,10 +9,6 @@ source: https://github.com/tldr-pages/tldr.git > Some subcommands such as `run` and `secrets` have their own usage documentation. > More information: . -- Setup Doppler CLI in the current directory: - -`doppler setup` - - Setup Doppler project and configuration in current directory: `doppler setup` diff --git a/tldr/fd b/tldr/fd index f6c103b9..c9a049ff 100644 --- a/tldr/fd +++ b/tldr/fd @@ -5,8 +5,8 @@ source: https://github.com/tldr-pages/tldr.git --- # fd -> An alternative to `find`. -> Aims to be faster and easier to use than `find`. +> Find entries in the filesystem. +> See also: `find`. > More information: . - Recursively find files matching a specific pattern in the current directory: @@ -29,6 +29,10 @@ source: https://github.com/tldr-pages/tldr.git `fd {{[-H|--hidden]}} {{[-I|--no-ignore]}} "{{string|regex}}"` +- Exclude files that match a specific `regex`: + +`fd {{string}} {{[-E|--exclude]}} {{regex}}` + - Execute a command on each search result returned: `fd "{{string|regex}}" {{[-x|--exec]}} {{command}}` diff --git a/tldr/ifne b/tldr/ifne index a494b179..a230ebfa 100644 --- a/tldr/ifne +++ b/tldr/ifne @@ -10,8 +10,8 @@ source: https://github.com/tldr-pages/tldr.git - Run the specified command if and only if `stdin` is not empty: -`ifne {{command options ...}}` +`ifne {{command}} {{command_options}}` - Run the specified command if and only if `stdin` is empty, otherwise pass `stdin` to `stdout`: -`ifne -n {{command options ...}}` +`ifne -n {{command}} {{command_options}}` diff --git a/tldr/jj-diffedit b/tldr/jj-diffedit new file mode 100644 index 00000000..f5834d96 --- /dev/null +++ b/tldr/jj-diffedit @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# jj diffedit + +> Touch up the content changes in a revision with a diff editor. +> More information: . + +- Edit changes in the current revision with a diff editor: + +`jj diffedit` + +- Edit changes in a given revision: + +`jj diffedit {{[-r|--revision]}} {{revset}}` + +- Edit changes comparing a "from" revision to a "to" revision: + +`jj diffedit {{[-f|--from]}} {{from_revset}} {{[-t|--to]}} {{to_revset}}` + +- Edit only specific paths (unmatched paths remain unchanged): + +`jj diffedit {{filesets}}` + +- Use a specific diff editor: + +`jj diffedit --tool {{name}}` + +- Preserve content instead of diff when rebasing descendants: + +`jj diffedit --restore-descendants` diff --git a/tldr/linux/csplit b/tldr/linux/csplit index 48392328..0e2161d7 100644 --- a/tldr/linux/csplit +++ b/tldr/linux/csplit @@ -9,22 +9,26 @@ source: https://github.com/tldr-pages/tldr.git > This generates files named "xx00", "xx01", and so on. > More information: . -- Split a file at lines 5 and 23: +- Split a file in two parts, starting the second one at line 10: -`csplit {{path/to/file}} 5 23` +`csplit {{path/to/file}} 10` -- Split a file every 5 lines (this will fail if the total number of lines is not divisible by 5): +- Split a file in three parts, starting the latter parts in lines 7 and 23: + +`csplit {{path/to/file}} 7 23` + +- Start a new part at every 5th line (will fail if number of lines is not divisible by 5): `csplit {{path/to/file}} 5 {*}` -- Split a file every 5 lines, ignoring exact-division error: +- Start a new part at every 5th line, ignoring exact-division error: `csplit {{[-k|--keep-files]}} {{path/to/file}} 5 {*}` -- Split a file at line 5 and use a custom prefix for the output files: +- Split a file above line 5 and use a custom prefix for the output files (default is `xx`): `csplit {{path/to/file}} 5 {{[-f|--prefix]}} {{prefix}}` -- Split a file at a line matching a `regex`: +- Split a file above the first line matching a `regex` pattern: `csplit {{path/to/file}} /{{regex}}/` diff --git a/tldr/linux/koji-help b/tldr/linux/koji-help new file mode 100644 index 00000000..e23e157e --- /dev/null +++ b/tldr/linux/koji-help @@ -0,0 +1,21 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# koji help + +> Display help information for Koji commands. +> More information: . + +- Display all available commands: + +`koji help` + +- Display help for specific subcommand (such as `build`, `call`, `cancel`, `tag-build`, etc.): + +`koji help {{subcommand}}` + +- Display help: + +`koji {{[-h|--help]}}` diff --git a/tldr/linux/systemctl-reenable b/tldr/linux/systemctl-reenable new file mode 100644 index 00000000..5cf920e6 --- /dev/null +++ b/tldr/linux/systemctl-reenable @@ -0,0 +1,22 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# systemctl reenable + +> Re-enable one or more units. +> Used when targets of a service change. +> More information: . + +- Re-enable a unit, restoring its default symlinks: + +`systemctl reenable {{unit}}` + +- Re-enable multiple units at once: + +`systemctl reenable {{unit1 unit2 ...}}` + +- Re-enable a unit and start it immediately: + +`systemctl reenable {{unit}} --now` diff --git a/tldr/linux/systemctl-service-log-target b/tldr/linux/systemctl-service-log-target new file mode 100644 index 00000000..39444964 --- /dev/null +++ b/tldr/linux/systemctl-service-log-target @@ -0,0 +1,34 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# systemctl service-log-target + +> Get or set the log target for a service. +> Only works for D-Bus integrated services. +> More information: . + +- Show the current log target for a service: + +`systemctl service-log-target {{service_name}}` + +- Set the log target to `console` (send logs to `stderr`): + +`systemctl service-log-target {{service_name}} console` + +- Set the log target to `journal` (send logs to `systemd-journald`): + +`systemctl service-log-target {{service_name}} journal` + +- Set the log target to `syslog` (send logs to `/dev/log`): + +`systemctl service-log-target {{service_name}} syslog` + +- Allow systemd to choose an appropriate log target: + +`systemctl service-log-target {{service_name}} auto` + +- Disable all log output: + +`systemctl service-log-target {{service_name}} null` diff --git a/tldr/linux/toolbox b/tldr/linux/toolbox index ff3486f9..5bdcdb5d 100644 --- a/tldr/linux/toolbox +++ b/tldr/linux/toolbox @@ -7,11 +7,19 @@ source: https://github.com/tldr-pages/tldr.git > Manage containerized command-line environments on Linux. > Some subcommands such as `create` have their own usage documentation. -> More information: . +> More information: . -- Run a `toolbox` subcommand: +- Enter a container to use it interactively: -`toolbox {{subcommand}}` +`toolbox enter {{container}}` + +- Remove one or more containers: + +`toolbox rm {{container1 container2 ...}}` + +- Remove one or more images: + +`toolbox rmi {{image1 image2 ...}}` - Display help for a specific subcommand (such as `create`, `enter`, `rm`, `rmi`, etc.): diff --git a/tldr/linux/toybox b/tldr/linux/toybox new file mode 100644 index 00000000..4e8264f7 --- /dev/null +++ b/tldr/linux/toybox @@ -0,0 +1,34 @@ +--- +syntax: markdown +tags: [tldr, linux] +source: https://github.com/tldr-pages/tldr.git +--- +# toybox + +> Multipurpose tool that provides many standard Unix utilities. +> Commonly used in Android and embedded Linux systems. +> More information: . + +- List all available Toybox commands: + +`toybox` + +- Run a Toybox command explicitly (useful if another command with the same name exists in `$PATH`): + +`toybox {{command}} {{arguments}}` + +- List files in the current directory: + +`toybox ls` + +- Remove a file: + +`toybox rm {{path/to/file}}` + +- Display help information for a specific command: + +`toybox {{command}} --help` + +- Display version: + +`toybox --version` diff --git a/tldr/lolcat b/tldr/lolcat index 67bd3f4b..35c8e43a 100644 --- a/tldr/lolcat +++ b/tldr/lolcat @@ -16,6 +16,18 @@ source: https://github.com/tldr-pages/tldr.git `{{fortune}} | lolcat` +- Use a seed to generate consistent colors (default: `0` as in random): + +`lolcat {{[-S|--seed]}} {{number}} {{path/to/file}}` + +- Control rainbow frequency (default: `0.1`): + +`lolcat {{[-F|--frequency]}} {{number}} {{path/to/file}}` + +- Control rainbow smoothing (default: `3`): + +`lolcat {{[-p|--spread]}} {{number}} {{path/to/file}}` + - Print a file to the console with animated rainbow colors: `lolcat {{[-a|--animate]}} {{path/to/file}}` diff --git a/tldr/npm-install b/tldr/npm-install index 46001b96..ad720284 100644 --- a/tldr/npm-install +++ b/tldr/npm-install @@ -18,8 +18,8 @@ source: https://github.com/tldr-pages/tldr.git - Download the latest version of a package and add it to the list of dev dependencies in `package.json`: -`npm {{[i|install]}} {{[-D|--save-dev]}} {{package_name}}` +`npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}` - Download the latest version of a package and install it globally: -`npm {{[i|install]}} {{[-g|--global]}} {{package_name}}` +`npm {{[i|install]}} {{package_name}} {{[-g|--global]}}` diff --git a/tldr/npm-uninstall b/tldr/npm-uninstall index 93f16a9e..3fd5a291 100644 --- a/tldr/npm-uninstall +++ b/tldr/npm-uninstall @@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git - Remove a package globally: -`npm {{[r|uninstall]}} {{[-g|--global]}} {{package_name}}` +`npm {{[r|uninstall]}} {{package_name}} {{[-g|--global]}}` - Remove multiple packages at once: diff --git a/tldr/npm-update b/tldr/npm-update index 0af850b6..7c2d7b6a 100644 --- a/tldr/npm-update +++ b/tldr/npm-update @@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git - Update a package globally: -`npm {{[up|update]}} {{[-g|--global]}} {{package}}` +`npm {{[up|update]}} {{package}} {{[-g|--global]}}` - Update multiple packages at once: diff --git a/tldr/pass b/tldr/pass index 52dc3d45..b2d662fa 100644 --- a/tldr/pass +++ b/tldr/pass @@ -11,7 +11,7 @@ source: https://github.com/tldr-pages/tldr.git - Initialize (or re-encrypt) the storage using one or more GPG IDs: -`pass init {{gpg_id_1}} {{gpg_id_2}}` +`pass init {{gpg_id_1 gpg_id_2 ...}}` - Save a new password and additional information (press `` on a new line to complete): diff --git a/tldr/stow b/tldr/stow index 52786325..05860dfe 100644 --- a/tldr/stow +++ b/tldr/stow @@ -12,20 +12,20 @@ source: https://github.com/tldr-pages/tldr.git - Symlink all files recursively to a given directory: -`stow {{[-t|--target]}} {{path/to/target_directory}} {{file1 directory1 file2 directory2}}` +`stow {{[-t|--target]}} {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` - Delete symlinks recursively from a given directory: -`stow {{[-D|--delete]}} {{[-t|--target]}} {{path/to/target_directory}} {{file1 directory1 file2 directory2}}` +`stow {{[-D|--delete]}} {{[-t|--target]}} {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` - Simulate to see what the result would be like: -`stow {{[-n|--simulate]}} {{[-t|--target]}} {{path/to/target_directory}} {{file1 directory1 file2 directory2}}` +`stow {{[-n|--simulate]}} {{[-t|--target]}} {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` - Delete and resymlink: -`stow {{[-R|--restow]}} {{[-t|--target]}} {{path/to/target_directory}} {{file1 directory1 file2 directory2}}` +`stow {{[-R|--restow]}} {{[-t|--target]}} {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` - Exclude files matching a `regex`: -`stow --ignore={{regex}} {{[-t|--target]}} {{path/to/target_directory}} {{file1 directory1 file2 directory2}}` +`stow --ignore={{regex}} {{[-t|--target]}} {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}` diff --git a/tldr/ttyd b/tldr/ttyd new file mode 100644 index 00000000..95cadcdd --- /dev/null +++ b/tldr/ttyd @@ -0,0 +1,33 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# ttyd + +> Share a terminal or any command over the web. +> More information: . + +- Start a read only web server sharing Bash shell on the default port (7681): + +`ttyd bash` + +- Start Bash on a specific port: + +`ttyd {{[-p|--port]}} {{8080}} bash` + +- Allow clients to write to the terminal: + +`ttyd {{[-W|--writable]}} {{command}}` + +- Set client options: + +`ttyd {{[-t|--client-option]}} {{key=value}} {{command}}` + +- Display help: + +`ttyd {{[-h|--help]}}` + +- Display version: + +`ttyd {{[-v|--version]}}` diff --git a/tldr/yek b/tldr/yek new file mode 100644 index 00000000..b0bde8fc --- /dev/null +++ b/tldr/yek @@ -0,0 +1,37 @@ +--- +syntax: markdown +tags: [tldr, common] +source: https://github.com/tldr-pages/tldr.git +--- +# yek + +> Serialize a repository or directory into an LLM-friendly single file (fast Rust-based repomapper). +> More information: . + +- Serialize the current directory and write the output to a temp file (prints path): + +`yek` + +- Serialize specific directories and write output to a directory: + +`yek {{path/to/directory1 path/to/directory2 ...}} --output-dir {{path/to/output_directory}}` + +- Process multiple files or use glob patterns (quote globs to avoid shell expansion): + +`yek "{{path/to/directory/**/*.rs}}" "{{path/to/directory/**/*.md}}"` + +- Cap the token-based output size to 128k tokens: + +`yek {{path/to/directory}} --tokens 128k` + +- Cap the byte-based max output size and set an explicit output file name: + +`yek {{path/to/directory}} --max-size {{100KB}} --output-name {{yek-output.txt}}` + +- Stream JSON output: + +`yek {{path/to/directory}} --json` + +- Include a directory tree header in the output: + +`yek {{path/to/directory}} --tree-header`